undo表空間出現壞塊導致資料庫重啟問題解決

zhangsharp20發表於2016-12-02
作業系統:AIX5.3
資料庫版本:10.2.0.4.12

一、11月27日 11:40到11月28日 6:00做undo資料檔案轉儲,命令如下:
run {
allocate channel c1 type 'sbt_tape';
allocate channel c2 type 'sbt_tape';
allocate channel c3 type 'sbt_tape';
allocate channel c4 type 'sbt_tape';
set newname for datafile 714 to '+YYJC/dwth/undotbs1.761n';
set newname for datafile 559 to '+YYJC/dwth/undotbs1.606n';
set newname for datafile 683 to '+YYJC/dwth/undotbs1.728n';
set newname for datafile 678 to '+YYJC/dwth/undotbs1.723n';
set newname for datafile 222 to '+YYJC/dwth/undotbs1.283n';
restore datafile 714;
restore datafile 559;
restore datafile 683;
restore datafile 678;
restore datafile 222;
switch datafile 714;
switch datafile 559;
switch datafile 683;
switch datafile 678;
switch datafile 222;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
嘗試做資料檔案恢復,發現需要應用的歸檔日誌太多,耗費時間較長,故終止操作。




二、11月28日 10:00到11月28日11點對仍然有問題的undo段進行刪除操作,具體步驟如下:


1、確定需要恢復的回滾段
select * from dba_rollback_segs where status='NEEDS RECOVERY';


2、關閉資料庫監聽,防止新會話產生
srvctl stop listener -n ods1
srvctl stop listener -n ods2


3、殺掉現有會話
ps -ef|grep DWTH|grep LOCAL=NO|awk '{print $2}'|xargs kill -9




4、備份引數檔案
create pfile='/tmp/initDWTH1_20161128.ora' from spfile;


5、修改備份檔案,跳過需要回滾的回滾段
vi /tmp/initDWTH1_20161128.ora
*.undo_management=manual
*._corrupted_rollback_segments=('_SYSSMU27$','_SYSSMU46$')


6、關閉資料庫,用修改過的pfile以限制會話連線方式啟動資料庫
shutdown immediate


startup restrict open pfile='/tmp/initDWTH1_20161128.ora';




7、刪除回滾段資訊


drop rollback segment
SQL>drop rollback segment "_SYSSMU27$";
SQL>drop rollback segment "_SYSSMU46$";


8、以原有的預設的spfile啟動資料庫
shutdown immediate;




srvctl start database -d DWTH




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

相關文章