Explore Oracle Incomplete recovery-cancel-based recovery Article 1

Source: Internet
Author: User

Cancel-based Inconsistency Recovery (archive) Article 1

 

Cancellation-based recovery only applies to the following situations: loss of archived logs leads to full recovery failure; loss of data files and Unarchived redo logs (online redo logs );

 

1. Shut down the database and perform a full-database cold backup.

 

SQL> selectfile_name from dba_data_files;

 

FILE_NAME

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

/DBBak2/oradata/WWL/users01.dbf

/DBBak2/oradata/WWL/sysaux01.dbf

/DBBak2/oradata/WWL/undotbs01.dbf

/DBBak2/oradata/WWL/system01.dbf

/DBBak2/oradata/WWL/WWL001.dbf

/DBBak2/oradata/WWL/WWL002.dbf

/DBBak2/oradata/WWL/WWL003.dbf

 

7 rows selected.

 

SQL> shutdownimmediate

Database closed.

Database dismounted.

Oracle instance shut down.

 

SQL>! Mkdir/DBBak2/oradata/WWL2

 

SQL>! Cp/DBBak2/oradata/WWL/*/DBBak2/oradata/WWL2/

 

 

2. Open the database and continue using it. We can see that there are only four records in the database wwl001 during Backup.

SQL> select * fromwwl001;

 

ID NAME

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

1 jetsen

2 woo

3 prudence

4 beijin

4 rows selected.

 

3. Continue to insert data to the wwl001 table, and switch the log to archive the redo log.

SQL> insert into wwl001 values (5, 'China ');

1 row created.

 

SQL> insert into wwl001 values (6, 'America ');

1 row created.

 

SQL> commit;

Commit complete.

 

SQL> select * fromwwl001;

 

ID NAME

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

1 jetsen

2 woo

3 prudence

4 beijin

5 china

6 america

 

6 rows selected.

 

SQL>

 

SQL> alter systemswitch logfile;

System altered.

 

SQL>/

System altered.

 

SQL>/

System altered.

 

SQL>/

System altered.

 

SQL>/

System altered.

 

4. Shut down the database, simulate the loss of data files, and archive logs, so the database can only perform Inconsistency Recovery.

SQL> shutdownabort;

ORACLE instance shut down.

 

SQL>! Rm-rf/DBBak2/oradata/WWL/*. dbf

 

SQL>! Cp/DBBak2/oradata/WWL2/*. dbf/DBBak2/oradata/WWL/

 

SQL>! Cp/DBBak2/oradata/WWL2/*. dbf/DBBak2/oradata/WWL/

 

5. Execute cancel-based Incomplete recovery

SQL> startup

ORACLE instance started.

 

Total System Global Area 100663296 bytes

Fixed Size 1217884 bytes

Variable Size 88083108 bytes

Database Buffers 8388608 bytes

Redo Buffers 2973696 bytes

Database mounted.

ORA-01113: file 1 needs media recovery

ORA-01110: data file 1: '/DBBak2/oradata/WWL/system01.dbf'

 

SQL> select * fromv $ recover_file;

 

FILE # ONLINE _ error change # TIME

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

1 ONLINE 1783695 31-JUL-12

2 ONLINE 1783695 31-JUL-12

3 ONLINE 1783695 31-JUL-12

4 ONLINE 1783695 31-JUL-12

5 ONLINE 1783695 31-JUL-12

6 ONLINE 1783695 31-JUL-12

7 ONLINE 1783695 31-JUL-12

 

7 rows selected.

 

SQL> recoverdatabase until cancel;

ORA-00279: change 1783695 generated at07/31/2012 15:32:04 needed for thread 1

ORA-00289: suggestion:/DBSoft/product/10.2.0/db_1/dbs/arch/1_2_790095025.dbf

ORA-00280: change 1783695 for thread 1 isin sequence #2

 

 

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

Cancel

Media recovery canceled.

SQL>

 

SQL> select * fromv $ recover_file;

 

FILE # ONLINE _ error change # TIME

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

1 ONLINE 1783695 31-JUL-12

2 ONLINE 1783695 31-JUL-12

3 ONLINE 1783695 31-JUL-12

4 ONLINE 1783695 31-JUL-12

5 ONLINE 1783695 31-JUL-12

6 ONLINE 1783695 31-JUL-12

7 ONLINE 1783695 31-JUL-12

 

7 rows selected.

 

SQL> alterdatabase open resetlogs;

 

Database altered.

 

SQL> conn wwl/wwl

Connected.

 

SQL> select * fromwwl001;

 

ID NAME

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

1 jetsen

2 woo

3 prudence

4 beijin

 

SQL>

Related reading:

Exploring the RMAN_01 concept of Oracle

Explore the basic use of RMAN_02 in Oracle

Explore Oracle-based RMAN_03 non-consistent backup

Explore Oracle-based RMAN_04 non-consistent backup

Explore RMAN_05 Incremental Backup in Oracle

Exploring Oracle's RMAN_06 backup policy

Explore Oracle RMAN_07 restoration of single data file loss

Explore Oracle RMAN_07 recovery of whole business tablespace loss

Explore Oracle RMAN_07 disk corruption data loss recovery

Explore Oracle RMAN_07 recovery of all database files lost

Explore Oracle RMAN_07 redo log redu file loss recovery

Explore Oracle RMAN_07 parameter file loss recovery

Explore Oracle RMAN_07 control file loss recovery

Explore Oracle RMAN_07 system tablespace loss recovery

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.