This discussion is archived
7 Replies Latest reply: Apr 10, 2013 11:06 PM by SatishKumarSadhu RSS

Dataguard setup using hot backup files

725061 Newbie
Currently Being Moderated
Hello,
I am planning to setup dataguard using Hot backup (Not RMAN) files from the primary instance. I have a few doubt as, How shall I recover the Standby database using the archive files generated while taking hot backup of primary? Shall I directly execute the "alter database recover managed standby database" command? Will this command take care of the archives generated durring hot backup also?

Appreciate any help on the above.

DB Version:10.2.0.4

Regards.
  • 1. Re: Dataguard setup using hot backup files
    553937 Newbie
    Currently Being Moderated
    Hi , I have done this long time back (in early 2007).

    1. Take a hot backup of the primary database (begin backup, copy, end backup, then couple of switch logs so the contents of online redolog goes to the archive log)

    2.create standby controlfile on the primary instance
    'alter database create standby controlfile to '/tmp/SID_stdby.ctl'

    3. copy the standby controlfiles, database files,init.ora files (follow the instructions as per the oracle doc)
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm#SBYDB00426

    4. Hoping that you would have followed all the steps mentioned in the above document,
    (like inti.ora parameter changes - fal_server,fal_client, log_archive_dest_n,standby redo logs creation,etc)

    you would issue the following statement to start your standby database,

    SQL>startup mount pfile=initSID_stdby.ora

    SQL>alter database recover managed standby database disconnect from session;

    Now you could do a few log switches in your primary database , after sometime you would see the logs getting applied in your standby database.

    Hope it helps.

    cheers,
    sbs
  • 2. Re: Dataguard setup using hot backup files
    553937 Newbie
    Currently Being Moderated
    How shall I recover the Standby database using the archive files generated while taking hot backup of primary
    The standby controlfile created ('alter database create standby controlfile '/tmp/SID_stdby.ctl') knows these details as from which archive log it has to recover . Here fal_server and fal_client would do the job for you to fetch the log files from primary to standby . And 'alter database recover managed standby database disconnect from session ' starts the recovery process .
  • 3. Re: Dataguard setup using hot backup files
    725061 Newbie
    Currently Being Moderated
    Thanks sbs for your inputs!!

    I understand that for the archive generated durring the dataguard setup FAL_SERVER and FAL_CLIENT will take care of archive shipping.
    My concern are the archive files generated durring the Hot Backup is taken. I cannot execute the "recover database" command on the standby to apply the archives generated durring Hot backup. My question was that will the "alter database recover managed standby database disconnect from session;" take care of the archive files which were generated while taking the Hot backup? If not, please suggest how shall i proceed.

    Regards.
  • 4. Re: Dataguard setup using hot backup files
    Anurag Tibrewal Guru
    Currently Being Moderated
    Hi,

    You can manually register the archive file to the standby database after copying it to standby archive location using the below command and then you can fire your command to recover.
    ALTER DATABASE REGISTER LOGFILE file_specification 
    Regards
    Anurag Tibrewal.
  • 5. Re: Dataguard setup using hot backup files
    725061 Newbie
    Currently Being Moderated
    Thanks Anurag!!

    So the sequence of command on standby will be:
    startup nomount;
    alter database mount standby database; (Not sure how this will work as the SCN in datafile header and control file differs in Hot backup)
    ALTER DATABASE REGISTER LOGFILE file_specification;
    alter database recover managed standby database disconnect from session;

    Please correct me if i'm wrong.

    Regards.
  • 6. Re: Dataguard setup using hot backup files
    553937 Newbie
    Currently Being Moderated
    Hi,

    (Not sure how this will work as the SCN in datafile header and control file differs in Hot backup)
    Generally when i took hot backups for creating standby database purpose , I used to take only backups of the data files. After issuing end backup, I use to create the standby controlfile in the primary database which would have all the archive log file details that generated during the hot backup.
    ALTER DATABASE REGISTER LOGFILE file_specification
    I believe that the above command is required only if the controlfile created has not recorded the log files required for recovery. In that case register the logfile and issue the recovery command. If I'm correct you could find out that from standby alert log files. after issuing the recovery command it would be doing 'nothing'.

    so the sequence would be
    begin hot backup
    copy datafiles
    end hot backup
    switch log files 4 or 5 times
    create standby controlfile
    copy the standby controflile, datafile and intiSID_stdby.ora
    startup mount pfile=initSID_stdby.ora
    alter database recover managed standby database disconnect from session;

    In case if you see that recovery is not starting as the logs are not registered in the controlfile (check standby alert logs) then issue
    alter database recover managed standby database cancel;
    ALTER DATABASE REGISTER LOGFILE file_specification
    alter database recover managed standby database disconnect from session;

    cheers,
    sbs
  • 7. Re: Dataguard setup using hot backup files
    SatishKumarSadhu Newbie
    Currently Being Moderated
    Guys by using below procedure you can rebuild your data gurad by using manual hot backup.

    1) On the primary database, defer the archival of redo data .
    ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=DEFER;

    2)
    put primary database in backup mode

    copy all the datafiles from primary database to Standby database (you can copy to other location in primary server and tar&zip it and send it to stand by and unzip and untar there)
    Once you copy the datafiles to another location on primary server,you can use below command for tar and zip
    go to the copied datafiles location and issue below command
    tar cvf - .|gzip -c > /dump/backup/drdb_backup.tar.gz
    put primary database in end backup.

    3) create stabdby controlfile by using below command and send it to standby server

    alter database create standby controlfile as '/dump/drbackup/2standby.ctl'

    4) copy all generated archive logs (from the time of database begin abckup) from primary database server to standby database log_archive_dest location.

    5) on standby database once we placed all datafiles and controlfiles in place use below commands
    export ORACLE_SID=standbydb
    SQL> starup nomount;
    SQL> alter database mount standby database;
    SQL> recover standby database;
    --AUTO
    SQL> alter database open read only;
    SQL> shut immediate
    SQL> startup nomount;
    SQL> alter database mount standby database;
    SQL> alter database open read only;
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;


    6) On the primary database, issue the following statement to reenable archiving to the physical standby database:
    SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;


    Thanks & Regards,
    Satish Kumar Sadhu.

    Edited by: Satish Kumar Sadhu on Apr 10, 2013 11:05 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points