“要求”时发生 OCIError;权限问题?

发布于 2024-09-06 21:18:15 字数 715 浏览 5 评论 0原文

我最近刚刚开始在工作中学习/使用 Ruby。我有一个超级简单的测试脚本,它仅连接到我们的 Oracle 10g 数据库,运行选择,并将结果“显示”到屏幕上。这是在 Solaris 10 服务器上。如果我以“apps”用户(运行自动化脚本的系统用户)身份运行脚本,则脚本运行良好。如果我自己运行它,它会抛出一个错误:

oci8lib.c:98:in oci8lib.so: OCI Library Initialization Error (OCIError)
    from /usr/local/lib/ruby/site_ruby/1.8/oci8.rb:25
    from ./dbTest.rb:3:in `require'
    from ./dbTest.rb:3

我的环境变量与“apps”用户的环境变量匹配。我假设这是某些文件/目录或其他文件/目录的权限问题,但我不知道从哪里开始查找。 oci8.rb 文件中的第 25 行是“require 'oci8lib_18'”指令。我对 oci8lib_18.so 文件和指向它的目录具有读取和执行权限,但我不知道它需要访问哪些目录。

有人对我应该检查哪些文件/目录的权限有任何建议吗?或者对这个问题可能有什么其他想法?

更新 我一直在与支持 OCI8 的人发送电子邮件,结果发现几个 Oracle 目录具有阻止我登录访问所需信息的权限。一个简单的测试是尝试运行sqlplus,但也失败了。

戴夫

I've just recently started learning/using Ruby at work. I've got a super-simple test script that just connects to our Oracle 10g database, runs a select, and 'puts' the results to the screen. This is on a Solaris 10 server. If I run the script as the 'apps' user (the system user that runs our automated scripts), the script runs fines. If I run it as myself, it throws an error:

oci8lib.c:98:in oci8lib.so: OCI Library Initialization Error (OCIError)
    from /usr/local/lib/ruby/site_ruby/1.8/oci8.rb:25
    from ./dbTest.rb:3:in `require'
    from ./dbTest.rb:3

My env vars match the 'apps' user's. I'm assuming this is a permissions issue on some file/directory or other but I don't know where to start looking. Line 25 in the oci8.rb file is a "require 'oci8lib_18'" directive. I have read and execute permissions on the oci8lib_18.so file and the dirs leading to it, but I don't know which dirs it needs to access.

Does anyone have any suggestions on what files/dirs I should check the permissions on? Or any other thoughts on what the issue may be?

UPDATE I've been emailing with the guy that supports OCI8 and it turns out that several of the Oracle directories have permissions that prevent my login from accessing needed info. A simple test was to try to run sqlplus, which also failed.

Dave

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

断念 2024-09-13 21:18:15

先验我不知道。其他 ruby​​ 应用程序是否使用 OCI 运行?通常库和附属库都安装了rwx-r-xr-x。您永远不会在正确安装的库上看到权限错误。因此,我大胆猜测您的环境中缺少某些内容,可能就像 LD_LIBRARY_PATH 中的条目

ldd 打开共享库的方式与运行时映像的方式几乎相同。

首先看看这是否有效:

cd /path/to/library   # where oci8lib.so lives.  
ldd oci8lib.so

这应该显示所有外部链接库,没有错误。
如果 ldd 有效,请检查您的 LD_LIBRARY_PATH 以确保您现在所在的路径已在那里声明。如果它不起作用,则说明您遇到了某种安装问题,例如缺少库或库的非标准路径。

请将您的结果返回给我们。

A priori I have no idea. Do other ruby apps run using OCI? Normally libraries and the subsidiary libraries are all installed rwx-r-xr-x. You should never see permissions errors on correctly installed libraries. So I'm making a wild guess you are missing something in your environment, probably like an entry in LD_LIBRARY_PATH

ldd opens shared libraries pretty much the same way your run time image does.

see if this works first:

cd /path/to/library   # where oci8lib.so lives.  
ldd oci8lib.so

This should display all of the externally linked libraries, with no errors.
If ldd works, check your LD_LIBRARY_PATH to be sure the path you are now in is declared there. If it does not work, you have some kind of installation issue, like missing libraries, or non-standard paths to libraries.

Get back to us here with your results.

违心° 2024-09-13 21:18:15

我一直在与支持 OCI8 的人发送电子邮件,结果发现几个 Oracle 目录具有阻止我登录访问所需信息的权限。一个简单的测试是尝试运行sqlplus,但也失败了。

I've been emailing with the guy that supports OCI8 and it turns out that several of the Oracle directories have permissions that prevent my login from accessing needed info. A simple test was to try to run sqlplus, which also failed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文