Restore database with RMAN: An Example

Source: Internet
Author: User

1. Database startup error:

Jm_db1 $ sqlplus "/As sysdba"

SQL> startup

Oracle instance started.

Total system global area 3417017632 bytes

Fixed size 732448 bytes

Variable Size 956301312 bytes

Database buffers 2457600000 bytes

Redo buffers 2383872 bytes

Database mounted.

ORA-01113: File 1 needs media recovery

ORA-01110: Data File 1: '/opt/Oracle/DB02/oradata/orcl/system01.dbf'

Try to restore this file

SQL> recover datafile '/opt/Oracle/DB02/oradata/orcl/system01.dbf ';

ORA-00279: Change 6611207127608 generated at 04/13/2005 15:29:43 needed

Thread 1

ORA-00289: Suggestion:/opt/Oracle/ARCH/orclarch_42591724.arc

ORA-00280: Change 6611207127608 for thread 1 is in sequence #91724

 

Specify log: {<RET> = suggested | filename | auto | cancel}

Press enter (Auto recovery)

ORA-00308: cannot open archived log '/opt/Oracle/ARCH/orclarch_42591724.arc'

ORA-27037: unable to obtain File status

Svr4 error: 2: no such file or directory

Additional information: 3

2. According to the results, you need to restore the archive log from 91724 (a long time ago. Check archiving logs

$ CD/opt/Oracle/Arch

$ LS-l

./Orclarch_000094162.arc: no such device or address

./Orclarch_000094163.arc: no such device or address

./Orclarch_000094164.arc: no such device or address

.......

./Orclarch_rj94159.arc: no such device or address

./Orclarch_000094160.arc: no such device or address

./Orclarch_000094161.arc: no such device or address

Total 20480

-RW ------ T 0 root other 10485760 Apr 26 orclarch_1_94141.arc

The file name can be seen, the content is gone, and the archive logs are all damaged.
This is because a level-0 backup was made to the database before the T3 upgrade, so that the source cannot be completely restored:

Find the last backup log sequence through the RMAN Catalog Database:

Jm_backup $ sqlplus RMAN/RMAN

SQL> select max (sequence #) from rc_log_history;

Max (sequence #)

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

94303

3. Recovery:

The database must be in the Mount state for recovery.

Jm_db1 $ sqlplus "/As sysdba"

SQL> startup Mount

The database content recovered to 94303.

Jm_db1 $ RMAN target/rcvcat RMAN/RMAN @ cata

Run {

Allocate channel C2 type 'sbt _ tape'

Parms 'env = (ns_server = jm_backup,

Ns_client = ipasdb,

Ns_data_volume_pool = orapool )';

Allocate channel C3 type 'sbt _ tape'

Parms 'env = (ns_server = jm_backup,

Ns_client = ipasdb,

Ns_data_volume_pool = orapool )';

Set until logseq 94303 thread 1;

Restore database;

Recover database;

Release Channel C3;

Release Channel C2;

}

(The script used by the customer is completely restored. Of course, it is not successful. I only added set until logseq 94303 thread 1 ;)

At this time, the system re-writes the content of the previous 0-level backup to T3, together with the archived log file.

 
This process is slow. The following message is displayed:

Media recovery complete

Finished recover at 26-apr-05

Released channel: C3

Released channel: C2

RMAN> exit

Jm_db1 $ sqlplus "/As sysdba"

SQL> alter database open resetlog;

Recovery completed. Incomplete recovery requires resetlog, and the log sequence starts from 1. At this time, a full backup is required. Because there are no major operations after log reaches 94303, and it is not started successfully, although some data is lost in the database, there are not many operations, and archivelog is incomplete and cannot be completely restored.

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.