Oracle RMAN完全恢複案例(六)利用image (鏡像備份)恢複資料

來源:互聯網
上載者:User

案例6:

--利用image (鏡像備份)恢複資料

1)建立鏡像備份

RMAN> delete backup;

RMAN> list backup;

RMAN> backup as copy datafile 2 format '/disk1/rman/prod/users_%s.bak';

RMAN> list copy of datafile 2;

List of Datafile Copies

Key     File S Completion Time Ckp SCN    Ckp Time        Name

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

19      2    A 18-AUG-11       1383523    18-AUG-11       /disk1/rman/prod/users_38.bak

2)測試環境

07:59:17 SQL> conn scott/tiger

Connected.

07:59:20 SQL>

07:59:20 SQL> select * from emp1;

EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO

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

7369 SMITH      CLERK           7902 17-DEC-80        800                    20

7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30

07:59:27 SQL> insert into emp1 select * from emp1;

2 rows created.

07:59:46 SQL> select * from emp1;

EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO

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

7369 SMITH      CLERK           7902 17-DEC-80        800                    20

7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30

7369 SMITH      CLERK           7902 17-DEC-80        800                    20

7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30

07:59:48 SQL> commit;

Commit complete.

07:59:49 SQL> conn /as sysdba

Connected.

07:59:52 SQL>

07:59:52 SQL> shutdown abort

ORACLE instance shut down.

[oracle@work ~]$ rm /u01/app/oracle/oradata/prod/users01.dbf

3)啟動資料庫

07:59:56 SQL> startup

ORACLE instance started.

Total System Global Area  314572800 bytes

Fixed Size                  1219184 bytes

Variable Size              79693200 bytes

Database Buffers          230686720 bytes

Redo Buffers                2973696 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 2 - see DBWR trace file

ORA-01110: data file 2: '/u01/app/oracle/oradata/prod/users01.dbf'

08:00:37 SQL> select file#,error from v$recover_file;

聯繫我們

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