Thankyou for the feedback, it is much appreciated.

I'll give you a further insight into the problem.

I'm using OS authentication to connect to the database. I am the user
'oracle' who is a member of the dba group.

Under Oracle 8i, I used the following syntax:

my $dbh=DBI->connect("DBI:Oracle:$SID", "$UserName", "$Password") or die
{&DBConnect};

The UserName is set to sys, the password is sourced from another file. It
connects fine.

Under 9i, using the same syntax results in the following error:

DBI->connect(test9i) failed: ORA-28009: connection to sys should be as
sysdba or sysoper (DBD ERROR: OCISessionBegin) at ./DB_ASSIST.copy line 457

dopey% oerr ora 28009
28009, 00000, "connection to sys should be as sysdba or sysoper"
// *Cause:    connect sys/<password> is no longer a valid syntax
// *Action:   Try connect sys/<password> as sysdba or
//            connect sys/<password> as sysoper

I then added in the ora_session_mode which should allow connection as sysdba
but it fails with the 'ora 01031' error

In 8i, you can connect to the database via OS authentication:   sqlplus
sys/sys_password@service_name or sqlplus sys/manager you cannot use this in
9i.

In 9i, for OS authentication, you have to use:  sqlplus "/ as sysdba" or 
                                                sqlplus /nolog
                                                SQL> connect sys/<syspw> as
sysdba (or connect / as sysdba)

I need to translate one of the above for DBI, can somebody explain how ?

Many thanks,

Tony

-----Original Message-----
From: Andreas Huber [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 11:46 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Antwort: DBI connect problem - desperate for a solution



Hi!

oracle@xcsyt99x:~ > oerr ora 1031
01031, 00000, "insufficient privileges"
// *Cause: An attempt was made to change the current username or password
//         without the appropriate privilege. This error also occurs if
//         attempting to install a database without the necessary operating
//         system privileges.
//         When Trusted Oracle is configure in DBMS MAC, this error may
occur
//         if the user was granted the necessary privilege at a higher label
//         than the current login.
// *Action: Ask the database administrator to perform the operation or grant
//          the required privileges.
//          For Trusted Oracle users getting this error although granted the
//          the appropriate privilege at a higher label, ask the database
//          administrator to regrant the privilege at the appropriate label.


Is the user realy a SYSDBA?

--> ora_session_mode => 2  # 0=normal, 2=SYSDBA, 4=SYSOPER

Looks like he is not.

Remember, that the passwort for the sys and system user has a default for
login as sysdba and has to be synchronized to the password for normal login
with "alter user identified by ..." to be able to log in  as SYSDBA or
normal user with the same password (yes, it is a little bit confusing :-).

CU
Andreas





Tony Mogg <[EMAIL PROTECTED]> on 11.12.2001 12.15.15

An:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Kopie:
Thema:    DBI connect problem  - desperate for a solution


Hello,

I'm really desperate for a solution to this problem so I'll be eternally
grateful to anyone who can help me.

My setup is as follows:

perl 5.6.1, DBD and DBI using Oracle 9i and connecting to a 9i database

I cannot connect as the 'sys' user

My current syntax is as follows:

my $dbh=DBI->connect("DBI:Oracle:$SID", "$UserName", "$Password",
{ora_session_mode => 2}) or die {&DBConnect};
where $Username = sys and $Password = sys_password

I get the following error:

DBI->connect(planet6d) failed: ORA-01031: insufficient privileges (DBD
ERROR:(OCISessionBegin) at DB_ASSIST line 458

I'd be really grateful for any advice or to anybody who can suggest a
reason
as to why I cannot connect.

Thanks,

Tony






Reply via email to