Linux 执行sqlplus时Oracle出错:“SP2-1503:无法初始化Oracle调用接口”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8790181/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle error when executing sqlplus: "SP2-1503: Unable to initialize Oracle call interface"
提问by wmorrison365
I'm struggling with the following error when starting up sqlplus as my regular user - say "scott".
我在以普通用户身份启动 sqlplus 时遇到以下错误 - 说“scott”。
$ sqlplus
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly
Environment is:
环境是:
- Oracle 11.2.0.2
- OpenSuse Linux 11.1 (64bit)
- 甲骨文 11.2.0.2
- OpenSuse Linux 11.1(64 位)
Misc other detail:
杂项其他细节:
- Oracle installed and running on localhost
- No tnsnames issues as can run sqlplus as oracle admin user
- Database up and listener started (11.2.0.2 install).
- user scott in database admin group (/etc/group)
- user scott references correct 11.2.0.2 installation
- Oracle 在 localhost 上安装并运行
- 没有 tnsnames 问题,因为可以以 oracle 管理员用户身份运行 sqlplus
- 数据库启动和监听器启动(11.2.0.2 安装)。
- 数据库管理员组 (/etc/group) 中的用户 scott
- 用户 scott 引用正确的 11.2.0.2 安装
This is most bizarre as I can happily run sqlplus as the oracle user (say "oraadmin") and user scott is registered in the oracle admin group. Additionally, I had no such problems with my previous Oracle install (10.2.0.7). My ~scott's $ORACLE_HOME references the 11.2.0.2 installation.
这是最奇怪的,因为我可以愉快地以 oracle 用户(比如“oraadmin”)运行 sqlplus,并且用户 scott 注册在 oracle admin 组中。此外,我之前的 Oracle 安装 (10.2.0.7) 没有出现此类问题。我的 ~scott 的 $ORACLE_HOME 引用了 11.2.0.2 安装。
Comparing my 11.2.0.2 and 10.2.0.7 environments, I've noticed several libraries (including $ORACLE_HOME/lib/libsqlplus.so) have group read-only permissions (744) so have chmod'ded these.
比较我的 11.2.0.2 和 10.2.0.7 环境,我注意到几个库(包括 $ORACLE_HOME/lib/libsqlplus.so)具有组只读权限 (744),因此对这些库进行了修改。
Other than that, my $ORACLE_HOME/lib, $ORACLE_HOME/bin, $ORACLE_HOME/oracore and $ORACLE_HOME/rdbms all seem reasonable with sensible permissons.
除此之外,我的 $ORACLE_HOME/lib、$ORACLE_HOME/bin、$ORACLE_HOME/oracore 和 $ORACLE_HOME/rdbms 在合理的权限下看起来都很合理。
N.B: There's a plethora of stuff on-line but, as is often the case, there's a lot of case-specific issues and mainly around different versions of Windows. Focusing mainly on comparing my envs. Besides, as far as I can tell, this question doesn't yet exist on SO so could be useful to start collating answers by environment. I'll report back any sensible findings.
注意:网上有很多东西,但通常情况下,有很多特定于案例的问题,主要是围绕不同版本的 Windows。主要关注比较我的环境。此外,据我所知,SO 上尚不存在此问题,因此对于开始按环境整理答案可能很有用。我会报告任何合理的发现。
采纳答案by wmorrison365
Fixed my particular issue...
修复了我的特定问题...
User scott's $PATH still contained the ora11.1.0.7 bin. So, on starting sqlplus, I was running the ora11.1.0.7 sqlplus client against the 11.2.0.2 server. Think there may be more to it than that (i.e. I'd probably expect that client to work with that server) but that is the hub of the problem.
用户 scott 的 $PATH 仍然包含 ora11.1.0.7 bin。因此,在启动 sqlplus 时,我正在针对 11.2.0.2 服务器运行 ora11.1.0.7 sqlplus 客户端。认为可能不止于此(即我可能希望该客户端与该服务器一起工作),但这就是问题的中心。
In my defence, my.bashrc sets the $PATH correctly so not yet sure what preempts it with the 11.1.0.7 version. Guess the sensible rule of thumb is to add my $ORACLE_HOME/bin to the front of the $PATH to ensure mine is found first, despite what else is set by whatever other environment config, as in
在我的辩护中,my.bashrc 正确设置了 $PATH,因此尚不确定是什么在 11.1.0.7 版本中抢占了它。猜猜明智的经验法则是将我的 $ORACLE_HOME/bin 添加到 $PATH 的前面以确保首先找到我的,不管其他环境配置设置了什么,如
export PATH=$ORACLE_HOME/bin:$PATH
Yours, a little embarrassed but hopefully will be of help again to someone.
你的,有点尴尬,但希望能再次对某人有所帮助。
回答by wmorrison365
Some of the more useful sites...
一些更有用的网站...
Various Windows environments:
各种Windows环境:
- https://forums.oracle.com/forums/thread.jspa?threadID=338426
- https://www.administrator.de/Zugriff_auf_OracleDB_(10i)_per_sql_plus_von_WTS_2003_(Servicepack_2).html
- http://www.orafaq.com/forum/t/100549/2/
- https://forums.oracle.com/forums/thread.jspa?threadID=338426
- https://www.administrator.de/Zugriff_auf_OracleDB_(10i)_per_sql_plus_von_WTS_2003_(Servicepack_2).html
- http://www.orafaq.com/forum/t/100549/2/
Linux environments:
Linux环境:
回答by Mowgli
If it is Windows 7, You can right click on SQL Plus or whatever software you using, I use Crystal Reports.
如果是 Windows 7,您可以右键单击 SQL Plus 或您使用的任何软件,我使用的是 Crystal Reports。
so to you would have to right clickand Run as Administrator.
所以你必须右键单击并以管理员身份运行。
it fixed for me.
它为我修好了。
回答by Brijesh Rana
In Windows i found the solution ---
在 Windows 中,我找到了解决方案 ---
Assign the "Create global objects" user right to the non-Administrator account.
将“创建全局对象”用户权限分配给非管理员帐户。
- Go to Administrative Tools, and then click Local Security Policy.
- Expand Local Policies, and then click User Rights Assignment.
- In the right pane, double-click Create global objects.
- In the Local Security Policy Setting dialog box, click Add.
- In the Select Users or Group dialog box, click the user account that you want to add, click Add, and then click OK.
- Click OK.
- 转到管理工具,然后单击本地安全策略。
- 展开本地策略,然后单击用户权限分配。
- 在右窗格中,双击创建全局对象。
- 在“本地安全策略设置”对话框中,单击“添加”。
- 在“选择用户或组”对话框中,单击要添加的用户帐户,单击“添加”,然后单击“确定”。
- 单击确定。