I get the feeling you're mixing apple and oranges.

OS authentication - means you don't need to supply a userid or password.
You connect to the database as the OS user (of the process trying to
connect).  You need to have the
REMOTE_LOGIN_PASSWORDFILE =none in the init.ora.  And you need to create a
user in the database like ops$userid.  that is, if you want the unix id of
oracle to connect you have to:
create user ops$oracle identified externally;
then you can:
sqlplus /
to connect to a local database (as defined by ORACLE_SID):
$dbh=DBI->connect("dbi:Oracle:",'','');

Jay



----- Original Message -----
From: "Tony Mogg" <[EMAIL PROTECTED]>
To: "'Andreas Huber'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: "Tony Mogg" <[EMAIL PROTECTED]>
Sent: Tuesday, December 11, 2001 6:25 AM
Subject: DBI connect problem - desperate for a solution


> 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
>
>
>
>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to