Solved

RMAN Restore

Posted on 2006-11-06
11
1,283 Views
Last Modified: 2012-08-26
I have a questions regarding RMAN restores, will my RMAN backup restore all datafiles and archived redologs using the restore, recover database.  This will only bring my database to when I took the last backup.

Are online logs that have not been archived included in this type of restore or only if I do a Point in Time restore.  Until sequence ____, thread____?



0
Comment
Question by:cat200757
11 Comments
 
LVL 11

Expert Comment

by:mohammadzahid
ID: 17884374
RMAN by default take backup of datafiles and controlfiles if full database backup mode is used in RMAN script.

Online redo log files are not important if RMAN script include full database and archive log file backup.
You can perform SCN based recovery or other incomplete recovery by restoring archived log files from RMAN backup if required for LOGMNR.

Note that RMAN creates a backup piece as part of a backup set that can include full backup or full backup + archived logs. This information is stored in control files or in the catalog manager if catalog manager is created and used.

Please goto this site for RMAN scripts.

http://www.oracle-base.com/articles/9i/RecoveryManager9i.php

0
 

Author Comment

by:cat200757
ID: 17884480
Rman only applies the backup of the datafiles and the archived logs.  What about during the day the database crashed.  We have last nights backup, archived redo logs and what is currently in the online redo logs.  If the online redo logs are not applied the restore will only be to the last backup and archived logs.  If I want to bring the database back to where it was before the crash do I not need to apply the only redo logs?
0
 
LVL 11

Expert Comment

by:mohammadzahid
ID: 17884502
Here is another good site to read on RMAN:

http://www.oracle.com/technology/obe/obe9ir2/obe-ha/rman/rman.htm
0
 
LVL 11

Expert Comment

by:mohammadzahid
ID: 17884547
Yes you  need to apply redo log files

Here is what you need to apply:

1. Last backup
2. Archive log files (craeted after backup was taken)
3. Transactions stored in Redo log files

This should bring your database to the current status.



0
 

Author Comment

by:cat200757
ID: 17884618
To apply the transactions stored in the Redo Log files you would find the
last sequence number for the online redo logs prior to the database crashing and
apply using the following:

recover database
until sequence "#", thread "#"

is this correct?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 11

Expert Comment

by:mohammadzahid
ID: 17884778
you can find last sequence number from V$LOG_HISTORY. This view will list the SCN# as well as sequence number on where to stop or apply CANCEL during sequence based recovery.

Here is the RMAN script that can be helpful to you.

run {
     set until logseq 6 thread 1;
     allocate channel ch1 type 'sbt_tape';
     restore database;
     recover database;
     sql 'ALTER DATABASE OPEN RESETLOGS';
}




0
 
LVL 8

Accepted Solution

by:
gvsbnarayana earned 250 total points
ID: 17887948
Hi,
   RMAN doesn't take backup of online redo logs and also it is not recommended to take backup of online redo logs.
after restoring the database, RMAN will apply the remaining archive logs to bring the database to point in time where it has crashed provided that it can locate the archivelogs in the location of log_archive_dest_n.
If want an incomplete recovery, then you can use the script provided by mohammadzahid in his comment. You can set the log sequence number or scn number or time in the past to which the database must be restored.
If you have attempted an incomplete recovery, then the database must be opened with RESETLOGS option.
Above links provided by other experts are good and if you need, you can go through RMAN concpets in oracle documentation.
HTH
Regards,
Badri.
0
 

Author Comment

by:cat200757
ID: 17892255
Please I just need to get this clear, online redo logs need to be applied with the sequence and log number of the online redo log.  Along with this sequence and log number, the backup and the archivied logs we will have a full recovery.

Anything in the online redo logs is not being restored by RMAN automatically.
0
 
LVL 11

Assisted Solution

by:mohammadzahid
mohammadzahid earned 250 total points
ID: 17892365
Here is an example that maybe close to the problem you ran into when database crashed.

- Database running in ARCHIVE MODE
- Database backup full taken at 2:00PM.  (Include archived log files, datafiles)
- Database crashed at 4:00PM
- In hand (archived log files from 2:00-4:00PM) these are physical files.
- Some transactions are recorded in redo log files because log switch may not have occured when crashed occured. Use V$LOG or V$LOG_HISTORY to find out status of the SCN or sequence of the file archived.

RECOVERY:
- Start database in MOUNT mode
- Recover database using RMAN backup
- Apply archived log files from 2:00-4:00PM
- apply redo log files use CANCEL/ SEQUENCE based recovery.  (You can use my script to perform this task)

This will bring your database to current status.

Let me know if you have any questions or require further clarification.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20296220
Forced accept.

Computer101
EE Admin
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to take different types of Oracle backups using RMAN.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now