closed
resolvedHi ,
I am an Oracle DBA.
I am cloning the development database from production.
I have some dount. while cloninng the database using hot backup.
do we need to copy redo log to the target location.
I am getting an error.
I am done with the creation of control file but i have not copied the online redo log file.
do i need to do copy it manually.
Thanks in advance.
Daniesh
Daniesh,
How are you trying to clone the database? Are you using RMAN or user managed backups..And could you let us know the steps you have performed and also the error being faced by you..
You do not need the redo log for recovery. You will require only the datafiles and the archived logs. You will be required to do incomplete recovery in this case. In case you are using RMAN, you can do following
run
{
set until time "to_date('24-nov-2008 16:00:00', 'dd-mon-rrrr hh24:mi:ss')";
restore database;
recover database;
}
Hi Amit,
Thanks for the input.
I am using hot backup.
The steps which i am following is
1. alter system switch logfile;(2-3 times)
2.Taking the database in backup mode
3.copy all the datafiles from source to target server.
4.alter system switch logfile;(2-3 times)
5.alter database backup controlfile to trace;
to generate a trace of the control file
go to the udump location and copy the last trace file
make chages and generate the control file script
for e.g
copy the contents of trace file from create controifile reuse..... character set
and made some changes like inplace of reuse i write set as i am my database name is different from the source one.
save the file as create.sql
on target server:
set the sid of target db.
then conect to database using sqlplus
create the dir udump, bdump and cdump.
copy the pfile from the source database to the target database and made changes accordingly like dbname , path of controlfile as i am using different location for control file.
startup the database in nomount stage
run the script which i generated in step 5.
on sql prompt i got the result as file created.
now when i try to open the database using reset log option
alter database open resetlogs;
now i am getting an error that system01.dbf needs recovery.
when i execute the conmmand
recover database using backup controlfile until cancel;
again i am getting an error.
the error is
ORA-01110
i didnt remember the error exactly.
I have one doubt if i will not copy the online redo log then how it will get generated.
Please help me on this.
Thanks
Daniesh
Hi Amit,
please find the error below.
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF'
Thanks.
<I>I have one doubt if i will not copy the online redo log then how it will get generated.</I>
>> When you open the database with resetlogs , it will create the redo logs.
Secondly did you copy the archived logs after you ended the backup (Also had to issue switch logfile). I did a test setup and you need to issue following
SQL> recover database using BACKUP CONTROLFILE until cancel;
ORA-00279: change 542839 generated at 11/25/2008 02:38:29 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/TEST/archivelog/2008_11_
25/o1_mf_1_3_%u_.arc
ORA-00280: change 542839 for thread 1 is in sequence #3
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
You need to give the archived log name here and then say "Cancel" and open the database
/u01/app/oracle/oradata/TEST/o1_mf_1_3_4lqgzpsg_.arc
ORA-00279: change 543072 generated at 11/25/2008 02:48:54 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/TEST/archivelog/2008_11_
25/o1_mf_1_4_%u_.arc
ORA-00280: change 543072 for thread 1 is in sequence #4
ORA-00278: log file '/u01/app/oracle/oradata/TEST/o1_mf_1_3_4lqgzpsg_.arc' no
longer needed for this recovery
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/TEST/o1_mf_1_4_4lqgzsbq_.arc
ORA-00279: change 543074 generated at 11/25/2008 02:48:57 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/TEST/archivelog/2008_11_
25/o1_mf_1_5_%u_.arc
ORA-00280: change 543074 for thread 1 is in sequence #5
ORA-00278: log file '/u01/app/oracle/oradata/TEST/o1_mf_1_4_4lqgzsbq_.arc' no
longer needed for this recovery
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;
Database altered.
Hi Amit,
Thanks for the help.
What i did in my case i applied the path of online redolog files and it worked.
my database is new. client request me to create a database and suddenly asked me to clone the DEV database with PROD DB. so archive was generated in my case. becasue of this reason i applied online redolog path and then cancel
it worked!!!
Thanks.
Daniesh
Cool..nice to hear that..
Actually if you had archived the redo log, you would not have needed to give online redo log..
Also online redo log is never part of the backup strategy..
Cheers
Amit
Hi Amit,
Thanks for your time and input.
This topic has been closed to new replies.