How to restore archive logs from RMAN backup

How to restore archive logs from rman backup

How do I restore archive log from backup?

In this article, we are going to learn how to restore the archive logs from RMAN backup. RMAN restores archives on the default location. To change archive logs location we used the SET ARCHIVELOG DESTINATION command.

  1. Your Database must be in mounted or open mode.
  2. start RMAN and connect with the target database.
  3. Execute the below steps in the RUN command.

Step 1. Check database open mode.

SQL> select open_mode from v$database;
 
open_mode
--------------
READ WRITE

SQL> exit

How do I restore Archivelog from RMAN backup tape?

Step 2. Now start RMAN and connect with the target database.

$rman target/

In this example, we are going to restore only 10 archive logs from logseq 200 to logseq 210.

RMAN> RUN {
              #New location for archive logs.
              set archivelog destination to '/u01/arc_restore';
              #Restore archive logs as per sequence number.
              restore archivelog from logseq 200 until logseq 210;
              }

[from logseq] – Is the starting log sequence#
[until logseq] – Is the end log sequence#

Once the above command is successfully completed, then you can use these restored archives for your standby database.

If you want to restore all archive logs from backup use the below command.

RMAN> restore archivelog all;

To restore a single archive log, suppose I want to restore log number 215.

RMAN> restore archivelog from logseq=215;

How to uncatalog the required archive logs from the RMAN prompt?

Using the below command you can uncatalog the required archive logs from the RMAN prompt. You have successfully restored archive logs from RMAN backup.

RMAN>change archivelog from logseq=60 until logseq=80 uncatalog;

Read - Storing RMAN output in a log file

Connect with me on:

Instagram: https://www.instagram.com/shripaldba
Linkedin: 
https://www.linkedin.com/in/shripal-singh
Twitter: 
https://twitter.com/ocptechnology
Facebook: 
https://www.facebook.com/ocptechnology
YouTube: 
https://www.youtube.com/ocptechnology

3 thoughts on “How to restore archive logs from RMAN backup

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top