ORACLE_HOME設定錯誤導致本地sqlplus無法登陸

myownstars發表於2012-09-05

OS SunOS 5.10

DB: 10205 單例項

症狀: 例項明明已經open,且透過tnsname可以從客戶端正常連線,但是本地採用sqlplus卻無法登陸;

/ as sysdba顯示登陸的是一個idle instance 使用普通使用者則直接報告memory not exist

當使用sqlplus / as sysdba本地登陸並嘗試mount時,則顯示ORA-01102: cannot mount database in EXCLUSIVE mode

 

該機器安裝有1120310205資料庫若干,11203的均可以正常連線,但是10205都是顯示此類錯誤

[oracle]/export/home/oracle> export ORACLE_HOME=/apps/oracle/product/102

[oracle]/export/home/oracle> export ORACLE_SID=prod

[oracle]/export/home/oracle> $ORACLE_HOME/bin/sqlplus / as sysdba

ld.so.1: sqlplus: fatal: relocation error: file /apps/oracle/product/102/lib/libnnz10.so: symbol nzdacvalue: referenced symbol not found

Killed

[oracle]/export/home/oracle> echo $LD_LIBRARY_PATH

/apps/oracle/product/11203/lib

[oracle]/export/home/oracle> echo $PATH

/apps/oracle/product/11203/bin:.:/usr/ccs/bin:/usr/sbin:/usr/bin:/bin:/usr/ucb:/usr/openwin/bin:/usr/local/bin:/opt/bin:/usr/dt/bin/:/usr/ccs/bin

[oracle]/export/home/oracle> export LD_LIBRARY_PATH=$ORACLE_HOME/lib

本地登陸

 

[oracle]/export/home/oracle> $ORACLE_HOME/bin/sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Aug 31 04:11:27 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL>

[oracle]/export/home/oracle> sqlplus system/******

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Aug 31 04:12:55 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

ERROR:

 

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

SVR4 Error: 2: No such file or directory

 

使用tnsname則可以正常登陸

 

[oracle]/export/home/oracle> sqlplus system/******@prod

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Aug 31 04:12:29 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter db_name

NAME TYPE VALUE

 

--------------------------------------------------------------------------------

-----------

--------------------------------------------------------------------------------

 

db_name string prod

 

SQL> select status from v$instance;

STATUS

 

--------------------------------------------------------------------------------

 

OPEN

 

使用truss跟蹤

 

oracle]/export/home/oracle> truss -aefo tnsplus.log sqlplus system/******

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Aug 31 04:24:26 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

 

ERROR:

 

ORA-01034: ORACLE not available

 

ORA-27101: shared memory realm does not exist

 

SVR4 Error: 2: No such file or directory

 

 

Enter user-name: ^C

最後在OTN論壇提問   

Maclean提示使用pargs命令檢視現有程式使用的環境變數

 

pargs這個命令還是挺有效果的,最終發現癥結所在

ORACLE_HOME設定錯了

ORACLE_HOME=/apps/oracle/product/102/---後面多出了一個/

太坑哩

/export/home/oracle> pargs -e 8364

8364: ora_pmon_epprod

envp[0]: SKGP_HIDDEN_ARGS=

envp[1]: ORACLE_SPAWNED_PROCESS=1

envp[2]: _=/apps/oracle/product/102/bin/sqlplus

envp[3]: MANPATH=/usr/man:/usr/openwin/man

envp[4]: LANG=en_US.UTF-8

envp[5]: HZ=100

envp[6]: PATH=

envp[7]: ORACLE_BASE=/apps/oracle

envp[8]: PENWINHOME=/usr/openwin

envp[9]: EDITOR=/usr/bin/vi

envp[10]: LOGNAME=oracle

envp[11]: MAIL=/var/mail/oracle

envp[12]: ORACLE_SID=prod

envp[13]: PS1=[usboazudb008:oracle:$ORACLE_SID]$PWD>

envp[14]: ADM=/apps/oracle/admin

envp[15]: NLS_DATE_FORMAT=yyyy-mm-dd hh24:mi:ss

envp[16]: SHELL=/usr/bin/ksh

envp[17]: ORACLE_TERM=dtterm

envp[18]: HOME=/export/home/oracle

envp[19]: LD_LIBRARY_PATH=/apps/oracle/product/102/lib

envp[20]: TERM=dtterm

envp[21]: ORACLE_HOME=/apps/oracle/product/102/

envp[22]: PWD=/apps/oracle/product/102/dbs

envp[23]: TZ=US/Eastern

envp[24]: ORAENV_ASK=NO

envp[25]: ORA_NET2_DESC=9,12

 

 

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-742698/,如需轉載,請註明出處,否則將追究法律責任。

相關文章