cancel
Showing results for 
Search instead for 
Did you mean: 

9i sqlplus + perl

Kalin Evtimov
Regular Advisor

9i sqlplus + perl

Hello!

I have a script, that sholud run a simple sqlplus. Alone, the sqlplus code works, so it shold be OK, but embedded in a Perl-script it doesn't work. Does anybody know why?

Here is the script and some output:

#!/usr/bin/perl


$ENV{'ORACLE_SID'}='test01';
$ENV{'ORACLE_HOME'}='/oracle/ora92/';


$s=qx{/oracle/ora92/bin/sqlplus -SL /nolog < set echo off linesize 1000 pagesize 300
connect / as sysdba
shutdown immediate;
exit
END};

print $s;

_______________________________________________________________

OUTPUT:

[oracle@dbserv0:/tmp/develop/dbscript]$ perl stop.pl
Connected to an idle instance.
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
HPUX-ia64 Error: 2: No such file or directory [oracle@dbserv0:/tmp/develop/dbscript]$ echo $ORACLE_SID test01 [oracle@dbserv0:/tmp/develop/dbscript]$ echo $ORACLE_HOME /oracle/ora92/ [oracle@visap00:/tmp/develop/dbscript]$ echo $ORACLE_BASE /oracle
3 REPLIES
Kalin Evtimov
Regular Advisor

Re: 9i sqlplus + perl

Found it out:

owner of script was oracle, but group was sys. After changing group with chgrp to dba, the script worked.
Muthukumar_5
Honored Contributor

Re: 9i sqlplus + perl

good. Please close the thread.

--
Muthu
Easy to suggest when don't know about the problem!
Kalin Evtimov
Regular Advisor

Re: 9i sqlplus + perl

See above