Incomplete Recover - Srt Until time - Date format [message #427000] |
Tue, 20 October 2009 09:36 |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi,
I want to do incomplete recovery of database using 'UNTIL TIME' as follows
rman> recover database until time "to_date('.........')" using backup controlfile;
Since i am using to_date command here, do I need to set NLS_DATE_FORMAT prior to it?
Also if I am needed to set NLS_DATE_FORMAT but if i haven't set it explicitly which format will be picked by RMAN?
please note that I am not using 'run' for rman.
Thanks and Regards,
Chetana
|
|
|
|
|
Re: Incomplete Recover - Srt Until time - Date format [message #427010 is a reply to message #427000] |
Tue, 20 October 2009 10:11 |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi Ebrian and Mahesh
Thanks for quick help
My original script is like as following
cp /u05/oradata/db01/backup/controlfile_backup.ctl /opt/oracle/control01.ctl
$ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/orapwdb011 password=oracle entries=10
$ORACLE_HOME/bin/sqlplus "/ as sysdba" <<EOF>>/u04/scripts/logs/DB01_clone.log
startup mount pfile=/u04/scripts/clone_from_db01/initdb01.ora
exit
$ORACLE_HOME/bin/rman target / <<EOF>>/u04/scripts/logs/DB01_clone.log
restore database force;
exit
$ORACLE_HOME/bin/sqlplus "/ as sysdba" <<EOF>> /u04/scripts/logs/DB01_clone.log
RECOVER automatic DATABASE USING BACKUP CONTROLFILE;
RECOVER DATABASE USING BACKUP CONTROLFILE until CANCEL;
CANCEL
ALTER database open RESETLOGS;
shutdown immediate;
exit
We are not restoring controlfile, In fact we are using backedup copy, must be 'alter database backup controlfile to /u05..'
Thats' why we are recovering using backup controlfile
I hope this will be the same even in case of incomplete recovery. Right?
We are copying this backup from one rac database to another on the same location, recover one node and subsequntlt clone it further for another db by recreating controlfile
Now my question is if the syntax I put in earlier mail will work?
as follows:
cp /u05/oradata/db01/backup/controlfile_backup.ctl /opt/oracle/control01.ctl
$ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/orapwdb011 password=oracle entries=10
$ORACLE_HOME/bin/sqlplus "/ as sysdba" <<EOF>>/u04/scripts/logs/DB01_clone.log
startup mount pfile=/u04/scripts/clone_from_db01/initdb01.ora
exit
$ORACLE_HOME/bin/rman target / <<EOF>>/u04/scripts/logs/DB01_clone.log
restore database force;
exit
$ORACLE_HOME/bin/sqlplus "/ as sysdba" <<EOF>> /u04/scripts/logs/DB01_clone.log
--RECOVER automatic DATABASE USING BACKUP CONTROLFILE;
--RECOVER DATABASE USING BACKUP CONTROLFILE until CANCEL;
--CANCEL
recover database until time "to_date('dd-mm-yyyy hh24:mi:ss')" using backup controlfile; --SQL
ALTER database open RESETLOGS;
shutdown immediate;
exit
Also if backup time is beyond the expected point in time of recovery, can i issue
rman>restore database until time "to_date('dd-mm-yyyy hh24:mi:ss')"
instead of 'restore database force' on RMAN before the recover using until time?
because of urgency i am unable to write script using 'run(set until time)'
Thanks and Regards,
Chetana
|
|
|
|
|
|
Re: Incomplete Recover - Srt Until time - Date format [message #427237 is a reply to message #427000] |
Wed, 21 October 2009 10:53 |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi Ebrian/ Mahesh
finally the following worked
SQL> RECOVER automatic DATABASE UNTIL TIME '2009-10-21:06:00:00' USING BACKUP CONTROLFILE;
Media recovery complete.
SQL>
SQL> ALTER database open RESETLOGS;
Database altered.
Many Thanks for your help
Thanks and Regards,
Chetana
|
|
|
|