Hi Martin,

I will be running Oracle as the database backend for OpenCA. I noticed
that Oracle support exists but I remember reading in the docs that
it is not verified if Oracle DB support really works.

Yes, somebody requested Oracle support. I coded it but we never verified it completely because I ahve no Oracle.


So I just tried it (we are using Oracle 9.2.0.1), and here are the
first results:

Configuration issues:
* db_name is actually the Oracle SID (of course)
* db_port is 1521
* Connecting to the database seems to work, but the environment variable
  ORACLE_HOME must be set for the OpenCA server process (via openca_start)

We can add a file oracle.xml to the OpenCA guide. A guide for postgresql already exists there. The environment variable can be configured like for IBM DB2. Please see etc/DBI.conf


DEBUG: OpenCA::DBI->Entering errno ...
DEBUG: OpenCA::DBI->errno: gettext is defined
DEBUG: OpenCA::DBI->errno: new errorcode defined
DEBUG: OpenCA::DBI->errno: new errorcode is 11111
DEBUG: OpenCA::DBI->errno: returning local errorcode 11111
DEBUG: OpenCA::DBI->initDB: Entering sub initDB
DEBUG: OpenCA::DBI->initDB: MODE: NONE
DEBUG: OpenCA::DBI->initDB: force: 0
DEBUG: OpenCA::DBI->initDB: table: CA_CERTIFICATE
DEBUG: OpenCA::DBI->initDB: dsn: dbi:Oracle:DCA01
DEBUG: OpenCA::DBI->initDB: the folloing debugging-output is for DB2
DEBUG: OpenCA::DBI->initDB: ld_library_path:
DEBUG: OpenCA::DBI->initDB: path:
/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/kde3/bin:/usr/lib/java/jre/bin
DEBUG: OpenCA::DBI->initDB: libpath
DEBUG: OpenCA::DBI->initDB: classpath
DEBUG: OpenCA::DBI->Entering errno ...
DEBUG: OpenCA::DBI->errno: gettext is defined
DEBUG: OpenCA::DBI->errno: new errorcode defined
DEBUG: OpenCA::DBI->errno: old errno 11111 is present
DEBUG: OpenCA::DBI->errno: new errorcode is 11111
DEBUG: OpenCA::DBI->errno: returning local errorcode 11111
DEBUG: OpenCA::DBI->operateTable: Entering sub operateTable
DEBUG: OpenCA::DBI->operateTable: build the create statements
DEBUG: OpenCA::DBI->operateTable: table: ca_certificate
DEBUG: OpenCA::DBI->operateTable: create: create table ca_certificate
(ca_cert_key varchar2 (1999) PRIMARY KEY NOT NULL, format varchar2 (1999),
data LONG, dn varchar2 (1999), cn varchar2 (1999), email varchar2 (1999),
status varchar2 (1999), public_key varchar2 (1999), notafter number (38))
DEBUG: OpenCA::DBI->operateTable: build the statement finally
DEBUG: OpenCA::DBI->operateTable: statement: select * from ca_certificate
DEBUG: OpenCA::DBI->operateTable: run the statement
DEBUG: OpenCA::DBI->Entering errno ...
DEBUG: OpenCA::DBI->errno: gettext is defined
DEBUG: OpenCA::DBI->errno: new errorcode defined
DEBUG: OpenCA::DBI->errno: old errno 11111 is present
DEBUG: OpenCA::DBI->errno: new errorcode is 11111
DEBUG: OpenCA::DBI->errno: returning local errorcode 11111
DEBUG: OpenCA::DBI->doQuery: entering function
DEBUG: OpenCA::DBI->doQuery: query: select * from ca_certificate
DEBUG: OpenCA::DBI->doQuery: prepare statement
DEBUG: OpenCA::DBI->doQuery: statement nr.: 1
DBD::Oracle::db prepare failed: ORA-00942: table or view does not exist
(DBD ERROR: error possibly near <*> indicator at char 14 in 'select * from
<*>ca_certificate') [for statement ``select * from ca_certificate'']) at
/usr/lib/perl5/site_perl/5.8.0/OpenCA/DBI.pm line 2518.

This is not an error. This is the way like I try to detect an already existing table. The former SQL query in "create: ..." is not used. The really executed query is the select statement to detect an already existing table. If the query fails then the module knows that the table is not present.


DEBUG: OpenCA::DBI->rollback: entering function
DEBUG: OpenCA::DBI->Entering errno ...
DEBUG: OpenCA::DBI->errno: gettext is defined
DEBUG: OpenCA::DBI->errno: returning local errorcode 11111
OpenCA: General error trapped 700: The compilation of the command cmdGenDB
failed. Can't call method "state" on an undefined value at
/usr/lib/perl5/site_perl/5.8.0/OpenCA/DBI.pm line 2519.<br>
Compilation failed in require at ./openca_start line 62.

This is the real bug. Usually a database only compiles a query if you run prepare but it looks like Oracle performs some checks during prepare and this is not expected by OpenCA. prepare should not return undef. The other databases return at minimum a statement handle and I can check the SQL state of this handle but this is not possible with Oracle if it returns undef. I fixed this in OpenCA::DBI (DBI.pm v1.107).


Have a nice weekend

Michael
--
-------------------------------------------------------------------
Michael Bell                   Email: [EMAIL PROTECTED]
ZE Computer- und Medienservice            Tel.: +49 (0)30-2093 2482
(Computing Centre)                        Fax:  +49 (0)30-2093 2704
Humboldt-University of Berlin
Unter den Linden 6
10099 Berlin                   Email (private): [EMAIL PROTECTED]
Germany                                       http://www.openca.org



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
OpenCA-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openca-devel

Reply via email to