關於undo資料表空間配置錯誤的ORA-30012

來源:互聯網
上載者:User

      undo資料表空間是Oracle體繫結構的重要組成部分,為什麼我們可以復原,就是因為有它。資料庫任意資料的修改都會在undo資料表空間裡產生前鏡像,一是可以復原,二是可以實現並發,以及一致性查詢。因此undo也是Oracle資料庫在建立和配置參數時必要的組成部分。本文描述的是錯誤的配置undo資料表空間之後故障的解決。

      有關undo資料表空間的基礎知識可以參考:
            Oracle 復原(ROLLBACK)和撤銷(UNDO)
            檢查及設定合理的undo資料表空間
            收縮undo資料表空間

 

1、undo異常的錯誤提示

oracle@DevDB04:~> export ORACLE_SID=BODB3oracle@DevDB04:~> sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 23 10:19:27 2014Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to an idle instance.SQL> startup pfile=/u02/database/BODB3/initBODB3.ora;ORACLE instance started.Total System Global Area  536870912 bytesFixed Size                  2097624 bytesVariable Size             411045416 bytesDatabase Buffers          117440512 bytesRedo Buffers                6287360 bytesDatabase mounted.ORA-01092: ORACLE instance terminated. Disconnection forced


2、故障分析
#下面是alert 日誌資訊
#我們收到了錯誤提示: ORA-30012,UNDOTBS1不存在或者類型錯誤
Wed Apr 23 10:19:49 HKT 2014
Errors in file /u02/database/BODB3/udump/bodb3_ora_819.trc:
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Wed Apr 23 10:19:49 HKT 2014
Error 30012 happened during db open, shutting down database
USER: terminating instance due to error 30012
Instance terminated by USER, pid = 819
ORA-1092 signalled during: ALTER DATABASE OPEN...

#進一步查看追蹤檔案
oracle@DevDB04:/u02/database/BODB3/bdump> more /u02/database/BODB3/udump/bodb3_ora_819.trc
/u02/database/BODB3/udump/bodb3_ora_819.trc
Oracle Database 10g Release 10.2.0.5.0 - 64bit Production
ORACLE_HOME = /users/oracle/OraHome10g
System name:    Linux
Node name:      DevDB04
Release:        2.6.16.46-0.12-smp
Version:        #1 SMP Thu May 17 14:00:09 UTC 2007
Machine:        x86_64
Instance name: BODB3
Redo thread mounted by this instance: 1
Oracle process number: 15
Unix process pid: 819, image: oracle@DevDB04 (TNS V1-V3)

*** ACTION NAME:() 2014-04-23 10:19:49.076
     .....中間部分省略.....
----- Recovery Hash Table Statistics ---------
Hash table buckets = 32768
Longest hash chain = 0
Average hash chain = 0/0 = 0.0
Max compares per lookup = 0
Avg compares per lookup = 0/0 = 0.0
----------------------------------------------
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
#也是undo相關的問題,UNDOTBS1不存在或者類型錯誤
#也就是說undo參數沒有正確的設定

 

3、故障解決

SQL> startup mount pfile=/u02/database/BODB3/initBODB3.ora;ORACLE instance started.--注,undo 參數沒有正確設定是可以mount的,--mount階段會讀取控制檔案以擷取資料檔案和重做記錄檔的名字和狀態資訊,但不檢查資料、記錄檔存在與一致性--Author: Leshami--Blog  : http://blog.csdn.net/leshami--查看undo的配置SQL> show parameter undoNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------undo_management                      string      AUTOundo_retention                       integer     900undo_tablespace                      string      UNDOTBS1SQL> ho grep undo /u02/database/BODB3/initBODB3.oraundo_management=AUTOundo_tablespace=UNDOTBS1#undo_retention=86400#undo_retention=172800--資料字典中記錄的undo資訊,沒有undotbs1,這就是問題所在SQL> select name from v$tablespace where name like '%UNDO%';NAME------------------------------UNDOTBS2UNDOTBS--下面查看undo對應的資料檔案,有2個,應該是與上面的2個undo資料表空間相對應SQL> ho ls -hltr /u02/database/BODB3/undototal 301M-rw-r----- 1 oracle oinstall 201M 2014-04-23 10:19 undotbsBODB33.dbf-rw-r----- 1 oracle oinstall 101M 2014-04-23 10:19 undotbsBODB32.dbfSQL> shutdown abort;ORACLE instance shut down.--下面修改undo配置到任意一個undo資料表空間SQL> ho vi /u02/database/BODB3/initBODB3.oraSQL> ho grep undo /u02/database/BODB3/initBODB3.oraundo_management=AUTOundo_tablespace=UNDOTBS#undo_retention=86400#undo_retention=172800--再次重啟後可以正常open--如果你使用的是spfile,可以直接通過alter system去修改SQL> startup pfile=/u02/database/BODB3/initBODB3.oraORACLE instance started.Total System Global Area  536870912 bytesFixed Size                  2097624 bytesVariable Size             411045416 bytesDatabase Buffers          117440512 bytesRedo Buffers                6287360 bytesDatabase mounted.Database opened.SQL> show parameter db_nameNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------db_name                              string      BODB3SQL> select open_mode from v$database;OPEN_MODE----------READ WRITESQL> show parameter undoNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------undo_management                      string      AUTOundo_retention                       integer     900undo_tablespace                      string      UNDOTBS

   

更多參考

有關Oracle RAC請參考
     使用crs_setperm修改RAC資源的所有者及許可權
     使用crs_profile管理RAC資源設定檔
     RAC 資料庫的啟動與關閉
     再說 Oracle RAC services
     Services in Oracle Database 10g
     Migrate datbase from single instance to Oracle RAC
     Oracle RAC 串連到指定執行個體
     Oracle RAC 負載平衡測試(結合伺服器端與用戶端)
     Oracle RAC 伺服器端串連負載平衡(Load Balance)
     Oracle RAC 用戶端串連負載平衡(Load Balance)
     ORACLE RAC 下非預設連接埠監聽配置(listener.ora tnsnames.ora)
     ORACLE RAC 監聽配置 (listener.ora tnsnames.ora)
     配置 RAC 負載平衡與容錯移轉
     CRS-1006 , CRS-0215 故障一例 
     基於Linux (RHEL 5.5) 安裝Oracle 10g RAC
     使用 runcluvfy 校正Oracle RAC安裝環境

有關Oracle 網路設定相關基礎以及概念性的問題請參考:
     配置非預設連接埠的動態服務註冊
     配置sqlnet.ora限制IP訪問Oracle
     Oracle 監聽器日誌配置與管理
     設定 Oracle 監聽器密碼(LISTENER)
     配置ORACLE 用戶端串連到資料庫

有關基於使用者管理的備份和備份恢複的概念請參考
     Oracle 冷備份
     Oracle 熱備份
     Oracle 備份恢複概念
     Oracle 執行個體恢複
     Oracle 基於使用者管理恢複的處理
     SYSTEM 資料表空間管理及備份恢複
     SYSAUX資料表空間管理及恢複
     Oracle 基於備份控制檔案的恢複(unsing backup controlfile)

有關RMAN的備份恢複與管理請參考
     RMAN 概述及其體繫結構
     RMAN 配置、監控與管理
     RMAN 備份詳解
     RMAN 還原與恢複
     RMAN catalog 的建立和使用
     基於catalog 建立RMAN儲存指令碼
     基於catalog 的RMAN 備份與恢複
     RMAN 備份路徑困惑
     使用RMAN實現異機備份恢複(WIN平台)
     使用RMAN遷移檔案系統資料庫到ASM
     linux 下RMAN備份shell指令碼
     使用RMAN遷移資料庫到異機

有關ORACLE體繫結構請參考
     Oracle 資料表空間與資料檔案
     Oracle 密碼檔案
     Oracle 參數檔案
     Oracle 聯機重做記錄檔(ONLINE LOG FILE)
     Oracle 控制檔案(CONTROLFILE)
     Oracle 歸檔日誌
     Oracle 復原(ROLLBACK)和撤銷(UNDO)
     Oracle 資料庫執行個體啟動關閉過程
     Oracle 10g SGA 的自動化管理
     Oracle 執行個體和Oracle資料庫(Oracle體繫結構) 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.