Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

3dbc's scratchpad

by 3dbc (Monk)
on Jun 03, 2004 at 23:57 UTC ( #360579=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/perl # requires psexec from sysinternals # exp should not be used for backup purposes... but that is exactly w +hat I am doing here :-( # Any and all advice is greatly appreciated require DBI; my ($dbh, $sth); $dbh = DBI->connect('DBI:ODBC:DSN,'system','pass'); # ODBC connect unless ($dbh->ping) { print "Error opening database: $DBI::errstr\n"; exit; } else { #print "\n\nQuerying DB\n\n"; } my $connected = $dbh->ping; $sql = "SELECT username FROM all_users"; my $sth = $dbh->prepare($sql); $sth->execute() or die $dbh->errstr; while(my @result=$sth->fetchrow_array) { push @username, $result[0]; } foreach( @username ) { if ( (not($_ =~ /(SQLNAV$)/)) and (not($_ =~ /(ENTMGR$)/)) and (not($_ =~ /(SYS$)/)) and (not($_ =~ /(SYSTEM$)/)) and (not($_ =~ /(SQLNAV$)/)) and (not($_ =~ /(PUBLIC$)/)) and (not($_ =~ /(ORA_MONITOR$)/)) and (not($_ =~ /(OSE\$HTTP\$ADM +IN$)/)) and (not($_ =~ /(ORA_MONITOR$)/)) and (not($_ =~ /(OUTLN$)/)) and (not($_ =~ /(ENTMGR2$)/)) and (not($_ =~ /(AURORA\$JIS\$UTILI +TY\$$)/)) and (not($_ =~ /(AURORA\$ORB\$UNAUTHENTICATED$)/)) and (not($_ =~ + /(DBSNMP$)/)) and (not($_ =~ /(QUEST$)/)) and (not($_ =~ /(QNXO$)/)) ) { print $_ . "\n"; system ("psexec \\\\oracle_server_IP_or_NetBIOS -u domain\\adm +inistrator -p password exp " . $_ . "/" . $_ . "\@DB_Instance file=D: +\\orabacks\\" . "$_" . ".dmp grants=Y owner=" . $_ . " rows=Y compres +s=Y"); print "\n"; #die; } }
Log In?

What's my password?
Create A New User
[vedagiri89]: hi all! i need your help
[vedagiri89]: i'm facing this issue: Attempt to reload aborted.\ nCompilation failed in require at /usr/lib64/perl5/ vendor_perl//APR. pm line 19.\nBEGIN failed--compilatio n aborted at /usr/lib64/perl5/ vendor_perl//APR. pm line 19.
[vedagiri89]: how do fix this issue
[choroba]: This usually happens when you have more than one version of Perl, and you mix the libraries
[hippo]: Which O/S?
[vedagiri89]: i have searched many forum...not getting resolutions
[vedagiri89]: centos
[Corion]: vedagiri89: Either what choroba said, or maybe you misspelled some module name (on Windows), like use Strict; or something like that.
[vedagiri89]: @choroba, what to do for that

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-06-19 11:17 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (113 votes). Check out past polls.