undo 資料表空間損壞導致無法open
在資料庫undo資料表空間檔案損壞,或者undo資料表空間檔案缺失的情況,無法開啟資料庫。
這兩種情況都可以視為一種情況處理,解決方案一樣。
啟動資料庫時 出現:
SQL> startup
Oracle instance started.
Total System Global Area 709836800 bytes
Fixed Size 2231752 bytes
Variable Size 536871480 bytes
Database Buffers 167772160 bytes
Redo Buffers 2961408 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Process ID: 4098
Session ID: 1 Serial number: 5
可以很明顯的看到,由於undo資料表空間損壞或丟失,導致無法開啟。
解決思路很簡單:建立一個undo資料表空間,然後將undo_tablespace指向新的undo資料表空間。但是,但是。。。建立資料表空間只能在資料庫open狀態下才能進行。
所以。。
因為oracle system 資料表空間還有復原段,因為我們先可以讓oracle使用復原段開啟資料庫,然後就可以建立undo資料表空間了
解決思路:
1、將資料庫啟動到mount
2、alter system set undo_management=manual scope=spfile;
3、shutdown immediate
4 、startup 然後建立一個undo資料表空間 new_undotbsxx
5、修改undo_tablespace參數指向new_undotbsxx
6、記得 將undo_manageme參數修改回來。 alter system set undo_management=auto scope=spfile;
SQL> alter system set undo_management=manual scope=spfile;
System altered.
然後開啟資料庫---
SQL> startup
ORACLE instance started.
Total System Global Area 709836800 bytes
Fixed Size 2231752 bytes
Variable Size 536871480 bytes
Database Buffers 167772160 bytes
Redo Buffers 2961408 bytes
Database mounted.
Database opened.
--已經順利開啟資料庫
查看 --undo_management
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string MANUAL
undo_retention integer 900
undo_tablespace string UNDOTBS11
現在可以建立一個undo_tablespace 然後將undo_tablespace參數指向過去。
SQL> create undo tablespace undotbs11 datafile '/u01/app/oracle/oradata/orcl/undotbs11.dbf' size 100m;
Tablespace created.
--然後將undo_tablespace指向為剛剛建立的undo資料表空間
SQL> alter system set undo_tablespace=undotbs11 scope=spfile;
System altered.
--最後一定一定要記得把undo_management 給改回來
SQL> alter system set undo_management=auto scope=spfile;
System altered.
然後關閉資料庫,再開啟
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 709836800 bytes
Fixed Size 2231752 bytes
Variable Size 536871480 bytes
Database Buffers 167772160 bytes
Redo Buffers 2961408 bytes
Database mounted.
Database opened.
--沒有問題,可以將以前損壞的undo資料表空間資料檔案刪除了
SQL> drop tablespace undotbs1 including contents and datafiles;
Tablespace dropped.
推薦閱讀:
[Oracle] 在沒有備份的情況下undo損壞怎麼辦?
UNDO資料表空間失敗的處理方法
undo資料表空間故障和ORA-01548處理
RAC下丟失undo資料表空間的恢複
UNDO資料表空間備份恢複