This discussion is archived
6 Replies Latest reply: Apr 22, 2011 9:35 AM by Dr. Paranoid RSS

How to rename the primary database instance after switchover

user5732639 Newbie
Currently Being Moderated
Hi folks,

For doing the switchover, planning to do below steps:

Logon to OEM, go to Prdinfo DB home page, select the drinfo standby database and click Switchover.

I am expecting this to complete successfully. My questions is that after the switchover completes, how should we are plan to rename the DRINFO to PRDINFO? Application would still need to know the DB its connecting to as PRDINFO and not DRINFO(after switchover). Can someone please let me know what does this require and the procedure to rename Drinfo to Prdinfo and PRdinfo to Drinfo(after switch) ?

Thanks in advance
  • 1. Re: How to rename the primary database instance after switchover
    user5732639 Newbie
    Currently Being Moderated
    Hi there,

    We are planning to do a switchover from a primary database to a single physical standby database.

    Primary DB setup PRDINFO 10.2.0.4.0
    -------------------------------------
    Type: RAC
    # nodeS: 3, say PN1, PN2, PN3



    DGMGRL> connect
    Username: sys
    Password:
    Connected.
    DGMGRL> SHOW CONFIGURATION VERBOSE

    Configuration
    Name: prdinfo
    Enabled: YES
    Protection Mode: MaxPerformance
    Fast-Start Failover: DISABLED
    Databases:
    prdinfo - Primary database
    drinfo1 - Physical standby database

    Current status for "prdinfo":
    SUCCESS


    DGMGRL> show database prdinfo

    Database
    Name: prdinfo
    Role: PRIMARY
    Enabled: YES
    Intended State: ONLINE
    Instance(s):
    prdinfo1
    prdinfo3
    prdinfo2

    Current status for "prdinfo":
    SUCCESS

    Standby setup DRINFO 10.2.0.4.0
    -----------------------------------------------
    my physical standby is a standalone on nodes DN1


    DGMGRL> show database drinfo1
    Database
    Name: drinfo1
    Role: PHYSICAL STANDBY
    Enabled: YES
    Intended State: ONLINE
    Instance(s):
    drinfo
    Current status for "drinfo1":
    SUCCESS

    I was checking this link for renaming the db instance using newid utility http://www.dba-oracle.com/t_rename_database_oracle_sid.htm

    But I am not sure if i should be following the same for a primary instance after switchover. Wouldnt this break the connection between DR and PRD? All thos settings and the redos and shipping and falserver will need to be changed? Is there a process somewhere that can help me do this without breaking anything ? :)
  • 2. Re: How to rename the primary database instance after switchover
    Dr. Paranoid Pro
    Currently Being Moderated
    You cannot rename the DB_NAME of the databases. You are supposed to have different DB_UNIQUE_NAMES/SID for each one. Your application needs to be using SERVICES to connect and you start up the services as required.

    Larry
  • 3. Re: How to rename the primary database instance after switchover
    user5732639 Newbie
    Currently Being Moderated
    Hi Larry,


    "You cannot rename the DB_NAME of the databases. "

    I think I can rename the db_name of the DRINFO database to PRDINFO after the switch using that link. At the same time time I will be making the PRDINFO to DRINFO (i.e., switching the names of the databases also). Are you saying its not recommended to do so or its not possible?

    Is there a Metalink or Oracle Doc that you can possibly point me to please ?


    "You are supposed to have different DB_UNIQUE_NAMES/SID for each one."
    Oh yeah! I forgot to update that the DRINFO after a successful switch is required to have two additional instances as PDRINFO1 PDRINFO2 PDRINFO3 on different nodes. So are you suggesting that the DB name be Drinfrp as usual and instance name be PRDINFO1 2 3 ?

    Please enlighten me! Thanks :)
  • 4. Re: How to rename the primary database instance after switchover
    Dr. Paranoid Pro
    Currently Being Moderated
    It is not supported to do that with a Data Guard configuration. Who knows what kind of havoc you will create. You should be leaving the DB_NAME and DB_UNIQUE_NAME of the Primary and the Standby as they are. Regardless of who is the Primary and who is the Standby.

    As I said before, your application should be using services to connect to the database.

    You probably could reconfigure the DB_UNIQUE_NAMES to move the SID's around but why? You are defeating the purpose of a Data Guard configuration and putting yourself at risk. Believe me, the more complexity you have for your failover situations the more errors that will occur.

    Larry
  • 5. Re: How to rename the primary database instance after switchover
    user5732639 Newbie
    Currently Being Moderated
    Hi Larry,

    why?
    The thing is that the Application will no longer be using the database PRDINFO after it is switched to Drinfo. Their applications will need to be pointing to Drinfo and theres not going to be a switchover back to the original setup. Thats the reason why I need to make Drinfo as Prdinfo after the switch. But anyways I just now noticed that the dbname is already set to prdinfo(sorry didnt notice that before, thought that was also drinfo), so changing the dbname is crossed out. I think I only need to change the instance_name parameter in the database.


    so, with the current setup in my DRINFO DB as below:

    SQL> sho parameter name

    NAME TYPE VALUE
    ------------------------------------ ----------- ------------------------------
    db_name string prdinfo
    instance_name string drinfo
    db_unique_name string drinfo1
    service_names string drinfo1
    global_names boolean FALSE



    I will have to change the instance_name from drinfo to prdinfo 1 2 3 each on a separate node and provide the application teams the tns entry, like you kindly suggested as:

    PRDINFO =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DRnode1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = DRnode2)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = DRnode3)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (FAILOVER = true)
    )
    (CONNECT_DATA =
    (SERVICE_NAME = DRINFO)
    )
    )

    Is that correct?
    I am sorry again of the questions i m asking are repetitive. Problem is that we are doing this on a live database (!) for the first time and not a test instance.
  • 6. Re: How to rename the primary database instance after switchover
    Dr. Paranoid Pro
    Currently Being Moderated
    (SERVICE_NAME = DRINFO) is a SERVICE not a SID. All you have to do is start that service with DBMS_SERVICE.START_SERVICE after the switchover or failover. You can even do this with a trigger.

    Please read this paper - http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-clientfailoverbestprac-129636.pdf

    Larry

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points