
khallas301
New User
Jan 24, 2013, 1:27 PM
Post #1 of 2
(1064 views)
|
Perl Oracle connectivity without password
|
Can't Post
|
|
friends could one of the perl expert tell me what I'm doing wrong here? I'm still learning perl so newbie with this..whatever I do my connection string doesn't work. 1. trying to connect oracle database with perl script with below argument on cmd prompt. `$ list_tables /@testdb` 2. Query dba_tables and list tables of user ABC 3. Also get output in logfile > #!/usr/local/bin/perl -w > use strict; > use Getopt::Std; > > use OracleAgent; > use OracleLoginString; > > my exitStatus = 0; > my %options = (); > my $oracleLogin; > > getopts("o",'\%options); > > if (defined $options{o}) { > $oracleLogin = $options{o}; > } > else { > exitWithError()); > } > > my $db = DBI->connect('dbi:Oracle:',$oracleLogin,'') or die "Can't connect to Oracle database: $DBI::errstr\n"; > > exit($exitStatus); Basically when I execute script I just want to provide instance name and not password. $ list_tables /@testdb I can connect from sqlplus prompt without password since using oracle login e.g. $sqlplus "/@testdb' thanks for looking into this.... |