4 Replies Latest reply: Jan 17, 2013 7:52 AM by oraman RSS

    Howto simulate archive log gap

    oraman
      hi all,

      I use oracle 11g active dataguard with phisical standby and dgmgrl (maximum performance mode).

      for training purposes I would like to simulate archive log gap on standby db.

      I tried this:

      on primary:
      alter system set log_archive_dest_2='' scope=both;
      alter system set log_archive_dest_state_2='defer' scope=both;

      on standby:
      ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
      shutdown immediate

      now I do a few log switches on primary - a few archive logs come up (sequence 58,59), I remove them manually, it looks now like this:
      -rw-r----- 1 oracle oinstall 18703360 14. Jan 16:19 o1_mf_1_57_8h88jtm8_.arc
      -rw-r----- 1 oracle oinstall 99328 14. Jan 16:28 o1_mf_1_60_8h8911n9_.arc
      -rw-r----- 1 oracle oinstall 19968 14. Jan 16:29 o1_mf_1_61_8h8929bt_.arc

      on standby:
      startup open read only
      alter database recover managed standby database using current logfile nodelay disconnect;

      so on primary archlogs 58,59 are not there but on standby they appear after startup:
      -rw-r----- 1 oracle oinstall 18703360 14. Jan 16:19 o1_mf_1_57_8h88jtn6_.arc
      -rw-r----- 1 oracle oinstall 146432 14. Jan 16:48 o1_mf_1_58_8h8b77vg_.arc
      -rw-r----- 1 oracle oinstall 259072 14. Jan 16:48 o1_mf_1_59_8h8b72vd_.arc
      -rw-r----- 1 oracle oinstall 99328 14. Jan 16:48 o1_mf_1_60_8h8b6y03_.arc
      -rw-r----- 1 oracle oinstall 19968 14. Jan 16:48 o1_mf_1_61_8h8b6xxw_.arc

      It looks like redo log shipment is independent from archivelogs on primary db!?

      what additional steps are required to simulate a gap?

      thanks in advance!
        • 1. Re: Howto simulate archive log gap
          mseberg
          Hello;

          Defer the remote archive destination on primary

          SQL> alter system set log_archive_dest_state_2=defer;

          Then perform several log switches on the primary.

          Option 2

          Shutdown the listener on the standby

          Option 3

          Change the password on the Primary

          Option 4

          Change the tnsnames on the primary for the standby

          Option 5

          Unplug the network cable on the standby

          Best Regards

          mseberg

          Edited by: mseberg on Jan 14, 2013 11:57 AM
          • 2. Re: Howto simulate archive log gap
            oraman
            Ok, when I break down the network connection, of course the new archivelogs are not on the standby site. however after establishing the connection they are on the standby site even when I deleted them on primary.

            It looks like dataguard is too intelligent to be fooled.

            I thought it were possible to disturb it somehow that archivelogs are copied to the standby site, so the query
            select * from v$archive_gap
            would output some rows even after reestablishing the connection.
            • 3. Re: Howto simulate archive log gap
              mseberg
              Understood.

              Have never trusted v$archive_gap

              Try this :

              http://www.visi.com/~mseberg/data_guard/monitor_data_guard_transport.html

              Another thought is to DEFER and then move the archive on the primary and see it that creates a gap.

              Best Regards

              mseberg
              • 4. Re: Howto simulate archive log gap
                oraman
                thank you it helped me a lot