RMAN recovery in another host and renaming DBNAME
Precaution:
-----------
1. Be sure that your oracle user on destination host is owned by "dba" secondary group and "oinstall" primary group
other wise you will get RMAN-04005: error from target database:
ORA-01031: insufficient privileges
2. Create a password file
Steps to restoration:
---------------------
----- untar the file containing backup pieces
tar -zxvf /app/u02/oradata/full_rman_backup_190911.tar.gz
copy all archivelog (near date of full backup) to archiveloglocation
----- mount the database with control file
export ORACLE_SID=orcl
rman target / nocatalog
set dbid xxxxxxxxx
startup nomount pfile='/app/u01/oracle/product/10.2.0/db_1/dbs/initorcl.ora'
restore controlfile from '/app/u03/oradata/full_rman_backup_190911/o1_mf_s_762246924_77f5xflw_.bkp';
alter database mount;
---- check the datafile, logfile information and find the scn number
sqlplus / as sysdba
select group#, to_char(first_change#), status, archived from v$log order by FIRST_CHANGE# desc; -- find the 'current' marked scn_number 9773049580351
COLUMN NAME FORMAT a70
SELECT FILE# AS "File/Grp#", NAME FROM V$DATAFILE UNION SELECT GROUP#,MEMBER FROM V$LOGFILE;
---- finally restore the database
rman target / nocatalog
list backup;
report schema;
catalog start with '/app/u03/oradata/full_rman_backup_190911';
catalog start with '/app/u03/oradata/archivelog';
crosscheck backupset pieceno; --find available or not.
list incarnation of database;
reset database to incarnation 2; --the parent one
restore database;
sqlplus /nolog
conn /as sysdba
recover database using backup controlfile until cancel;
alter database open resetlogs;
--- if renaming datafile required ----
run {
SET NEWNAME FOR DATAFILE 1 TO '[new location for datafile 1]';
SET NEWNAME FOR DATAFILE 5 TO '[new location for datafile 5]';
SET NEWNAME FOR DATAFILE 15 TO '[new location for datafile 15]';
SET NEWNAME FOR TEMPFILE 1 TO '[new location for tempfile 1]';
allocate channel 'dev_0' type disk;
restore database;
SWITCH DATAFILE ALL;
release channel 'dev_0';
}
--recover database until scn 9768958369723;
recover database using backup controlfile until cancel;
alter database open resetlogs;
===========================================
--now change the dbname from orcl to testorcl
SHUTDOWN IMMEDIATE
STARTUP MOUNT
nid TARGET='sys@orcl as sysdba' DBNAME=testorcl SETNAME=YES
--instance will be shutdown automatically
vi ~/.bash_profile and change the oracle_sid=testorcl
export ORACLE_SID=testorcl
sqlplus / as sysdba
startup
============================================================
For below error please connect to sqlplus and put recover database using backup controlfile until cancel;
RMAN> recover database until scn 9773049580351;
Starting recover at 19-SEP-11
using channel ORA_DISK_1
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/app/u02/oradata/datafile/orcl/system01.dbf'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/19/2011 16:38:33
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 32675 lowscn 9773049222324 found to restore
If you get
Ora-00600: [Keltnfy-Ldminit] error while "startup nomount", please follow the below checklist
You can also get below erro
RMAN> recover database until scn 9782970702592;
Starting recover at 04-JAN-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1641 devtype=DISK
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/app/u02/oradata/datafile/orcl/system01.dbf'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/04/2012 00:33:30
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 32903 lowscn 9782970702519 found to restore
RMAN-06025: no backup of log thread 1 seq 32902 lowscn 9782970653608 found to restore
RMAN-06025: no backup of log thread 1 seq 32901 lowscn 9782586978960 found to restore
RMAN-06025: no backup of log thread 1 seq 32900 lowscn 9782586809660 found to restore
RMAN-06025: no backup of log thread 1 seq 32899 lowscn 9782586454239 found to restore
RMAN-06025: no backup of log thread 1 seq 32898 lowscn 9782586171695 found to restore
RMAN-06025: no backup of log thread 1 seq 32897 lowscn 9782585897644 found to restore
RMAN-06025: no backup of log thread 1 seq 32896 lowscn 9782506375769 found to restore
RMAN-06025: no backup of log thread 1 seq 32895 lowscn 9782506089818 found to restore
RMAN-06025: no backup of log thread 1 seq 32894 lowscn 9782505914671 found to restore
RMAN> recover database until scn 9782505914671;
ref:
Oracle Docid ID 457769.1
http://dba-oracle.com/t_rman_clone_copy_database.htm
http://toddlerdba.blogspot.com/2011/06/oracle-database-disaster-recovery-using.html
-- change the dbid using
http://download.oracle.com/docs/cd/B14117_01/server.101/b10825/dbnewid.htm
-----------
1. Be sure that your oracle user on destination host is owned by "dba" secondary group and "oinstall" primary group
other wise you will get RMAN-04005: error from target database:
ORA-01031: insufficient privileges
2. Create a password file
Steps to restoration:
---------------------
----- untar the file containing backup pieces
tar -zxvf /app/u02/oradata/full_rman_backup_190911.tar.gz
copy all archivelog (near date of full backup) to archiveloglocation
----- mount the database with control file
export ORACLE_SID=orcl
rman target / nocatalog
set dbid xxxxxxxxx
startup nomount pfile='/app/u01/oracle/product/10.2.0/db_1/dbs/initorcl.ora'
restore controlfile from '/app/u03/oradata/full_rman_backup_190911/o1_mf_s_762246924_77f5xflw_.bkp';
alter database mount;
---- check the datafile, logfile information and find the scn number
sqlplus / as sysdba
select group#, to_char(first_change#), status, archived from v$log order by FIRST_CHANGE# desc; -- find the 'current' marked scn_number 9773049580351
COLUMN NAME FORMAT a70
SELECT FILE# AS "File/Grp#", NAME FROM V$DATAFILE UNION SELECT GROUP#,MEMBER FROM V$LOGFILE;
---- finally restore the database
rman target / nocatalog
list backup;
report schema;
catalog start with '/app/u03/oradata/full_rman_backup_190911';
catalog start with '/app/u03/oradata/archivelog';
crosscheck backupset pieceno; --find available or not.
list incarnation of database;
reset database to incarnation 2; --the parent one
restore database;
sqlplus /nolog
conn /as sysdba
recover database using backup controlfile until cancel;
alter database open resetlogs;
--- if renaming datafile required ----
run {
SET NEWNAME FOR DATAFILE 1 TO '[new location for datafile 1]';
SET NEWNAME FOR DATAFILE 5 TO '[new location for datafile 5]';
SET NEWNAME FOR DATAFILE 15 TO '[new location for datafile 15]';
SET NEWNAME FOR TEMPFILE 1 TO '[new location for tempfile 1]';
allocate channel 'dev_0' type disk;
restore database;
SWITCH DATAFILE ALL;
release channel 'dev_0';
}
--recover database until scn 9768958369723;
recover database using backup controlfile until cancel;
alter database open resetlogs;
===========================================
--now change the dbname from orcl to testorcl
SHUTDOWN IMMEDIATE
STARTUP MOUNT
nid TARGET='sys@orcl as sysdba' DBNAME=testorcl SETNAME=YES
--instance will be shutdown automatically
vi ~/.bash_profile and change the oracle_sid=testorcl
export ORACLE_SID=testorcl
sqlplus / as sysdba
startup
============================================================
If you face below error just don't forget to put incarnation command above
RMAN> restore database;
Starting restore at 19-SEP-11
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/19/2011 13:04:52
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 42 found to restore
RMAN> restore database;
Starting restore at 19-SEP-11
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/19/2011 13:04:52
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 42 found to restore
For below error please connect to sqlplus and put recover database using backup controlfile until cancel;
RMAN> recover database until scn 9773049580351;
Starting recover at 19-SEP-11
using channel ORA_DISK_1
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/app/u02/oradata/datafile/orcl/system01.dbf'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/19/2011 16:38:33
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 32675 lowscn 9773049222324 found to restore
If you get
Ora-00600: [Keltnfy-Ldminit] error while "startup nomount", please follow the below checklist
$ ls -l /etc/hosts
Check if /etc/hosts file is correctly configured
-rw-r--r-- 2 root root 194 Oct 17 2006 /etc/hosts
hostname
ping `hostname`
If you have DNS setup then
$ nslookup
$ nslookup
$ nslookup
You can also get below erro
RMAN> recover database until scn 9782970702592;
Starting recover at 04-JAN-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1641 devtype=DISK
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/app/u02/oradata/datafile/orcl/system01.dbf'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/04/2012 00:33:30
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 32903 lowscn 9782970702519 found to restore
RMAN-06025: no backup of log thread 1 seq 32902 lowscn 9782970653608 found to restore
RMAN-06025: no backup of log thread 1 seq 32901 lowscn 9782586978960 found to restore
RMAN-06025: no backup of log thread 1 seq 32900 lowscn 9782586809660 found to restore
RMAN-06025: no backup of log thread 1 seq 32899 lowscn 9782586454239 found to restore
RMAN-06025: no backup of log thread 1 seq 32898 lowscn 9782586171695 found to restore
RMAN-06025: no backup of log thread 1 seq 32897 lowscn 9782585897644 found to restore
RMAN-06025: no backup of log thread 1 seq 32896 lowscn 9782506375769 found to restore
RMAN-06025: no backup of log thread 1 seq 32895 lowscn 9782506089818 found to restore
RMAN-06025: no backup of log thread 1 seq 32894 lowscn 9782505914671 found to restore
RMAN> recover database until scn 9782505914671;
ref:
Oracle Docid ID 457769.1
http://dba-oracle.com/t_rman_clone_copy_database.htm
http://toddlerdba.blogspot.com/2011/06/oracle-database-disaster-recovery-using.html
-- change the dbid using
http://download.oracle.com/docs/cd/B14117_01/server.101/b10825/dbnewid.htm
Comments
Post a Comment