DBD::Oracle 导致系统调用损坏?
看到一些奇怪的行为,连接到Oracle数据库,然后调用外部函数,$?的值? 始终为 -1。
问题机器运行标准 AIX5.3,带有 DBD::Oracle 1.20 和 DBI 1.602。
#!/usr/bin/perl -w
use DBI;
CORE::system "pwd";
print "Before connect: $?\n";
DBI->connect('dbi:Oracle:', 'pwd', 'pwd');
print "Before system: $?\n";
CORE::system "pwd";
print "After system: $?\n";
CORE::system "pwd";
print "After system: $?\n";
Before connect: 0
Before system: 0
/usr/local/bin
After system: -1
/usr/local/bin
After system: -1
这是来自不同 AIX 5.3 机器的结果,我能看到的唯一区别是它运行的是 DBD:Oracle 1.22 和 DBI 1.607。 然而,查看这些模块的更改日志,我看不到任何与之相关的内容。 除了升级 DBD:Oracle 和 DBI 之外,我还可以尝试任何进一步的想法(犹豫是否立即这样做,因为这是一台生产机器)。
Seeing some strange behavior, whereby connecting to Oracle database, and then calling external function, the value of $? is always -1.
Problem machine is running standard AIX5.3, with DBD::Oracle 1.20 and DBI 1.602.
#!/usr/bin/perl -w
use DBI;
CORE::system "pwd";
print "Before connect: $?\n";
DBI->connect('dbi:Oracle:', 'pwd', 'pwd');
print "Before system: $?\n";
CORE::system "pwd";
print "After system: $?\n";
CORE::system "pwd";
print "After system: $?\n";
Before connect: 0
Before system: 0
/usr/local/bin
After system: -1
/usr/local/bin
After system: -1
This is the results from a different AIX 5.3 machine, the only difference I can see is that it is running DBD:Oracle 1.22 and DBI 1.607. However looking at the change logs for those modules, I can't see anything that could relate to that.
Any ideas for further things I can try other than upgrading DBD:Oracle and DBI (hesitent to do that straight away as this is a production machine).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自perldoc -f system:
看起来系统调用无法再
exec
pwd
程序。 尝试将您的系统
调用更改为:from perldoc -f system:
It looks like the system call is not able to
exec
thepwd
program anymore. Try changing yoursystem
calls to:我意识到这篇文章是在几个月后发布的,但由于我遇到了同样的问题,我将为任何偶然发现您的文章的人详细介绍我的解决方法。
不同版本的Oracle OCI 库分别处理SIGCHILD(例如,我在11gR2 上遇到问题,但在11gR1 上没有)。 如果您通过更改
DBI->connect('dbi:Oracle:', 'pwd', 'pwd');
来避免使用遗赠连接 到
DBI->connect('dbi:Oracle:', 'pwd', 'pwd');
你会发现你的问题消失了。 当然,您可能不想通过侦听器进行连接,但我没有解决方案......
I realise this posting is several months after the fact, but since I have encountered the same problem, I'll detail my workaround for anyone who stumbles on your post.
Different versions of the Oracle OCI libraries handle SIGCHILD separately (e.g. I have your problem with 11gR2 but not 11gR1). If you avoid using bequeath connections by changing
DBI->connect('dbi:Oracle:', 'pwd', 'pwd');
to
DBI->connect('dbi:Oracle:', 'pwd', 'pwd');
you'll find your problem goes away. Of course, you may not want to connect by going through the listener, but I don't have a solution for that...