Recovery when online logs are corrupted (abnormal database shutdown)

Source: Internet
Author: User

1. Create Table T2
SQL> create table t2 (
A1 number (10 ),
A2 char (10) tablespace users;

2. Insert two rows of data
SQL> insert into t2 values (33, 'cc ');
SQL> commit;
SQL> alter system switch logfile;
SQL> insert into t2 values (44, 'dd ');
SQL> commit;
 
3. The database is shut down abnormally and no check point is executed.
SQL> shutdown abort
Oracle instance shut down.
 
4. Simulate online log corruption
SQL> host rm-rf/database/ykg *. log
 
5. view the archive logs currently in use
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 4
Next log sequence to archive 5
Current log sequence 5
 
6. Incomplete Database recovery
RMAN> run {
2> restore database;
3> recover database until sequence 5 thread 1;
4> alter database open resetlogs ;}
 
Note: after Incomplete recovery, you must immediately perform a full backup. You cannot perform Incomplete recovery twice in a row.

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.