我是 Perl 脚本的初学者。并且正在编写打开外部命令( sqlplus )的 perl 脚本。我想用 prelim 设置打开 sqlplus,并定期获取会话信息。即用(oradebug setmypid)和(oradebug direct_access set mode=unsafe)打开sqlplus后,我想连续发送检索查询(oradebug direct_access select * from x\$ksuse\n)而不重启sqlplus。
以下代码可能会让您更好地理解我的问题
my $set = "oradebug setmypid;\n oradebug direct_access set mode=unsafe;\n oradebug direct_access select * from x\$ksuse\n";
open(PIPE, '|-', "/opt/oracle/product/11.2.0/db_1/bin/sqlplus -prelim system/oracle as sysdba");
print PIPE $set; #if I call this call continuously, it means I open sqlplus again, again...This is not what I want^^
有没有办法在打开sqlplus一次后连续运行检索查询?
先感谢您