From RMAN Backup create new database Server
We have RMAN backup of production server. We will try to restore it on another server i.e QA or TEST Server which may having different or similar disk info.
Similar way we will create new TEST Server with RMAN backup
Steps for Creating New Server(TEST) with RMAN backup of Production
Step 1: Install the same oracle home and apply patches which is present in existing oracle home.
Note: On Windows, you need to run oradim for creating services for database.
Step 2. Set the PATH, ORACLE HOME, ORACLE SID environment variable
Step 3. Restore the SPFILE
RMAN>startup nomount force;
RMAN>restore spfile from '/u01/oracle/backup/spfile.bkp';
Step 4: Create the PFILE from SPFILE and edit parameter as needed.
Note : Change location of ADR Home, Control file as required
sqlplus sys as sysdba
create pfile from spfile;
Step 5: Restore the Control Files from backup.
RMAN>restore controlfile from '/u01/oracle/backup/controlfile.bkp';
Step 6: Mount the database and catalog the backup pieces which have been restored in the new location
RMAN>alter database mount;
-- Catalog if needed
RMAN>catalog start with '/u01/oracle/backup';
Step 7: Set the parameter DB_FILE_NAME_CONVERT or you can use set newname in script.
Note: Following script help you for creating set newname if having no of datafile:
select 'SET NEWNAME FOR DATAFILE ' || FILE# || ' TO "' || '/u01/oracle/oradata/' || substr(name,instr(name,'/',-1)+1) || "';' from v$datafile;
Step 8: Restore and Recover the database with rman script
SET NEWNAME FOR DATAFILE 1 TO '/u01/oracle/oradata/system01.dbf';
SET NEWNAME FOR DATAFILE 2 TO '/u01/oracle/oradata/sysaux01.dbf';
SET NEWNAME FOR DATAFILE 3 TO '/u01/oracle/oradata/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 4 TO '/u01/oracle/oradata/users01.dbf';
switch datafile all;
Step 9: Open the database with RESETLOGS
Alter database open resetlogs;
Step 10: Rename the present redo log file on startup mount state:
alter database rename file '/u02/oradata/redo03.log' to '/u01/oracle/oradata/redo03.log';
alter database rename file '/u02/oradata/redo02.log' to '/u01/oracle/oradata/redo02.log';