標籤:
Oracle 10g及pro*c相關問題及解決方案
2008年08月21日 星期四 上午 11:21
最近一直在進行ORACLE 10g和PRO*C的學習。
其中遇到了不少的問題:
現列於此,已備他用。
[註:我的linux版本是RHEL 5,Oracle版本是10g]
1、在ORACLE 10g 安裝準備的過程中:缺少libXp.so.6依賴
上網搜過不少文章,但是都不是很好的解決
我自己摸索出一個解決方案:
在RHEL5的安裝盤中找到libXp-1.0.0-8.i386.rpm,進行安裝後,便可解決。
2、在ORACLE 10g 安裝過程中Xlib: connection to ":0.0" refused by server
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Error: Can‘t open display: :0.0
以root使用者登陸,在shell中運行
[[email protected] ~]# xhost local:oracle
non-network local connections being added to access control list
然後oracle身份就可以運行X程式了。
man xhost中有這樣一段
A complete name has the syntax ‘‘family:name’’ where the families are as follows:
inet Internet host (IPv4)
inet6 Internet host (IPv6)
dnet DECnet host
nis Secure RPC network name
krb Kerberos V5 principal
local contains only one name, the empty string
si Server Interpreted
其中local那個是用來解決同一台機器的不同使用者訪問X的問題的。
3.proc: error while loading shared libraries: libclntsh.so.10.1:
cannot open shared object file: No such file or directory
解決方案:
在/etc/profile中添加
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib;
export LD_LIBRARY_PATH
然後可以用source /etc/profile 生效一下
4、PCC-S-02201錯誤
在用proc進行編譯的時候(proc iname=test.pc) 出錯
錯誤資訊有很多:
PCC-S-02201, Encountered the symbol "<eof>;" when expecting one of the following....
發生 PCC-S-02201 錯誤時有兩種解決辦法:
1)升級編譯器
2)設定 parse=none
更正後的命令:proc iname=test.pc parse=none
結果產生test.c檔案
5、error: sqlca.h: No such file or directory
執行gcc -o test test.c時:
test.c:152:19: error: sqlca.h: No such file or directory
sqlca.h在$ORACLE_HOME/precomp/public/下
更正後的命令:gcc -o test test.c -I $ORACLE_HOME/precomp/public
6、undefined reference to `sqlcxt‘
執行5中的命令時出現錯誤如下:
test.c:(.text+0x5e5): undefined reference to `sqlcxt‘
需要用到$ORACLE_HOME/lib/libclntsh.so
故需加上 -L $ORACLE_HOME/lib -l clntsh
更正後的命令為:
gcc -o test test.c -I /home/oracle/oracle/product/10.2.0/db_1/precomp/public -L $ORACLE_HOME/lib -l clntsh
OK!至此編譯成功!
但是這樣寫太麻煩
7、error while loading shared libraries: $ORACLE_HOME/lib/libnnz10.so:
cannot restore segment prot after reloc: Permission denied
執行程式(./test)時提示錯誤:
error while loading shared libraries: $ORACLE_HOME/lib/libnnz10.so:
cannot restore segment prot after reloc: Permission denied
相關的文章:
Topic:
Some Linux distributions with SELinux enabled may prevent IDL from running under the default security context. This TechTip is a workaround for CR#41937
Discussion:
Newer Linux distributions have enabled new kernel security extensions from the SELinux project at the NSA. These extensions allow finer-grained control over system security. However, SELinux also changes some default system behaviors, such as shared library loading, that can be problematic to third party programs.If you receive the error message "cannot restore segment prot after reloc: Permission denied" when launching IDL, then your SELinux configuration is preventing IDL from launching.
To rectify this issue, you can either:
(1)Change the default security context for IDL by issuing the command:
chcon -t texrel_shlib_t /usr/local/rsi/idl_6.1/bin/bin.linux.x86/*.so
(2)Disabling SELinux altogether by setting the line
SELINUX=disabled
in your /etc/sysconfig/selinux file.
我使用的解決辦法:chcon -t texrel_shlib_t $ORACLE_HOME/lib/*.so
racle 10g及pro*c相關問題及解決方案2010-10-29 10:01閱讀(195)
分享
1、在ORACLE 10g 安裝準備的過程中:缺少libXp.so.6依賴
上網搜過不少文章,但是都不是很好的解決
我自己摸索出一個解決方案:
在RHEL5的安裝盤中找到libXp-1.0.0-8.i386.rpm,進行安裝後,便可解決。
2、在ORACLE 10g 安裝過程中Xlib: connection to ":0.0" refused by server
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Error: Can‘t open display: :0.0
以root使用者登陸,在shell中運行
[[email protected] ~]# xhost local:oracle
non-network local connections being added to access control list
然後oracle身份就可以運行X程式了。
man xhost中有這樣一段
A complete name has the syntax ‘‘family:name’’ where the families are as follows:
inet Internet host (IPv4)
inet6 Internet host (IPv6)
dnet DECnet host
nis Secure RPC network name
krb Kerberos V5 principal
local contains only one name, the empty string
si Server Interpreted
其中local那個是用來解決同一台機器的不同使用者訪問X的問題的。
3.proc: error while loading shared libraries: libclntsh.so.10.1:
cannot open shared object file: No such file or directory
解決方案:
在/etc/profile中添加
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib;
export LD_LIBRARY_PATH
然後可以用source /etc/profile 生效一下
4、PCC-S-02201錯誤
在用proc進行編譯的時候(proc iname=test.pc) 出錯
錯誤資訊有很多:
PCC-S-02201, Encountered the symbol "<eof>;" when expecting one of the following....
發生 PCC-S-02201 錯誤時有兩種解決辦法:
1)升級編譯器
2)設定 parse=none
更正後的命令:proc iname=test.pc parse=none
結果產生test.c檔案
5、error: sqlca.h: No such file or directory
執行gcc -o test test.c時:
test.c:152:19: error: sqlca.h: No such file or directory
sqlca.h在$ORACLE_HOME/precomp/public/下
更正後的命令:gcc -o test test.c -I $ORACLE_HOME/precomp/public
6、undefined reference to `sqlcxt‘
執行5中的命令時出現錯誤如下:
test.c:(.text+0x5e5): undefined reference to `sqlcxt‘
需要用到$ORACLE_HOME/lib/libclntsh.so
故需加上 -L $ORACLE_HOME/lib -l clntsh
更正後的命令為:
gcc -o test test.c -I /home/oracle/oracle/product/10.2.0/db_1/precomp/public -L $ORACLE_HOME/lib -l clntsh
OK!至此編譯成功!
但是這樣寫太麻煩
7、error while loading shared libraries: $ORACLE_HOME/lib/libnnz10.so:
cannot restore segment prot after reloc: Permission denied
執行程式(./test)時提示錯誤:
error while loading shared libraries: $ORACLE_HOME/lib/libnnz10.so:
cannot restore segment prot after reloc: Permission denied
相關的文章:
Topic:
Some Linux distributions with SELinux enabled may prevent IDL from running under the default security context. This TechTip is a workaround for CR#41937
Discussion:
Newer Linux distributions have enabled new kernel security extensions from the SELinux project at the NSA. These extensions allow finer-grained control over system security. However, SELinux also changes some default system behaviors, such as shared library loading, that can be problematic to third party programs.If you receive the error message "cannot restore segment prot after reloc: Permission denied" when launching IDL, then your SELinux configuration is preventing IDL from launching.
To rectify this issue, you can either:
(1)Change the default security context for IDL by issuing the command:
chcon -t texrel_shlib_t /usr/local/rsi/idl_6.1/bin/bin.linux.x86/*.so
(2)Disabling SELinux altogether by setting the line
SELINUX=disabled
in your /etc/sysconfig/selinux file.
我使用的解決辦法:chcon -t texrel_shlib_t $ORACLE_HOME/lib/*.so
8.sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.1.0/db_1/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied
出現這句error的原因是因為Linux選擇"Enforcing" mode
只要將"Enforcing" mode 轉為 "Permissive" mode
1.首先,要run as root
2.Type "getenforce" ,hit [Enter]
======================
getenforce (returns “Enforcing”)
3.Type "setenforce 0"
======================
getenforce (returns “Permissive”)
如果想將 "Permissive" mode 轉為 "Enforcing" mode
可以打setenforce 1
======================
getenforce (returns “Enforcing”)
原文地址:http://blog.csdn.net/cinience/article/details/6208315
[轉]Oracle 10g及pro*c相關問題及解決方案(轉)