Here we will Restore rman backup to different server with different database name. Perform backup on production server and we will restore it on any QC,DEV or UAT server.
We have taken “RMAN backup” of PROD and will restore rman backup to different server with different database name.
ON SERVER1:
DB Name: PROD
➨Take backup of PROD with archive log, control file and spfile.
ON SERVER2:
–Create pfile for database TEST.
DB Name: TEST
#export ORACLE_SID=TEST
#rman target /
RMAN>restore controlfile from ‘/u01/backup/backup_db_c-300166359-20120316-00’; — complete path of backup
➨Since backup location on SERVER2 is different from SERVER1, so we have to use catalog command to update new backup location in control file.
Use below command for all backuppieces:
Or
RMAN>catalog backuppiece ‘/u01/backup/ora_arch_230412_13_43_NSNDB_23_1’;
RMAN>catalog backuppiece ‘/u01/backup/ora_arch_230412_13_43_NSNDB_24_1’;
➨ Since datafile location on SERVER2 is different from SERVER1, so we have to update control file for same with SET NEWNAME clause:
Now restore database backup on SERVER2:
RMAN>
run
{
set newname for datafile ‘/data02/oradata/system01.dbf’ to ‘/u01/oradata/nsnbak/system01.dbf’;set newname for datafile ‘/data02/oradata/undotbs01.dbf’ to ‘/u01/oradata/nsnbak/undotbs1.dbf’;
set newname for datafile ‘/data02/oradata/sysaux01.dbf’ to ‘/u01/oradata/nsnbak/sysaux01.dbf’;
set newname for datafile ‘/data02/oradata/users01.dbf’ to ‘/u01/oradata/nsnbak/users01.dbf’;
restore database;
switch datafile all;
}
–Also update redo log file in controlfile on SERVER2:
#sqlplus “/as sysdba”
SQL>alter database rename file ‘/data02/oradata/redo07.log’ to ‘/u01/oradata/nsnbak/redo07.log’;SQL>alter database rename file ‘/data02/oradata/redo08.log’ to ‘/u01/oradata/nsnbak/redo08.log’;
SQL>alter database rename file ‘/data02/oradata//redo09.log’ to ‘/u01/oradata/nsnbak/redo09.log’;
SQL>exit;
#rman target /
RMAN>run
{
recover database;
alter database open resetlogs; }
RMAN>exit;
#sqlplus “/as sysdba”
SQL>alter database tempfile ‘/u01/home/oracle/PROD/tempfiles/temp01_PROD.dbf’ drop including datafiles;
To change the database name in addition to the DBID, specify the DBNAME parameter. This example changes the name to test_db:
$nid TARGET=SYS/password DBNAME=test_db
SQL>ALTER DATABASE OPEN RESETLOGS;
After that modify the parameter file as db_name
thank you for sharing
SQL Server DBA Online Training Bangalore
Thanks for sharing this Informative content. Well explained. Got to learn new things from your Blog on. SQL server dba Online Training
Thank you for sharing the detailed information.. Very Helpful.. 🙂
While restore L0 backup getting media recovery error
I was married at 32 and immediately tried to get pregnant. When I was unable to conceive I had blood tests for fertility and was told that I had an FSH (follicle stimulating hormone) of 54 and would not be able to have children. Even though the doctors knew that I had been diagnosed with Hashimoto’s thyroiditis since age 25, no one bothered to check my thyroid levels. my TSH was measured at .001. My Synthroid dosage was lowered. a friend advise me to contact a spiritualist who help with fertility with his medicine, i collected his contact and explain my situation to him he prepared for me a herbal medicine which i took as describe by him. became pregnant very quickly, I had a successful pregnancy. I have my baby august 2017. to get pregnant at age 35 with my 2nd child in september 2019, thank you sir , this is his email contact if you require his help [email protected] or Facebook at priest.babaka
DO YOU NEED A PERSONAL/BUSINESS/INVESTMENT LOAN? CONTACT US TODAY VIA WhatsApp +19292227023 Email [email protected]
HELLO
Loan Offer Alert For Everyone! Are you financially down and you need an urgent credit/financial assistance? Or are you in need of a loan to start-up/increase your business or buy your dream house. GET YOUR INSTANT LOAN APPROVAL 100% GUARANTEED TODAY NO MATTER YOUR CREDIT SCORE. WhatsApp:+19292227023 Email: [email protected]