This discussion is archived
6 Replies Latest reply: Aug 26, 2011 2:58 PM by 856156 RSS

Oracle data guard configuration for primary and standby db_name

856156 Newbie
Currently Being Moderated
I am working on configuring an active data guard for one primary DB and one standby DB. I have a few questions:

1. Can I use different db_name, db_unique_name and instance_name for primary and standby. For example: primary(db_name, db_unique_name and instance_name)=chicago. When I create standby DB with Rman backup and copy of pfile and control file from primary DB or use Grid control to create standby database. Oracle document or Grid control all keep standby db_name=chicago. Only make standby db_unique_name and instance_name=boston. Due to my application system condition, I want to make db_name=boston, not keep it as the same as primary=chicago. Is this valid configuration?


2. In primary datafiles, application system generate datafile name like this: hr_chicago_01.dbf, fn_chicago_01.dbf. When I move datafiles to standby server, if I plan to use db_name=boston for standby DB, can I rename datafiles as
hr_boston_01.dbf, fn_boston_01.dbf? In this way, datafile name match up with db_name. but I will create standby log group and members on primary and standby identically. If in future switching over, DB will not have problems.

3. If I don't use primary DB backup. Instead, I copy all datafiles, redo_log files (no control files) to standby. Then "alter database backup controlfile to trace" from promary and also " create pfile='/xxx/initSTANDBY.ora' from primary. Then modify init.ora and controlfile. Then run control.sql to bring standby DB up. After that, configure redo log shipping and apply with data guard or SQL. Is this a acceptable way to create physical standby DB?

Please advise your comments. Thanks in advance.
  • 1. Re: Oracle data guard configuration for primary and standby db_name
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    I want to make db_name=boston, not keep it as the same as primary=chicago. Is this valid configuration?
    NO. DB_NAME must be the same ("chicago") at both sites. The Standby will be using a different DB_UNIQUE_NAME (e.g. "boston") and can be using a different Instance name / SID (e.g. "boston").
    can I rename datafiles
    Yes. The database file names can be changed.
    If I don't use primary DB backup. Instead, I copy all datafiles, redo_log files (no control files) to standby
    What is the difference between the first sentence (a backup of the primary) and the second sentence (a copy of the primary) ? A Copy is a backup.
    Are you intending to differentiate between an RMAN Backup and a User-Managed (aka "scripted") backup ?
    Normally, for DataGuard, tou can use non-RMAN methods to copy the database but there's no value add in this.
    You'd still have to setup DataGuard ! (and I wonder if you'd have complications setting up Active DataGuard).
    But remember that you MUST create the Standby controlfile from the Primary and copy it over to your Standby -- particularly as you are planning to use DataGuard. This is not created by 'alter database backup controlfile to trace' , but by 'ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'filename''


    Hemant K Chitale
  • 2. Re: Oracle data guard configuration for primary and standby db_name
    856156 Newbie
    Currently Being Moderated
    Thanks so much for your advice.

    1. I am basically having the same view as you that db_name should be the same in data guard configuration. Oracle documentation and Grid control all use the same db_name. However, my application person asked me to use different db_name on primary and standby because they think that will benefit them to coonect to database. If we need to use the same db_name on both primary and standby, what is technical reason or mechanism? If using the different db_name in configuration, what is the consequence? Wii this affect data guard function?

    2. You are right about backup and copy. What I mean here is: one is using Rman backup files and another one is directly copying all datafiles, online redo log files from primary to standby. Then using pfile and control file.
    Why do I mention "alter database backup controlfile to trace". This will generate a create control file script. I can edit this file such as change all datafile's name. Then do " startup mount .... " to create control file and startup standby database. If using "alter database create standby controlfile as filename", I couldn't edit the file. Of course, this code will generate a usable controlfile right away.

    Anyway, I appreciate your input because all of them are correct. I will follow your direction to configure my two databases.
  • 3. Re: Oracle data guard configuration for primary and standby db_name
    856156 Newbie
    Currently Being Moderated
    Thanks so much for your advice.

    1. I am basically having the same view as you that db_name should be the same in data guard configuration. Oracle documentation and Grid control all use the same db_name. However, my application person asked me to use different db_name on primary and standby because they think that will benefit them to coonect to database. If we need to use the same db_name on both primary and standby, what is technical reason or mechanism? If using the different db_name in configuration, what is the consequence? Wii this affect data guard function?

    2. You are right about backup and copy. What I mean here is: one is using Rman backup files and another one is directly copying all datafiles, online redo log files from primary to standby. Then using pfile and control file.
    Why do I mention "alter database backup controlfile to trace". This will generate a create control file script. I can edit this file such as change all datafile's name. Then do " startup mount .... " to create control file and startup standby database. If using "alter database create standby controlfile as filename", I couldn't edit the file. Of course, this code will generate a usable controlfile right away.

    Anyway, I appreciate your input because all of them are correct. I will follow your direction to configure my two databases.
  • 4. Re: Oracle data guard configuration for primary and standby db_name
    856156 Newbie
    Currently Being Moderated
    Thanks so much for your advice.

    1. I am basically having the same view as you that db_name should be the same in data guard configuration. Oracle documentation and Grid control all use the same db_name. However, my application person asked me to use different db_name on primary and standby because they think that will benefit them to coonect to database. If we need to use the same db_name on both primary and standby, what is technical reason or mechanism? If using the different db_name in configuration, what is the consequence? Wii this affect data guard function?

    2. You are right about backup and copy. What I mean here is: one is using Rman backup files and another one is directly copying all datafiles, online redo log files from primary to standby. Then using pfile and control file.
    Why do I mention "alter database backup controlfile to trace". This will generate a create control file script. I can edit this file such as change all datafile's name. Then do " startup mount .... " to create control file and startup standby database. If using "alter database create standby controlfile as filename", I couldn't edit the file. Of course, this code will generate a usable controlfile right away.

    Anyway, I appreciate your input because all of them are correct. I will follow your direction to configure my two databases.
  • 5. Re: Oracle data guard configuration for primary and standby db_name
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    1. Oracle uses DB_NAME (which is also hardcoded into each datafile header !) to identify that the datafiles are part of the same database and can be recovered using ArchiveLogs for the same database.


    2. Even if you use non-RMAN methods to copy the datafiles you still need a STANDBY controfile . A controlfile created by CREATE CONTROLFILE is not a STANDBY controlfile (Oracle maintains flags in the controlfile to identify the type of controfile, current, backup, standby). You can ALTER DATABASE MOUNT STANDBY DATABASE and then run ALTER DATABASE RENAME FILE 'chicago' TO 'boston' for each of the datafiles to update the controlfile. Oracle matches the datafiles by FILE_ID, so it will use the FILE_ID in the datafile header to apply redo (thus "chicagosystem.dbf" has FILE_ID 0 and "bostonsystem.dbf" also has FILE_ID 0)


    Hemant K Chitale
  • 6. Re: Oracle data guard configuration for primary and standby db_name
    856156 Newbie
    Currently Being Moderated
    You pointed out a very important thing: Oracle uses DB_NAME (which is also hardcoded into each datafile header !) to identify that the datafiles are part of the same database and can be recovered using ArchiveLogs for the same database. This really help me to convince my application people that we have to use the same DB_NAME in data guard configuration. Thank you so much.

Legend

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