Home » Server Options » RAC & Failsafe » HOW PERL CONNECT 10G RAC DATABASE WITHOUT 'SYSDBA' PRIVILEGE? (Perl:5.8, Oracle 10g Enterprise Edition RAC 10.2.0.3.0)
HOW PERL CONNECT 10G RAC DATABASE WITHOUT 'SYSDBA' PRIVILEGE? [message #352665] Wed, 08 October 2008 21:01 Go to next message
abudabud
Messages: 3
Registered: October 2008
Junior Member
have Perl 5.8 and Oracle 10g RAC database installed, I can write Perl program to connect 10g RAC database successfully, but the database user must be granted with 'sysdba' privilege to connect. If I only grant 'create session' but no 'sysdba' to a db user, and try to connect with the perl program (Entry 'DBNAME' already added in tnsnames.ora, with 2 node hostname included):
my $dbh=DBI->connect('DBI:Oracle:DBNAME','dbuser1','dbpwd');

It will throw error: ORA-01031: insufficient privileges (DBD ERROR:
OCISessionBegin)

So, may I know how can I connect 10g RAC with Perl without 'sysdba' privilege granted to db user?

Thank you very much for your help
Re: HOW PERL CONNECT 10G RAC DATABASE WITHOUT 'SYSDBA' PRIVILEGE? [message #352668 is a reply to message #352665] Wed, 08 October 2008 21:32 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Sysdba privilege is NOT supposed to granted for a regular user.
It is meant only for certain administrative tasks.
All you need to "create session" privilege, "connect" role and any other privileges to create objects etc.
Re: HOW PERL CONNECT 10G RAC DATABASE WITHOUT 'SYSDBA' PRIVILEGE? [message #352670 is a reply to message #352668] Wed, 08 October 2008 21:49 Go to previous messageGo to next message
abudabud
Messages: 3
Registered: October 2008
Junior Member
Thank you for your reply.
Acutally, we do not want to grant 'sysdba' to normal db user, my test steps are:

1) create user zzz identified by zzz;
grant create session,connect to zzz;

2) perl perl-rac.pl
Result: DBI connect('ZZZ','zzz',...) failed: ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin) at tperl-rac.pl line 8

3) To test, we grant additional 'sysdba' to zzz;
Test again, it can return result of the sql query inside my test perl script without error.

Re: HOW PERL CONNECT 10G RAC DATABASE WITHOUT 'SYSDBA' PRIVILEGE? [message #352672 is a reply to message #352670] Wed, 08 October 2008 22:19 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
I would first do a simple sql*plus connectivity test.
If it works with oracle's native sql*plus tool, it should work from PERL.
And what SQL are you issuing inside the .pl?

Depending on the outcome from testing with sql*plus, check sqlnet.ora (uncomment all entries or just rename the file and try again).
Re: HOW PERL CONNECT 10G RAC DATABASE WITHOUT 'SYSDBA' PRIVILEGE? [message #352673 is a reply to message #352672] Wed, 08 October 2008 22:30 Go to previous message
abudabud
Messages: 3
Registered: October 2008
Junior Member
Thank you.

Yes, I can login normally without error using sqlplus, I have added tns name 'ZZZ' with 2 node hostname in tnsnames.ora :
$ sqlplus zzz@ZZZ
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Oct 9 11:22:43 2008
Enter password:
SQL> show user;
USER is "ZZZ"
SELECT a from zzz.tbl1; (2 rows return)

And using this normal db user (without 'sysdba'), I can connect it successfully through Perl to any one of the single node (specify SID instance name in perl) within the RAC, without error.

The only problem occurs is try to connect both node in RAC using perl. I have created a table 'tbl1' under user schema 'zzz', with 2 rows in it.

[Updated on: Thu, 09 October 2008 04:09]

Report message to a moderator

Previous Topic: ons requires a manual start, though doing srvctl -nodeapp status [node] show "ons daemon is run
Next Topic: RAC Failover
Goto Forum:
  


Current Time: Sun Dec 04 10:52:17 CST 2016

Total time taken to generate the page: 0.04703 seconds