11 Replies Latest reply: May 21, 2013 8:03 AM by Mahir M. Quluzade RSS

    DeInstall DataGuard db_role and dg_broker_config_file<n> parameters

    SherrieK
      Oracle 11.1.0.7 RAC with DataGurad

      We used DG to migrate our dev and acc environments to another location and are now ready to "un-DataGuard". I have a checklist to follow with these two outstanding questions:

      1) srvctl config database -d <primary> -a shows DB_ROLE: PRIMARY. Non-DataGuarded databases show this as null. I've tried srvctl modify database -d <primary> -r "" but receive the error: PRKO-2003 : Invalid command line option value: How can I change the role to NULL.

      2) We use ASM and have the parameters dg_broker_config_file1 and dg_broker_config_file2 set to +ASM_DATA/play/dataguard/dr1play.dat (also the dr2play.dat file for file2).  .  We manually created the DATAGUARD folder, turning on the broker creates a DATAGUARDCONFIG folder.  What should we do about these files? 

      Sherrie
        • 1. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
          Mahir M. Quluzade
          Hi,

          ca107207 wrote:
          Oracle 11.1.0.7 RAC with DataGurad

          We used DG to migrate our dev and acc environments to another location and are now ready to "un-DataGuard". I have a checklist to follow with these two outstanding questions:
          What is means un-DataGuard?
          Do you want create standby database for migration, then change to primary? Can I understand correct?
          1) srvctl config database -d <primary> -a shows DB_ROLE: PRIMARY.
          Non-DataGuarded databases show this as null. I've tried srvctl modify database -d <primary> -r "" but receive the error: PRKO-2003 : Invalid command line option value: How can I change the role to NULL.
          As you know database role connot be NULL, have two database role : Primary and Standby. What you want, why you are change database role to NULL?

          2) We use ASM and have the parameters dg_broker_config_file1 and dg_broker_config_file2 set to +ASM_DATA/play/dataguard/dr1play.dat (also the dr2play.dat file for file2). 
          We manually created the DATAGUARD folder, turning on the broker creates a DATAGUARDCONFIG folder. What should we do about these files?
          This config file broker manager config files. If you want safety remove data guard broker, then you must remove this files from ASM, You ca n use "asmcmd" command line tool.
          Check : http://www.mahir-quluzade.com/2012/07/oracle-data-guard-11g-how-to-safely.html


          Regards
          Mahir M. Quluzade
          • 2. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
            SherrieK
            Some clarification:

            We used Data Guard to migrate our development and acceptance environments to another site. So we had a PRIMARY at Site A, a STANDBY at Site B. Site A is being decommissioned. Meaning we have done a switchover to Site B. It is our new PRIMARY, Site A is the STANDBY only until Site A is turned off. At that time we no longer have a need for the PRIMARY to be DataGuarded as there isn't a place to have a STANDBY. Remnants of DataGuard need to be removed.

            I have a test database that has never participated in DataGuard. Its DB_ROLE from srvctl config database -d <dbname> -a is "null", so it is indeed possible to have a database without a DB_ROLE assigned. That is, one that has never had DataGuard in the first place.

            I also understand about removing the files from the DATAGUARD and DATAGUARDCONFIG folders in ASM. (We use ASM extensively). The question has to do with the dg_broker_config_file<n> parameter. An ALTER SYSTEM or ALTER DATABASE to reset this returns an error. A non-DataGuarded database always has these assigned to $ORACLE_HOME/dbs by default.

            To reiterate, what I mean by un-DataGuarding ... remove Data Guard parameters because there is no longer a standby location.

            Sherrie
            • 3. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
              mseberg
              Sherrie;


              "Remnants of DataGuard need to be removed"

              If you are not using Data Guard you can remove broker using this Oracle document:

              How to Safely Remove a Data Guard Broker Configuration [ID 261336.1]

              Data Guard parameters are documented in Data Guard Concepts and Administration 11g Release 2 (11.2) E10700-02 under:

              "3.1.4 Set Primary Database Initialization Parameters"

              Change or remove as needed.

              I'm almost positive srvctl does not have an option for NULL. Once its set to either PRIMARY, PHYSICAL_STANDBY, or LOGICAL_STANDBY it stays. Harmless.

              If it is really an issue you can try deleting and recreating. But in my opinion this is a complete waste of time.


              Best Regards

              mseberg
              • 4. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                Mahir M. Quluzade
                ca107207 wrote:
                Some clarification:

                We used Data Guard to migrate our development and acceptance environments to another site. So we had a PRIMARY at Site A, a STANDBY at Site B. Site A is being decommissioned. Meaning we have done a switchover to Site B. It is our new PRIMARY, Site A is the STANDBY only until Site A is turned off. At that time we no longer have a need for the PRIMARY to be DataGuarded as there isn't a place to have a STANDBY. Remnants of DataGuard need to be removed.
                After switchover your database on Site B, is running as primary. Now not need any change of database role. Because switchover changed already to primary, as you said.
                I have a test database that has never participated in DataGuard. Its DB_ROLE from srvctl config database -d <dbname> -a is "null", so it is indeed possible to have a database without a DB_ROLE assigned. That is, one that has never had DataGuard in the first place.
                >
                I also understand about removing the files from the DATAGUARD and DATAGUARDCONFIG folders in ASM. (We use ASM extensively). The question has to do with the dg_broker_config_file<n> parameter. An ALTER SYSTEM or ALTER DATABASE to reset this returns an error. A non-DataGuarded database always has these assigned to $ORACLE_HOME/dbs by default.

                To reiterate, what I mean by un-DataGuarding ... remove Data Guard parameters because there is no longer a standby location.
                Before turn of Site A, you must remove physical standby database from data guard configuration with DGMGRL, with remove database command.
                If you turn, it is not problem, too.
                You must change dg_broker_start parameter to FALSE
                log_archive_dest_2 to '', and remove DG BROKER Config files.
                alter system  set dg_broker_start=FALSE sid='*';
                alter system  set log_archive_dest_2='' sid='*';
                Regards
                Mahir
                • 5. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                  SherrieK
                  Mahir,

                  We're good on those points. There are 2 outstanding questions

                  srvctl has DB_ROLE as primary, while non-DataGuarded databases show DB_ROLE as null. Is this a problem? If so, how can it be changed. srvctl modify database -d <db> -r "" does not work, as it's not an accepted parameter.

                  We use dg broker and ASM, so there is the folder in ASM that we created manually DATAGUARD, and its partner the dgbroker created DATAGUARDCONFIG. This holds the .dat files from dg broker. The are identified by dg_broker_config_file1 and dg_broker_config_file2.

                  (1) How to set DB_ROLE to null in srvctl
                  (2) What to do about dg_broker_config_file1 and dg_broker_config_file2 and its ASM folders
                  • 6. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                    Mahir M. Quluzade
                    ca107207 wrote:
                    Mahir,

                    We're good on those points. There are 2 outstanding questions

                    srvctl has DB_ROLE as primary, while non-DataGuarded databases show DB_ROLE as null. Is this a problem? If so, how can it be changed. srvctl modify database -d <db> -r "" does not work, as it's not an accepted parameter.
                    We use dg broker and ASM, so there is the folder in ASM that we created manually DATAGUARD, and its partner the dgbroker created DATAGUARDCONFIG. This holds the .dat files from dg broker. The are identified by dg_broker_config_file1 and dg_broker_config_file2.

                    (1) How to set DB_ROLE to null in srvctl
                    Every databases default role is PRIMARY, you know.
                    You can not change database role to NULL. Database role can be only PRIMARY (default) , and STANDBY (physical or logical.)
                     srvctl config database -d  <your database name>
                    (2) What to do about dg_broker_config_file1 and dg_broker_config_file2 and its ASM folders
                    Connect to ASM with asmcmd. And remove this files. That all.

                    Did you check log_archive_dest_2 parameter?


                    Mahir
                    • 7. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                      SherrieK
                      My last outstanding question is srvctl, everything else I figured out.

                      Here is a snapshot of a RAC database that has never been dataguarded. As you can see, DB_ROLE is null, so the default is NULL, not PRIMARY.

                      srvctl config database -d baby -a
                      DB_NAME: baby
                      ORACLE_HOME: /oracle/OracleHomes/product/11.1/db/enterprise
                      SPFILE: +ASM_DATA/baby/spfilebaby.ora
                      DOMAIN: ad.swfwmd.net
                      DB_ROLE: null
                      START_OPTIONS: null
                      POLICY: AUTOMATIC
                      ENABLE FLAG: DB ENABLED
                      • 8. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                        Mahir M. Quluzade
                        ca107207 wrote:
                        My last outstanding question is srvctl, everything else I figured out.

                        Here is a snapshot of a RAC database that has never been dataguarded. As you can see, DB_ROLE is null, so the default is NULL, not PRIMARY.

                        srvctl config database -d baby -a
                        DB_NAME: baby
                        ORACLE_HOME: /oracle/OracleHomes/product/11.1/db/enterprise
                        SPFILE: +ASM_DATA/baby/spfilebaby.ora
                        DOMAIN: ad.swfwmd.net
                        DB_ROLE: null
                        START_OPTIONS: null
                        POLICY: AUTOMATIC
                        ENABLE FLAG: DB ENABLED
                        Did you sure your database is open?
                        [oracle@oel62-rac2 Desktop]$ srvctl config database -d racdb 
                        Database unique name: racdb
                        Database name: 
                        Oracle home: /u01/app/oracle/product/11.2.0/dbhome
                        Oracle user: oracle
                        Spfile: 
                        Domain: 
                        Start options: open
                        Stop options: immediate
                        *Database role: PRIMARY*
                        Management policy: AUTOMATIC
                        Server pools: racdb
                        Database instances: racdb1,racdb2
                        Disk Groups: DATA,FRA
                        Mount point paths: 
                        Services: 
                        Type: RAC
                        Database is administrator managed
                        Regards
                        Mahir M. Quluzade
                        • 9. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                          SherrieK
                          As a follow-up to this question, here is what we determined the answers to be:

                          dg_broker_config_file<n> in srvctl:
                          SQLPlus> alter system reset dg_broker_config_file2 scope=spfile sid='*';
                          SQLPlus> alter system reset dg_broker_config_file1 scope=spfile sid='*';

                          ASMCMD> rm -rf DATAGUARD
                          * This in turn removed the DATAGUARDCONFIG folder as well

                          db_role in srvctl
                          srvctl stop database -d <db>
                          srvctl remove database -d <db>
                          srvctl add database -d <db> -0 <$ORACLE_HOME>
                          srvctl add instance -d <db> -i <db>1 -- do this for every instance needed

                          srvctl start database -d <db>
                          Database now starts, the db_groker_config_file<n> is set back to the default and
                          srvctl config database -d <db> -a
                          Now shows that the db_role is null as expected.


                          We manually implemented DataGuard for the migration of databases to another data center. After prototyping, we came up with a run order of steps. For the deinstall of DataGuard, we mostly reversed the order of implementation, but a few things just wouldn't go away.

                          Sherrie
                          • 10. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                            Mahir M. Quluzade
                            Can you paste here ?
                             sqlplus / as sysdba
                             select database_role, name from v$database;
                            • 11. Re: DeInstall DataGuard db_role and dg_broker_config_file<n> parameters
                              Mahir M. Quluzade
                              I think you have a bug, your version is 11.1.0.7

                              I tested your steps, following results
                              [oracle@oel62-rac2 Desktop]$ srvctl config database -d racdb
                              Database unique name: racdb
                              Database name: 
                              Oracle home: /u01/app/oracle/product/11.2.0/dbhome
                              Oracle user: oracle
                              Spfile: 
                              Domain: 
                              Start options: open
                              Stop options: immediate
                              Database role: PRIMARY
                              Management policy: AUTOMATIC
                              Server pools: racdb
                              Database instances: racdb1,racdb2
                              Disk Groups: DATA,FRA
                              Mount point paths: 
                              Services: 
                              Type: RAC
                              Database is administrator managed
                              [oracle@oel62-rac2 Desktop]$ srvctl  stop database -d racdb
                              [oracle@oel62-rac2 Desktop]$ srvctl remove database -d racdb
                              Remove the database racdb? (y/[n]) y
                              [oracle@oel62-rac2 Desktop]$ srvctl add database -d racdb -o $ORACLE_HOME
                              [oracle@oel62-rac2 Desktop]$ srvctl add instance -d racdb -i racdb1 -n oel62-rac1
                              [oracle@oel62-rac2 Desktop]$ srvctl add instance -d racdb -i racdb2 -n oel62-rac2
                              [oracle@oel62-rac2 Desktop]$ srvctl config database -d racdb
                              Database unique name: racdb
                              Database name: 
                              Oracle home: /u01/app/oracle/product/11.2.0/dbhome
                              Oracle user: oracle
                              Spfile: 
                              Domain: 
                              Start options: open
                              Stop options: immediate
                              Database role: PRIMARY
                              Management policy: AUTOMATIC
                              Server pools: racdb
                              Database instances: racdb1,racdb2
                              Disk Groups: 
                              Mount point paths: 
                              Services: 
                              Type: RAC
                              Database is administrator managed
                              [oracle@oel62-rac2 Desktop]$ srvctl  start database -d racdb
                              [oracle@oel62-rac2 Desktop]$ srvctl  status database -d racdb
                              Instance racdb1 is running on node oel62-rac1
                              Instance racdb2 is running on node oel62-rac2
                              [oracle@oel62-rac2 Desktop]$ srvctl config database -d racdb
                              Database unique name: racdb
                              Database name: 
                              Oracle home: /u01/app/oracle/product/11.2.0/dbhome
                              Oracle user: oracle
                              Spfile: 
                              Domain: 
                              Start options: open
                              Stop options: immediate
                              Database role: PRIMARY
                              Management policy: AUTOMATIC
                              Server pools: racdb
                              Database instances: racdb1,racdb2
                              Disk Groups: DATA,FRA
                              Mount point paths: 
                              Services: 
                              Type: RAC
                              Database is administrator managed
                              [oracle@oel62-rac2 Desktop]$