ORACLE多版本資料庫例項共存啟動關閉時ORA-01804&SP2-0152
今天,由於特殊原因,需要重啟資料庫,理論上應該是很簡單的事;事實情況是,一臺linux伺服器上,有4個Oracle例項,3個例項是11.2.0.4的,1個例項是10.2.0.5的。
重啟時,11g的三個例項很簡單,但是10g的例項重啟時,發現sys無法登陸,報錯如下:
設定10g的環境變數
[oracle@linux ~]$ ps -ef|grep _ora10|grep smon
1102 4306 1 0 08:39 ? 00:00:00 ora_smon_ora10g
[oracle@linux ~]$export ORACLE_SID=ora10g
[oracle@linux ~]$ echo $ORACLE_SID
ora10g
[oracle@linux ~]$ export ORACLE_HOME=/u02/app/oracle/10.2.0/db_1
[oracle@linux ~]$ export PATH=$PATH:$ORACLE_HOME/bin
[oracle@linux ~]$ sqlplus sys/'eh8#5pK6' as sysdba
ERROR:
ORA-01804: failure to initialize timezone information
SP2-0152: ORACLE may not be functioning properly
[oracle@linux ~]$
關於ORA-01804&SP2-0152報錯,有資料說是環境變數問題,如果有資料庫版本升級過,不排除環境變數設定不當引起ORA-01804,但是,我再三核實確保環境變數沒問題;
真實原因是:11g的資料庫作業系統管理使用者是oracle,而10g的資料庫作業系統管理使用者是oracle10g。
排查過程如下:
[root@linux ~]# cat /etc/passwd
oracle:x:1101:1000::/home/oracle:/bin/bash
oracle10g:x:1102:1000::/home/oracle10g:/bin/bash
[root@linux~]# ps -ef|grep smon
oracle 3856 1 0 08:35 ? 00:00:01 ora_smon_ora11a
oracle 3988 1 0 08:36 ? 00:00:00 ora_smon_ora11b
oracle 4119 1 0 08:37 ? 00:00:00 ora_smon_ora11c
1102 4306 1 0 08:39 ? 00:00:00 ora_smon_ora10g
root 5836 5758 0 09:50 pts/3 00:00:00 grep smon
[root@linux~]#
根據以上資訊,可知3個11g的例項的管理使用者是oracle,而10g的例項管理使用者是oracle10g,但是很奇怪的是,檢視程式啟動的使用者時,10g的卻顯示使用者的主組、11g的顯示使用者名稱。
找到原因,解決方法很簡單,就是切換到oracle10g使用者下,然後sys使用者就可順利登陸:
[root@linux ~]# su - oracle10g
[oracle10g@linux ~]$ sqlplus sys/eh8#5pK6 as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Jul 21 09:56:10 2016
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>
附:透過如下命令,可以檢視顯示主組使用者的使用者名稱
[oracle10g@linux ~]$ cat /etc/passwd|grep 1102
oracle10g:x:1102:1000::/home/oracle10g:/bin/bash
[oracle10g@linux~]$
問題解決!
重啟時,11g的三個例項很簡單,但是10g的例項重啟時,發現sys無法登陸,報錯如下:
設定10g的環境變數
[oracle@linux ~]$ ps -ef|grep _ora10|grep smon
1102 4306 1 0 08:39 ? 00:00:00 ora_smon_ora10g
[oracle@linux ~]$export ORACLE_SID=ora10g
[oracle@linux ~]$ echo $ORACLE_SID
ora10g
[oracle@linux ~]$ export ORACLE_HOME=/u02/app/oracle/10.2.0/db_1
[oracle@linux ~]$ export PATH=$PATH:$ORACLE_HOME/bin
[oracle@linux ~]$ sqlplus sys/'eh8#5pK6' as sysdba
ERROR:
ORA-01804: failure to initialize timezone information
SP2-0152: ORACLE may not be functioning properly
[oracle@linux ~]$
關於ORA-01804&SP2-0152報錯,有資料說是環境變數問題,如果有資料庫版本升級過,不排除環境變數設定不當引起ORA-01804,但是,我再三核實確保環境變數沒問題;
真實原因是:11g的資料庫作業系統管理使用者是oracle,而10g的資料庫作業系統管理使用者是oracle10g。
排查過程如下:
[root@linux ~]# cat /etc/passwd
oracle:x:1101:1000::/home/oracle:/bin/bash
oracle10g:x:1102:1000::/home/oracle10g:/bin/bash
[root@linux~]# ps -ef|grep smon
oracle 3856 1 0 08:35 ? 00:00:01 ora_smon_ora11a
oracle 3988 1 0 08:36 ? 00:00:00 ora_smon_ora11b
oracle 4119 1 0 08:37 ? 00:00:00 ora_smon_ora11c
1102 4306 1 0 08:39 ? 00:00:00 ora_smon_ora10g
root 5836 5758 0 09:50 pts/3 00:00:00 grep smon
[root@linux~]#
根據以上資訊,可知3個11g的例項的管理使用者是oracle,而10g的例項管理使用者是oracle10g,但是很奇怪的是,檢視程式啟動的使用者時,10g的卻顯示使用者的主組、11g的顯示使用者名稱。
找到原因,解決方法很簡單,就是切換到oracle10g使用者下,然後sys使用者就可順利登陸:
[root@linux ~]# su - oracle10g
[oracle10g@linux ~]$ sqlplus sys/eh8#5pK6 as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Jul 21 09:56:10 2016
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>
附:透過如下命令,可以檢視顯示主組使用者的使用者名稱
[oracle10g@linux ~]$ cat /etc/passwd|grep 1102
oracle10g:x:1102:1000::/home/oracle10g:/bin/bash
[oracle10g@linux~]$
問題解決!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29357786/viewspace-2122318/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 資料庫例項啟動關閉過程Oracle資料庫
- 【02】Oracle資料庫的例項啟動關閉詳解Oracle資料庫
- 例項管理及資料庫的啟動關閉資料庫
- 2 Day DBA-管理Oracle例項-關閉和啟動Oracle例項-使用OEMDC關閉和啟動Oracle例項Oracle
- Oracle例項的啟動和關閉Oracle
- mongodb關閉資料庫例項MongoDB資料庫
- oracle 例項啟動和關閉解讀Oracle
- Oracle單例項+ASM啟動與關閉Oracle單例ASM
- 2 Day DBA-管理Oracle例項-關於例項的啟動和關閉-關於例項啟動Oracle
- 2 Day DBA-管理Oracle例項-關於例項的啟動和關閉-關於例項關閉Oracle
- 3.1.5.1 關於啟動資料庫例項資料庫
- Oracle資料庫的啟動與關閉Oracle資料庫
- Oracle資料庫的啟動和關閉Oracle資料庫
- ORACLE資料庫的啟動和關閉(轉)Oracle資料庫
- Oracle資料庫例項啟動步驟分析Oracle資料庫
- 一臺MySQL資料庫啟動多個例項MySql資料庫
- 2 Day DBA-管理Oracle例項-關於例項的啟動和關閉-管理啟動和關閉許可權Oracle
- Oracle Restart啟動資料庫例項故障一例OracleREST資料庫
- 資料庫自動啟動關閉資料庫
- 資料庫啟動和關閉資料庫
- 啟動/關閉與冷備份Oracle資料庫Oracle資料庫
- 隨系統啟動關閉的oracle資料庫Oracle資料庫
- ASM CRS 例項啟動和關閉ASM
- rac 管理 啟動關閉資料庫資料庫
- ORACLE資料庫的啟動和關閉之二(轉)Oracle資料庫
- Oracle資料庫的幾種啟動和關閉方式Oracle資料庫
- 深刻理解Oracle資料庫的啟動和關閉Oracle資料庫
- 深刻理解 oracle 資料庫的啟動和關閉Oracle資料庫
- oracle多個例項啟動方法Oracle
- 轉載“啟動\關閉Oracle資料庫的多種方法”--來自百度#OracleOracle資料庫
- Oracle11g RAC在例項關閉後自動在啟動例項上歸檔Oracle
- RAC 資料庫的啟動與關閉資料庫
- informix 資料庫啟動關閉指令碼ORM資料庫指令碼
- Mysql 5.5 資料庫啟動關閉命令MySql資料庫
- oracle資料庫的啟動關閉與各種服務Oracle資料庫
- oracle資料庫不同啟動命令和關閉命令全面解析Oracle資料庫
- oracle資料庫的啟動與關閉過程詳解Oracle資料庫
- 深刻理解Oracle資料庫的啟動和關閉(轉)Oracle資料庫