rman restore

  • From: "Zelli, Brian" <Brian.Zelli@xxxxxxxxxxxxxxx>
  • To: "oracle-l (oracle-l@xxxxxxxxxxxxx)" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 14 Oct 2014 17:43:52 +0000

Ok, I am using rman for backups and I capture a bunch of backup files and 
controlfile.  I am using rman with no catalog since I am not archiving.
If I want to restore to another server (finally a test box to restore), do I 
just bring all the files over and issue an rman restore?  Is there a cheat 
sheet around to kind of guide me?  I found this:

Restore Example
There are many ways to restore a database using an RMAN backup - this example 
assumes you are performing a Disaster-Recovery restore of all data and 
recovering the entire database with the same SID and the same disk/tablespace 
layout.
You will need the following information:
Database SID: ________
Database SYS password: ________
Disk layout and sizes: ________
Database ID (DBID): ________
There are 5 steps to recover the database:
1) Create a new (empty) database instance
2) Mount the instance
3) Restore the datafiles
4) Recover the database
5) Reset the logs
1) Create a new (empty) database instance
Configure the new server with same disk layout as the original database - if 
necessary use Symbolic Links (or in Windows use disk manager to re-assign drive 
letters.)
Ensure you have enough disk space for both the backup files plus the restored 
database files.
Create a new database with the database configuration assistant (DBCA) and set 
the SYS password and global database_name to the same as the original database.
If the database to be restored is in archive log mode, set the 
LOG_ARCHIVE_FORMAT parameter to match the setting in the original database.
The ORAPWD utility can also be used to change the SYS password.
Set the environment variable NLS_LANG for your character set -
NLS_LANG=American_America.WE8ISO8859P1
2)  Mount the empty instance
SQL> Shutdown immediate;
SQL> Startup mount;
or specifying the pfile explicitly:
SQL> CREATE PFILE='C:\oracle\Database\initLive.ora' FROM SPFILE;
SQL> Shutdown immediate;
SQL> Startup mount pfile=C:\oracle\Database\initLive.ora
3) Restore the datafiles
In this case we have copied the RMAN backup files and archive logs to R:\Rman\
Change the dbid to match that of the database being restored
RMAN> SET dbid = 477771234;
RMAN> run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT 'R:\Rman\%U';
restore database;
}
At this point the datafiles and tablespaces will be re-created. For a large 
database it can take a long time to restore each tablespace - for better 
performance during a restore place the RMAN backup files on a separate disk to 
the Oracle datafiles to reduce disk contention.
4) Recover the database
SQL> Recover from 'L:\oradata\live' database until cancel using backup 
controlfile;
SQL> cancel
5) Reset the logs
SQL> alter database open resetlogs;
This will update all current datafiles and online redo logs and all subsequent 
archived redo logs with a new RESETLOGS SCN and time stamp.
As soon as you have done a resetlogs run a full backup, this is important as 
should you suffer a second failure you will not be able to perform a second 
recovery because after resetting the logs the SCN numbers will no longer match 
any older backup files.
Notes:
The DBID can be retrieved in several places, if the database is running: Select 
dbid from V$DATABASE;
The RMAN client displays the dbid at startup when connecting to a database:
Copyright (c) 1995, 2003, Oracle. All rights reserved.
connected to target database: RDBMS (DBID=7776644123)

The default filename format for an RMAN controlfile autobackup is 
c-IIIIIIIIII-YYYYMMDD-QQ, where: IIIIIIIIII is the DBID.



Brian




This email message may contain legally privileged and/or confidential 
information.  If you are not the intended recipient(s), or the employee or 
agent responsible for the delivery of this message to the intended 
recipient(s), you are hereby notified that any disclosure, copying, 
distribution, or use of this email message is prohibited.  If you have received 
this message in error, please notify the sender immediately by e-mail and 
delete this email message from your computer. Thank you.

Other related posts: