Oracle Rman Full recovery case (vi) Recover data using image (mirrored backup)

Source: Internet
Author: User
Tags commit

Case 6:

--Recover data with image (mirrored backup)

1) Establish a mirrored backup

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

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

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

2) test environment

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 the 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) Start the database

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.