有備份的users資料表空間的損壞恢複

來源:互聯網
上載者:User

備份user資料表空間

SQL> alter tablespace users beginbackup; 

Tablespace altered.

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

SQL> alter tablespace users end backup; 

Tablespace altered

做交易然後破壞user資料表空間

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

SQL> alter system switch logfile; 

System altered. 

SQL> select * from emp;

select * from emp

              *

ERROR at line 1:

ORA-00376: file 4 cannot be readat this time

ORA-01110: data file 4:'/u01/tiger/oradata/orcl2/users01.dbf'

SQL> select * from v$recover_file;

 

    FILE# ONLINE  ONLINE_ ERROR                   CHANGE# TIME

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

        4 OFFLINE OFFLINE FILE NOT FOUND                0

 

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

 

SQL> select * from v$recover_file;

 

    FILE# ONLINE  ONLINE_ ERROR                   CHANGE# TIME

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

        4 OFFLINE OFFLINE                          563482 06-SEP-12

 

SQL> select * from v$recovery_log;

 

  THREAD#  SEQUENCE# TIME

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

ARCHIVE_NAME

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

        1         10 06-SEP-12

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

 

        1         11 06-SEP-12

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

SQL> alter tablespace users online;

alter tablespace users online

*

ERROR at line 1:

ORA-01113: file 4 needs mediarecovery

ORA-01110: data file 4:'/u01/tiger/oradata/orcl2/users01.dbf'

SQL> recoverdatafile 4;

Media recovery complete.

SQL> alter tablespace users online;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.