clone database using Hot backup

Tagged: ,

  • This topic is empty.
Viewing 7 reply threads
  • Author
    Posts
    • #1881
      daniesh
      Participant

      Hi ,

      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

    • #2034
      Amit Bansal
      Keymaster

      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;

      }

    • #2035
      daniesh
      Participant

      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

    • #2036
      daniesh
      Participant

      Hi Amit,

      please find the error below.

      ORA-01194: file 1 needs more recovery to be consistent

      ORA-01110: data file 1: ‘C:ORACLEPRODUCT10.2.0ORADATAORCLSYSTEM01.DBF’

      Thanks.

    • #2037
      Amit Bansal
      Keymaster

      <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

      <br />
      SQL&gt; recover database using BACKUP CONTROLFILE until cancel;<br />
      ORA-00279: change 542839 generated at 11/25/2008 02:38:29 needed for thread 1<br />
      ORA-00289: suggestion :<br />
      /u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/TEST/archivelog/2008_11_<br />
      25/o1_mf_1_3_%u_.arc<br />
      ORA-00280: change 542839 for thread 1 is in sequence #3<br />
      <br />
      Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}<br />
      

      You need to give the archived log name here and then say “Cancel” and open the database

      <br />
      <br />
      /u01/app/oracle/oradata/TEST/o1_mf_1_3_4lqgzpsg_.arc<br />
      ORA-00279: change 543072 generated at 11/25/2008 02:48:54 needed for thread 1<br />
      ORA-00289: suggestion :<br />
      /u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/TEST/archivelog/2008_11_<br />
      25/o1_mf_1_4_%u_.arc<br />
      ORA-00280: change 543072 for thread 1 is in sequence #4<br />
      ORA-00278: log file '/u01/app/oracle/oradata/TEST/o1_mf_1_3_4lqgzpsg_.arc' no<br />
      longer needed for this recovery<br />
      <br />
      Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}<br />
      /u01/app/oracle/oradata/TEST/o1_mf_1_4_4lqgzsbq_.arc<br />
      ORA-00279: change 543074 generated at 11/25/2008 02:48:57 needed for thread 1<br />
      ORA-00289: suggestion :<br />
      /u01/app/oracle/product/10.2.0/db_1/flash_recovery_area/TEST/archivelog/2008_11_<br />
      25/o1_mf_1_5_%u_.arc<br />
      ORA-00280: change 543074 for thread 1 is in sequence #5<br />
      ORA-00278: log file '/u01/app/oracle/oradata/TEST/o1_mf_1_4_4lqgzsbq_.arc' no<br />
      longer needed for this recovery<br />
      <br />
      Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}<br />
      cancel<br />
      Media recovery cancelled.<br />
      SQL&gt; alter database open resetlogs;<br />
      <br />
      Database altered.<br />
      

    • #2038
      daniesh
      Participant

      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

    • #2039
      Amit Bansal
      Keymaster

      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

    • #2040
      daniesh
      Participant

      Hi Amit,

      Thanks for your time and input.

Viewing 7 reply threads
  • You must be logged in to reply to this topic.