有熱備的system資料表空間損壞的恢複

來源:互聯網
上載者:User

熱備份system資料表空間

SQL> alter tablespace system beginbackup; 

Tablespace altered. 

SQL> !cp /u01/tiger/oradata/orcl2/system01.dbf/bk 

SQL> alter tablespace system end backup; 

Tablespace altered

然後做一些交易

再毀掉system資料表空間的檔案

切換日誌的時候會出錯

SQL> !cp /etc/passwd/u01/tiger/oradata/orcl2/system01.dbf

 

SQL> alter system switch logfile;

alter system switch logfile

*

ERROR at line 1:

ORA-03113: end-of-file on communicationchannel

我們重新串連資料庫

SQL> conn /as sysdba

Connected to an idle instance.

SQL> startup

Oracle instance started. 

Total System Global Area  314572800 bytes

Fixed Size                  1219136 bytes

Variable Size             121636288 bytes

Database Buffers          184549376 bytes

Redo Buffers                7168000 bytes

Database mounted.

ORA-01122: database file 1 failedverification check

ORA-01110: data file 1:'/u01/tiger/oradata/orcl2/system01.dbf'

ORA-01251: Unknown File HeaderVersion read for file number 1

查詢需要恢複的檔案

SQL> select * from v$recover_file;

 

    FILE# ONLINE  ONLINE_ ERROR                   CHANGE# TIME

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

        1 ONLINE  ONLINE  WRONG FILE TYPE               0

得知1號檔案需要恢複

查看恢複所需要的歸檔

 

SQL> select * from v$recovery_log;

 

no rows selected

這時候看見沒有需要的歸檔日誌

這時候把之前備份的是system01.dbf檔案拷貝過來

SQL> !cp /bk/system01.dbf/u01/tiger/oradata/orcl2/system01.dbf

重新查看沒有恢複的檔案了,

SQL> select * from v$recover_file;

 

    FILE# ONLINE  ONLINE_ ERROR                   CHANGE# TIME

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

        1 ONLINE  ONLINE                           540503 06-SEP-12

看一下恢複的歸檔檔案

SQL> select * from v$recovery_log;

 

  THREAD#  SEQUENCE# TIME

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

ARCHIVE_NAME

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

        1          1 06-SEP-12

/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_06/o1_mf_1_1_84jo2spj_.arc

 

        1          2 06-SEP-12

/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_06/o1_mf_1_2_84jo2vxd_.arc

 

        1          3 06-SEP-12

/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_06/o1_mf_1_3_84jo366c_.arc

SQL> recover datafile 1;   恢複資料檔案1號檔案

ORA-00279: change 540503 generated at09/06/2012 14:31:27 needed for thread 1

ORA-00289: suggestion :/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_06/o1_mf_1_1_%u_.arc

ORA-00280: change 540503 for thread 1 is insequence #1

 

 

Specify log: {<RET>=suggested |filename | AUTO | CANCEL}

                   <RET>=suggested 斷行符號系統自己去尋找

                   filename   手動指明寫日誌或歸檔的檔案位置

                   AUTO       系統自動去尋找

                   cancel     取消恢複

auto

alter database open

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.