Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: perl and sqlplus
#set environment variables by $ENV{"ORACLE_SID} = "ORCL" etc
open HDL, "| /path/to/svrmgrl" or die "Can't open the pipe: $!"; print HDL "connect internal;\n"; print HDL "shutdown immediate;\n"; print HDL "exit;\n";
Yong Huang
yhuang_at_indigopool.com
<jhouriha_at_my-deja.com> wrote in message news:8pmpmj$6vg$1_at_nnrp1.deja.com...
> how does one open up sqlplus
> with system or exec or qw or a here document....
> and do a shutdown immediate
>
> I have tried the following below but have been unsucessful
> I want to be able to shutdown an oracle instance from a perl script
>
>
> my $user='internal';my $pass='manager';my $dsn='db.db.com';
> $|=1;
> system(
> qq{
> sqlplus -s<<EOF
> $user/$pass\@$dsn
> shutdown immediate
> exit
> <<EOF
>
>
> my $user='internal';my $pass='manager';my $dsn='db.db.com'
> my $sqlplus='sqlplus -s $user/$pass\@dsn;'
> my $return_value=system($sqlplus);<<EOF
> shutdown immediate
> exit
> <<EOF
> print "system returned $return_value\n";
> ~
> ~
Received on Wed Sep 13 2000 - 11:42:47 CDT