4 Replies Latest reply: Nov 5, 2012 1:01 AM by teits RSS

    Creating logical standby from non primary backup

    972260
      We want to test creation for logical standby in our test enviroment.

      Here is the plan we are

      1. Backup Prod.
      2. Restore Test Primary (T1) and Restore test standby (T2) from Prod backup.
      3. Setup standby between T1 and T2.

      Plan is to save the time for backup and restore process. I have not doe it before. Will this process work or T2 restore needs to be done from backup of T1 as that would be primary.

      Manuj
        • 1. Re: Creating logical standby from non primary backup
          teits
          969257 wrote:
          Plan is to save the time for backup and restore process. I have not doe it before. Will this process work or T2 restore needs to be done from backup of T1 as that would be primary.

          Manuj
          the process work ;). you can use the same backup for T1 and T2.

          see http://www.datadisk.co.uk/html_docs/oracle_dg/logical_setup.htm
          http://www.sysdbaonline.com/2009/07/creating-logical-standby

          hth
          Tobi
          • 2. Re: Creating logical standby from non primary backup
            mseberg
            Hello;

            Not sure what version of Oracle so I will assume Oracle 11R2.

            The fastest way to do this is to use RMAN to create a physical Standby database. Then convert the physical Standby to a logical. You can use these notes to create a Physical Standby :

            http://www.visi.com/~mseberg/data_guard_on_oracle_11_step_by_step.html

            http://www.visi.com/~mseberg/duprman.html

            You should also check your Primary for issues with SQL Apply using this SQL :
            SELECT DISTINCT OWNER, TABLE_NAME FROM DBA_LOGSTDBY_UNSUPPORTED ORDER BY OWNER, TABLE_NAME;
            Once you have done these steps and your primary had passed the supported test you can use DBMS_LOGSTDBY.BUILD to start creating a logical form a physical.

            See Creating a Logical Standby Database ( chapter 4) of "Data Guard Concepts and Administration 11g Release 2 (11.2) E10700-02"

            http://oracle.su/docs/11g/server.112/e10700/toc.htm


            Best Regards

            mseberg
            • 3. Re: Creating logical standby from non primary backup
              972260
              Thanks Tobi.

              I will try this. The test system is very large about 16TB and the backup/restore process takes days. I just wanted to be sure if the same backup would work for creating the primary and standby at the same time.

              So in this case, I will just have to restore from backup and move forward with archivelogs. Will I have to use the control-file from Prod or from T1.
              • 4. Re: Creating logical standby from non primary backup
                teits
                969257 wrote:
                Thanks Tobi.

                I will try this. The test system is very large about 16TB and the backup/restore process takes days. I just wanted to be sure if the same backup would work for creating the primary and standby at the same time.

                So in this case, I will just have to restore from backup and move forward with archivelogs. Will I have to use the control-file from Prod or from T1.
                Use the control file from T1(test primary)
                I would like to use the backup COPY.

                General steps to follow:
                1. restore T1 as the (test)primary DB.
                2. recover/apply the T1 using the redo log.
                3. restore T2 but do not apply redo to prevent it from divergence from T1. i mean, let T2 scn be behind T1 scn.
                4. following the general steps as it apply to you in preparing and creating primary and standby DB
                http://docs.oracle.com/cd/B19306_01/server.102/b14239/create_ps.htm
                5. make sure T2 can receive and apply redo data from T1
                6.covert T2 to logical standby DB
                http://docs.oracle.com/cd/B19306_01/server.102/b14239/create_ls.htm

                HTH
                Tobi