Hi all,

my problem was quite different from Craigs (see below):

I've got a running DBI app on, say, instance ora1.
On the same host there is another instance, ora2, with a different ORACLE_HOME,
which causes the problems.
DBD::Oracle was built with ora1 environment.
I didn't find a satisfiying solution till now.

My app is a databas backup which uses the connect internal method '/ as sysdba'.
(I certainly do not want to hardcode any passwords in my apps!):
my $sid = "ORA1";
$ENV{ORACLE_SID}        = "$sid";
$ENV{ORACLE_HOME}       = "$ora_home";
my $connect_mode = 2;    # SYSDBA
if ( $dbh = DBI->connect( 'dbi:Oracle:','', '',
    { ora_session_mode => $connect_mode,
       PrintError => 1, RaiseError => 0,
      AutoCommit => 0 } ) ...

This works fine for ora1 but not for ora2.
(ora2 is configured in my tnsnames.ora)
(there is no problem with 'sqlplus user/[EMAIL PROTECTED]')

I've been digging much deeper an found:
*** if I set TWO_TASK (instead of ORACLE_SID and the same $ENV{ORACLE_HOME} as
ora1) I get:
ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)
*** if I further omit the 'ora_session_mode => $connect_mode', I get:
ORA-01004: default username feature not supported; logon denied (DBD ERROR:
OCISessionBegin)
*** now I can connect via:
$dbh = DBI->connect( "$dsn", 'system', 'manager')
--> hard coded password
--> connect internal not possible

My questions are:
* is there any chance to 'connect internal as sysdba' to a 'remote' instance
(via tnsnames.ora) ?
* are there any workarounds (i.e. private DBD::Oracle installs for each
ORACLE_HOME) ?

BTW, my ENV (example, there are many other hosts):
perl, v5.8.0 built for sun4-solaris
DBI         Version: 1.43
DBD::Oracle Version: 1.15
ORACLE_HOME=/oracle/SID/817_64
(ora2 is a 8.0.6 instance)

TIA,
Christian
---------------------------------------------------------
Landeshauptstadt M�nchen
Direktorium - AFID 3.3 - Oracle DBA
C.A. Merz


----- Original Message -----
From: "Craig Delahoy (w)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 23, 2004 8:36 AM
Subject: OCIInitialize error


> Hi Christian.
>
> I read a note you submitted to coding.derkeiler.com, about the sudden
> appearance of the Oracle error "(UNKNOWN OCI STATUS 1804) OCIInitialize."
> I see you got no responses to that post.
>
> Did you ever find the solution? I ask because I have suddenly found
> exactly the same problem. It worked in the morning, and gave me this error
> in the afternoon.
>
> Craig Delahoy
> October Productions
> www.october.com.au


Reply via email to