7 Replies Latest reply: Jul 14, 2014 9:52 PM by Nip-Oracle RSS

    DG Names?

    1063846

      I haven't done since the 9i days so my memory may be off but I thought we used the same name for both databases and had them on different physical servers in different data centers. After failing over we would just make a DNS change to give the new primary host the name of the old primary host, then all apps/clients could still connect. Looking at Data Guard again now in 12c the docs I have read are using different DB names on the primary and standby, so how do apps/clients connect (seamlessly) after the fail over?

        • 1. Re: DG Names?
          BPeaslandDBA

          Looking at Data Guard again now in 12c the docs I have read are using different DB names on the primary and standby

           

          This is incorrect. The primary and the physical standby will have the same DB_NAME parameter. However, they will have different DB_UNIQUE_NAME parameters. Since the standby is a duplicate of the primary, they are the same database and have the same database name. But having two databases on the network with the same name can be confusing so they are given two different unique names.

           

          From my primary:

           

          SQL> select name from v$database;

           

           

          NAME

          ---------

          PRODDB

           

          SQL> select instance_name from v$instance;

           

           

          INSTANCE_NAME

          ----------------

          proddb

           

          From my standby:

           

          SQL> select name from v$database;

           

           

          NAME

          ---------

          PRODDB

           

           

          SQL> select instance_name from v$instance;

           

           

          INSTANCE_NAME

          ----------------

          prodsdby

           

          These get their values from the two parameters I mentioned.

           

          HTH,
          Brian

          • 2. Re: DG Names?
            1063846

            Brian thanks for the response. I mistakenly said DB name when I meant instance name.

             

            Here is one of the oracle articles I am referring to.

            "The instance name must be unique on the Standby host. In our case, you can name the Standby database "stby"."

             

             

            http://www.oracle.com/technetwork/articles/oem/havewala-odg-oem12c-1999410.html

            • 3. Re: DG Names?
              phil.sumner

              The instance name is largely irrelevant when it comes to data guard, it's the db_name that really matters.  The only limitation, as you quoted above, is that you can't have two instances with the same name on the same host.  You can call the instances the same name if they're on different hosts, no problem there.

              • 4. Re: DG Names?
                1063846

                Great, that would make failover much easier if clients and apps are still connecting to the same named instance(with a DNS change for the host), unless I am missing something there?

                • 5. Re: DG Names?
                  BPeaslandDBA

                  Brian thanks for the response. I mistakenly said DB name when I meant instance name.

                   

                   

                  That is correct, as I showed in my sample code. The database name was the same, but the instance names were different.

                   

                  Cheers,
                  Brian

                  • 6. Re: DG Names?
                    mseberg

                    Hello;

                     

                    Your tnsnames has many options:

                     

                    ernie =

                    (DESCRIPTION =

                        (ADDRESS_LIST =

                           (ADDRESS = (PROTOCOL = TCP)(HOST = primary.server)(PORT = 1521))

                           (ADDRESS = (PROTOCOL = TCP)(HOST = standby.server)(PORT = 1521))

                           )

                           (CONNECT_DATA =

                           (SERVICE_NAME = ernie)

                        )

                    )

                     

                    You can use DBMS_SERVICE.CREATE_SERVICE and a mode trigger to make transparent to your users.


                    Best Regards


                    mseberg

                    • 7. Re: DG Names?
                      Nip-Oracle

                      You can implement Client or Server Side Failover by configuring either or both of tnsnames.ora (client end)  and listener.ora ( server end).

                       

                      FAILOVER=YES is used on client side tnsnames.ora.