Connecting Tech Pros Worldwide Forums | Help | Site Map

Converting "sqlplus / as sysdba" to DBI->connect command in Perl

Newbie
 
Join Date: Nov 2006
Posts: 1
#1: Nov 16 '06
I'm writing a script that would be run by user oracle, that would logon to all the databases on the server. Thus I'll need to logon as sysdba.
In Sqlplus, this would be sqlplus / as sysdba.
How do I do this in Perl.
I've tried
$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid","/","",{ ora_session_mode => SYSDBA });

I keep getting invalid username/password.I'm logged on at the unix level as user "oracle".

Member
 
Join Date: Nov 2006
Posts: 83
#2: Nov 16 '06

re: Converting "sqlplus / as sysdba" to DBI->connect command in Perl


Maybe you need to make the Perl script setuid or setgid. See perlsec for some guidance.
Reply