4 Replies Latest reply: Jan 10, 2013 1:29 AM by imran khan RSS

    Physical Standby OMF doubt

    imran khan
      Hi All,

      db version : 11.2.0.3.0
      os version : Red Hat Enterprise Linux Server release 5.7 (Tikanga)


      We have a physical standby with the same setup as of primary db . We dint monitor the physical standby for 3 weeks which resulted in archive log gap of 2500 logs. I tried the scenario given by Arup on the following site:
      http://arup.blogspot.com/2009/12/resolving-gaps-in-data-guard-apply.html
      But we have OMF files on the primary database. Can anyone explain me how to rebuild the physical standby in order to resolve the archive log gap if we have ASM instance(diskgroups and OMF configured) configured on both primary and standby..

      Unfortunately when I implemented Arup's scenario i failed to rebuild it and it changed whole db files paths from DISK_GROUP/standby/files.dbf to DISK_GROUP/primary/files.dbf on the standby database. After that I realized that Tom also mentioned about OMF but it was too late to implement that. Is it now possible to rebuild the standby with incremental copy of primary? or else I need to clean up all the files and build the standby from scratch.



      Regards,
      Imran Khan
        • 1. Re: Physical Standby OMF doubt
          Shivananda Rao
          Hello Imran,

          Refer this on using roll forward technique to bring in the standby database in sync with the primary.

          http://shivanandarao.wordpress.com/2012/03/26/roll-forward-physical-standby-database-using-rman-incremental-backup/

          You can rename the datafiles on the standby database.
          Refer these
          http://mahajanrishi.blogspot.in/2011/02/relocating-datafiles-in-asm-diskgroup.html
          http://www.askdbaonline.com/?p=94


          Regards,
          Shivananda
          • 2. Re: Physical Standby OMF doubt
            imran khan
            Thanks for the reply.. What if I have OMF configured on both primary and standby... for example: the path of datafiles will vary in both primary and standby.. if a datafile on primary named is DG1/pri01/datafile/dat01..<omf_format> then the standby for that file will be DG1/std01/datafile/dat01..<omf_format> ..so on .
            My doubt is whether I have to use db_file_name_convert & log_file_name_convert parameters on both or not since I have OMF configured on both primary and standby?


            Regards,
            Imran Khan
            • 3. Re: Physical Standby OMF doubt
              Shivananda Rao
              Hello,

              It is not required for you to set the db_file_name_convert and log_file_convert parameters on the standby as you are using OMF. Just make sure that the parameter STANDBY_FILE_MANAGEMENT is set to AUTO on the standby.

              Here is a brief example for you.

              Primary:
              SQL> select instance_name,database_role from v$instance,v$database;
              
              INSTANCE_NAME    DATABASE_ROLE
              ---------------- ----------------
              srprim           PRIMARY
              
              SQL> select file_name,tablespace_name from dba_data_files;
              
              FILE_NAME                                                    TABLESPACE_NAME
              ------------------------------------------------------------ ------------------------------
              +DATA/srprim/datafile/users.256.800915683                    USERS
              +DATA/srprim/datafile/undotbs1.265.800915683                 UNDOTBS1
              +DATA/srprim/datafile/sysaux.258.800915679                   SYSAUX
              +DATA/srprim/datafile/system.257.800915677                   SYSTEM
              +DATA/srprim/datafile/example.259.800915681                  EXAMPLE
              +DATA/srprim/datafile/myts.267.801678629                     MYTS
              +DATA/srprim/datafile/tbs.268.804023681                      TBS
              
              7 rows selected.
              
              SQL> alter tablespace myts add datafile size 50M;
              
              Tablespace altered.
              
              SQL> select file_name,tablespace_name from dba_data_files;
              
              FILE_NAME                                                    TABLESPACE_NAME
              ------------------------------------------------------------ ------------------------------
              +DATA/srprim/datafile/users.256.800915683                    USERS
              +DATA/srprim/datafile/undotbs1.265.800915683                 UNDOTBS1
              +DATA/srprim/datafile/sysaux.258.800915679                   SYSAUX
              +DATA/srprim/datafile/system.257.800915677                   SYSTEM
              +DATA/srprim/datafile/example.259.800915681                  EXAMPLE
              +DATA/srprim/datafile/myts.267.801678629                     MYTS
              +DATA/srprim/datafile/tbs.268.804023681                      TBS
              +DATA/srprim/datafile/myts.269.804272177                     MYTS
              
              8 rows selected.
              
              SQL> alter system switch logfile;
              
              System altered.
              
              SQL> /
              
              System altered.
              
              SQL> select max(sequence#) from v$archived_log;
              
              MAX(SEQUENCE#)
              --------------
                          88
              Standby:
              SQL> select instance_name,database_role from v$database,v$instance;
              
              INSTANCE_NAME    DATABASE_ROLE
              ---------------- ----------------
              srps             PHYSICAL STANDBY
              
              SQL> select max(sequence#) from v$archived_log where applied='YES';
              
              MAX(SEQUENCE#)
              --------------
                          88
              
              SQL> select file_name,tablespace_name from dba_data_files;
              
              FILE_NAME                                                    TABLESPACE_NAME
              ------------------------------------------------------------ ------------------------------
              +DATA_NEW/srps/datafile/users.278.804271891                  USERS
              +DATA_NEW/srps/datafile/undotbs1.276.804271883               UNDOTBS1
              +DATA_NEW/srps/datafile/sysaux.273.804271757                 SYSAUX
              +DATA_NEW/srps/datafile/system.272.804271671                 SYSTEM
              +DATA_NEW/srps/datafile/example.274.804271821                EXAMPLE
              +DATA_NEW/srps/datafile/myts.275.804271867                   MYTS
              +DATA_NEW/srps/datafile/tbs.277.804271889                    TBS
              +DATA_NEW/srps/datafile/myts.282.804272203                   MYTS
              
              8 rows selected.
              
              SQL> sho parameter standby_file
              
              NAME                                 TYPE        VALUE
              ------------------------------------ ----------- ------------------------------
              standby_file_management              string      AUTO
              SQL> sho parameter _name_convert
              
              NAME                                 TYPE        VALUE
              ------------------------------------ ----------- ------------------------------
              db_file_name_convert                 string
              log_file_name_convert                string
              Regards,
              Shivananda
              • 4. Re: Physical Standby OMF doubt
                imran khan
                I have rebuild my standby from scratch.