3 Creating a Physical Standby Database

This chapter steps you through the manual process of creating a physical standby database in maximum performance mode using asynchronous redo transport and real-time apply, the default Oracle Data Guard configuration. It includes the following main topics:

See Also:

  • Oracle Database Administrator's Guide for information about creating and using server parameter files

  • Enterprise Manager online help system for information about using the Oracle Data Guard broker graphical user interface (GUI) to automatically create a physical standby database

  • Appendix E for information about alternative methods of creating a physical standby database that automate much of the process described in this chapter by using Oracle Recovery Manager (RMAN) and either backup based duplication or active duplication over a network

  • Oracle Data Guard Broker for information about configuring a database so that it can be managed by Oracle Data Guard broker

Note:

For the instructions given in this chapter, if you are working in a multitenant container database (CDB) environment, then see Section 3.4 for information about behavioral differences from non-CDB environments. For instance, in a CDB environment, many DBA views have analogous CDB views that you should use instead.

3.1 Preparing the Primary Database for Standby Database Creation

Before you create a standby database you must first ensure the primary database is properly configured.

Table 3-1 provides a checklist of the tasks that you perform on the primary database to prepare for physical standby database creation. There is also a reference to the section that describes the task in more detail.

Note:

Perform these preparatory tasks only once. After you complete these steps, the database is prepared to serve as the primary database for one or more standby databases.

3.1.1 Enable Forced Logging

Place the primary database in FORCE LOGGING mode. You can do this after database creation using the following SQL statement:

SQL> ALTER DATABASE FORCE LOGGING;

When you issue this statement, the primary database must at least be mounted (and it can also be open). This statement can take a considerable amount of time to complete, because it waits for all unlogged direct write I/O to finish.

See Also:

3.1.2 Configure Redo Transport Authentication

Oracle Data Guard uses Oracle Net sessions to transport redo data and control messages between the members of an Oracle Data Guard configuration. These redo transport sessions are authenticated using either the Secure Sockets Layer (SSL) protocol or a remote login password file.

SSL is used to authenticate redo transport sessions between two databases if:

  • The databases are members of the same Oracle Internet Directory (OID) enterprise domain and it allows the use of current user database links

  • The LOG_ARCHIVE_DEST_n, and FAL_SERVER database initialization parameters that correspond to the databases use Oracle Net connect descriptors configured for SSL

  • Each database has an Oracle wallet or supported hardware security module that contains a user certificate with a distinguished name (DN) that matches the DN in the OID entry for the database

If the SSL authentication requirements are not met, then each member of an Oracle Data Guard configuration must be configured to use a remote login password file and every physical standby database in the configuration must have an up-to-date copy of the password file from the primary database.

Note:

Whenever you change the login password of the redo transport user and you are using a remote login password file for authentication, you must copy the updated password file to each physical or snapshot standby database in the configuration.

If you have stored the password file in an Oracle ASM disk group at the standby database, then you must copy the updated password file from the primary database to the Oracle ASM location at the standby database. See Oracle Automatic Storage Management Administrator's Guide for information about the ASMCMD pwcopy command used to copy an Oracle ASM or database instance password file to a specified location. See Oracle Real Application Clusters Administration and Deployment Guide for information about using the srvctl utility to modify a database configuration.

See Also:

3.1.3 Configure the Primary Database to Receive Redo Data

Configure the primary database to receive redo if this is the first time a standby database is added to the configuration. By following this best practice, your primary database will be ready to quickly transition to the standby role and begin receiving redo data.

To create a standby redo log, use the SQL ALTER DATABASE ADD STANDBY LOGFILE statement. For example:

SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/oracle/dbs/slog1.rdo') SIZE 500M;
 
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/oracle/dbs/slog2.rdo') SIZE 500M;

See Section 7.2.3 for a discussion of how to determine the size of each log file and the number of log groups, as well as other background information about managing standby redo logs.

3.1.4 Set Primary Database Initialization Parameters

On the primary database, you define initialization parameters that control redo transport services while the database is in the primary role. There are additional parameters you need to add that control the receipt of the redo data and apply services when the primary database is transitioned to the standby role.

Example 3-1 shows the primary role initialization parameters that you maintain on the primary database. This example represents an Oracle Data Guard configuration with a primary database located in Chicago and one physical standby database located in Boston. The parameters shown in Example 3-1 are valid for the Chicago database when it is running in either the primary or the standby database role. The configuration examples use the names shown in the following table:

Database DB_UNIQUE_NAME Oracle Net Service Name
Primary chicago chicago
Physical standby boston boston

Example 3-1 Primary Database: Primary Role Initialization Parameters

DB_NAME=chicago
DB_UNIQUE_NAME=chicago
LOG_ARCHIVE_CONFIG='DG_CONFIG=(chicago,boston)'
CONTROL_FILES='/arch1/chicago/control1.ctl', '/arch2/chicago/control2.ctl'
LOG_ARCHIVE_DEST_1=
 'LOCATION=USE_DB_RECOVERY_FILE_DEST 
  VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
  DB_UNIQUE_NAME=chicago'
LOG_ARCHIVE_DEST_2=
 'SERVICE=boston ASYNC
  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) 
  DB_UNIQUE_NAME=boston'
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc

These parameters control how redo transport services transmit redo data to the standby system and the archiving of redo data on the local file system. Note that the example specifies asynchronous (ASYNC) network transmission to transmit redo data on the LOG_ARCHIVE_DEST_2 initialization parameter. These are the recommended settings and require standby redo log files (see Section 3.1.3, "Configure the Primary Database to Receive Redo Data").

Example 3-2 shows the additional standby role initialization parameters on the primary database. These parameters take effect when the primary database is transitioned to the standby role.

Example 3-2 Primary Database: Standby Role Initialization Parameters

FAL_SERVER=boston
DB_FILE_NAME_CONVERT='/boston/','/chicago/'
LOG_FILE_NAME_CONVERT='/boston/','/chicago/' 
STANDBY_FILE_MANAGEMENT=AUTO

Specifying the initialization parameters shown in Example 3-2 sets up the primary database to resolve gaps, converts new data file and log file path names from a new primary database, and archives the incoming redo data when this database is in the standby role. With the initialization parameters for both the primary and standby roles set as described, none of the parameters need to change after a role transition.

The following table provides a brief explanation about each parameter setting shown in Example 3-1 and Example 3-2.

Parameter Recommended Setting
DB_NAME On a primary database, specify the name used when the database was created. On a physical standby database, use the DB_NAME of the primary database.
DB_UNIQUE_NAME Specify a unique name for each database. This name stays with the database and does not change, even if the primary and standby databases reverse roles.
LOG_ARCHIVE_CONFIG The DG_CONFIG attribute of this parameter must be explicitly set on each database in an Oracle Data Guard configuration to enable full Oracle Data Guard functionality. Set DG_CONFIG to a text string that contains the DB_UNIQUE_NAME of each database in the configuration, with each name in this list separated by a comma.
CONTROL_FILES Specify the path name for the control files on the primary database. Example 3-1 shows how to do this for two control files. It is recommended that a second copy of the control file is available so an instance can be easily restarted after copying the good control file to the location of the bad control file.
LOG_ARCHIVE_DEST_n Specify where the redo data is to be archived on the primary and standby systems. In Example 3-1:
  • LOG_ARCHIVE_DEST_1 archives redo data generated by the primary database from the local online redo log files to the local archived redo log files in /arch1/chicago/.

  • LOG_ARCHIVE_DEST_2 is valid only for the primary role. This destination transmits redo data to the remote physical standby destination boston.

Note: If a fast recovery area was configured (with the DB_RECOVERY_FILE_DEST initialization parameter) and you have not explicitly configured a local archiving destination with the LOCATION attribute, Oracle Data Guard automatically uses the LOG_ARCHIVE_DEST_1 initialization parameter (if it has not already been set) as the default destination for local archiving. Also, see Chapter 17 for complete LOG_ARCHIVE_DEST_n information.

REMOTE_LOGIN_PASSWORDFILE This parameter must be set to EXCLUSIVE or SHARED if a remote login password file is used to authenticate administrative users or redo transport sessions.
LOG_ARCHIVE_FORMAT Specify the format for the archived redo log files using a thread (%t), sequence number (%s), and resetlogs ID (%r).
FAL_SERVER Specify the Oracle Net service name of the FAL server (typically this is the database running in the primary role). When the Chicago database is running in the standby role, it uses the Boston database as the FAL server from which to fetch (request) missing archived redo log files if Boston is unable to automatically send the missing log files.
DB_FILE_NAME_CONVERT Specify the path name and filename location of the standby database data files followed by the primary location. This parameter converts the path names of the primary database data files to the standby data file path names. Note that this parameter is used only to convert path names for physical standby databases. Multiple pairs of paths may be specified by this parameter.
LOG_FILE_NAME_CONVERT Specify the location of the standby database online redo log files followed by the primary location. This parameter converts the path names of the primary database log files to the path names on the standby database. Multiple pairs of paths may be specified by this parameter.
STANDBY_FILE_MANAGEMENT Set to AUTO so when data files are added to or dropped from the primary database, corresponding changes are made automatically to the standby database.

Caution:

Review the initialization parameter file for additional parameters that may need to be modified. For example, you may need to modify the dump destination parameters if the directory location on the standby database is different from those specified on the primary database.

3.1.5 Enable Archiving

If archiving is not enabled, issue the following SQL statements to put the primary database in ARCHIVELOG mode and enable automatic archiving:

SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;

See Oracle Database Administrator's Guide for information about archiving.

3.2 Step-by-Step Instructions for Creating a Physical Standby Database

This section describes the tasks you perform to create a physical standby database. It is written at a level of detail that requires you to already have a thorough understanding of the following topics:

  • Database administrator authentication

  • Database initialization parameters

  • Managing redo logs, data files, and control files

  • Managing archived redo logs

  • Fast recovery areas

  • Oracle Net configuration

Table 3-2 provides a checklist of the tasks that you perform to create a physical standby database and the database or databases on which you perform each task. There is also a reference to the section that describes the task in more detail.

3.2.1 Create a Backup Copy of the Primary Database Data Files

You can use any backup copy of the primary database to create the physical standby database, as long as you have the necessary archived redo log files to completely recover the database. Oracle recommends that you use the Recovery Manager utility (RMAN).

See Oracle Database High Availability Architecture and Best Practices for backup recommendations and Oracle Database Backup and Recovery User's Guide to perform a database backup operation.

3.2.2 Create a Control File for the Standby Database

Create the control file for the standby database, as shown in the following example (the primary database does not have to be open, but it must at least be mounted):

SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/boston.ctl';

The ALTER DATABASE command designates the database that will operate in the standby role; in this case, a database named boston.

You cannot use a single control file for both the primary and standby databases. They must each have their own file.

Note:

If a control file backup is taken on the primary and restored on a standby (or vice versa), then the location of the snapshot control file on the restored system is configured to be the default. (The default value for the snapshot control file name is platform-specific and dependent on Oracle home.) You should manually reconfigure it to the correct value using the RMAN CONFIGURE SNAPSHOT CONTROLFILE command.

3.2.3 Create a Parameter File for the Standby Database

Perform the following steps to create a parameter file for the standby database.

Step 1   Create a parameter file (PFILE) from the server parameter file (SPFILE) used by the primary database.

For example:

SQL> CREATE PFILE='/tmp/initboston.ora' FROM SPFILE;

In Section 3.2.5, you will create a server parameter file from this parameter file, after it has been modified to contain parameter values appropriate for use at the physical standby database.

Step 2   Modify the parameter values in the parameter file created in the previous step.

Although most of the initialization parameter settings in the parameter file are also appropriate for the physical standby database, some modifications must be made.

Example 3-3 shows, in bold typeface, the parameters from Example 3-1 and Example 3-2 that must be changed.

Example 3-3 Modifying Initialization Parameters for a Physical Standby Database

.
.
.
DB_NAME=chicago
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_CONFIG='DG_CONFIG=(chicago,boston)'
CONTROL_FILES='/arch1/boston/control1.ctl', '/arch2/boston/control2.ctl'
DB_FILE_NAME_CONVERT='/chicago/','/boston/'
LOG_FILE_NAME_CONVERT='/chicago/','/boston/'
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_1=
 'LOCATION=USE_DB_RECOVERY_FILE_DEST
  VALID_FOR=(ALL_LOGFILES,ALL_ROLES) 
  DB_UNIQUE_NAME=boston'
LOG_ARCHIVE_DEST_2=
 'SERVICE=chicago ASYNC
  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) 
  DB_UNIQUE_NAME=chicago'
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=chicago
.
.
.

Ensure the COMPATIBLE initialization parameter is set to the same value on both the primary and standby databases. If the values differ, redo transport services may be unable to transmit redo data from the primary database to the standby databases.

It is always a good practice to use the SHOW PARAMETERS command to verify no other parameters need to be changed.

The following table provides a brief explanation about the parameter settings shown in Example 3-3 that have different settings from the primary database.

Parameter Recommended Setting
DB_UNIQUE_NAME Specify a unique name for this database. This name stays with the database and does not change even if the primary and standby databases reverse roles.
CONTROL_FILES Specify the path name for the control files on the standby database. Example 3-3 shows how to do this for two control files. It is recommended that a second copy of the control file is available so an instance can be easily restarted after copying the good control file to the location of the bad control file.
DB_FILE_NAME_CONVERT Specify the path name and filename location of the primary database data files followed by the standby location. This parameter converts the path names of the primary database data files to the standby data file path names.
LOG_FILE_NAME_CONVERT Specify the location of the primary database online redo log files followed by the standby location. This parameter converts the path names of the primary database log files to the path names on the standby database.
LOG_ARCHIVE_DEST_n Specify where the redo data is to be archived. In Example 3-3:
  • LOG_ARCHIVE_DEST_1 archives redo data received from the primary database to archived redo log files in /arch1/boston/.

  • LOG_ARCHIVE_DEST_2 is currently ignored because this destination is valid only for the primary role. If a switchover occurs and this instance becomes the primary database, then it will transmit redo data to the remote Chicago destination.

Note: If a fast recovery area was configured (with the DB_RECOVERY_FILE_DEST initialization parameter) and you have not explicitly configured a local archiving destination with the LOCATION attribute, Oracle Data Guard automatically uses the LOG_ARCHIVE_DEST_1 initialization parameter (if it has not already been set) as the default destination for local archiving. Also, see Chapter 17 for complete information about LOG_ARCHIVE_DEST_n.

FAL_SERVER Specify the Oracle Net service name of the FAL server (typically this is the database running in the primary role). When the Boston database is running in the standby role, it uses the Chicago database as the FAL server from which to fetch (request) missing archived redo log files if Chicago is unable to automatically send the missing log files.

Caution:

Review the initialization parameter file for additional parameters that may need to be modified. For example, you may need to modify the dump destination parameters if the directory location on the standby database is different from those specified on the primary database.

3.2.4 Copy Files from the Primary System to the Standby System

Ensure that all required directories are created and use an operating system copy utility to copy the following binary files from the primary system to their correct locations on the standby system:

3.2.5 Set Up the Environment to Support the Standby Database

Perform the following steps to create a Windows-based service, create a password file, set up the Oracle Net environment, and create a SPFILE.

Step 1   Create a Windows-based service.

If the standby database will be hosted on a Windows system, use the ORADIM utility to create a Windows service. For example:

WINNT> oradim –NEW –SID boston –STARTMODE manual

The ORADIM utility automatically determines the username for which this service should be created and prompts for a password for that username (if that username needs a password). See Oracle Database Platform Guide for Microsoft Windows for more information about using the ORADIM utility.

Step 2   Copy the remote login password file from the primary database system to the standby database system

This step is optional if operating system authentication is used for administrative users and if SSL is used for redo transport authentication. If not, then copy the remote login password file from the primary database to the appropriate directory on the physical standby database system. The password file must be recopied whenever an administrative privilege (SYSDG, SYSOPER, SYSDBA, and so on) is granted or revoked, and after the password of any user with administrative privileges is changed.

If you have stored the password file in an Oracle ASM disk group at the standby database, then you must copy the updated password file from the primary database to the Oracle ASM location at the standby database. See Oracle Automatic Storage Management Administrator's Guide for information about the ASMCMD pwcopy command used to copy an Oracle ASM or database instance password file to a specified location. See Oracle Real Application Clusters Administration and Deployment Guide for information about using the srvctl utility to modify a database configuration.

Step 3   Configure listeners for the primary and standby databases.

Configure and start a listener on the standby system if one is not already configured.

See Oracle Database Net Services Administrator's Guide.

Step 4   Create Oracle Net service names.

On both the primary and standby systems, use Oracle Net Manager to create a network service name for the primary and standby databases that will be used by redo transport services. As shown in Section 3.1.4, the Net service names in this example are chicago and boston.

The Oracle Net service name must resolve to a connect descriptor that uses the same protocol, host address, port, and service that you specified when you configured the listeners for the primary and standby databases. The connect descriptor must also specify that a dedicated server be used.

See the Oracle Database Net Services Administrator's Guide for more information about service names.

Step 5   Create a server parameter file for the standby database.

On an idle standby database, use the SQL CREATE statement to create a server parameter file for the standby database from the text initialization parameter file that was edited in Step 2. For example:

SQL> CREATE SPFILE FROM PFILE='initboston.ora';
Step 6   Copy the primary database encryption wallet to the standby database system

If the primary database has a database encryption wallet, copy it to the standby database system and configure the standby database to use this wallet.

Note:

The database encryption wallet must be copied from the primary database system to each standby database system whenever the master encryption key is updated.

Encrypted data in a standby database cannot be accessed unless the standby database is configured to point to a database encryption wallet or hardware security module that contains the current master encryption key from the primary database.

See Also:

Oracle Database Advanced Security Guide for more information about Transparent Data Encryption

3.2.6 Start the Physical Standby Database

Perform the following steps to start the physical standby database and Redo Apply.

Step 1   Start the physical standby database.

On the standby database, issue the following SQL statement to start and mount the database:

SQL> STARTUP MOUNT;
Step 2   Restore the data file backup

Restore the backup of the data files taken in Section 3.2.1 and copied in Section 3.2.4 on the standby system.

Step 3   Start Redo Apply.

On the standby database, issue the following command to start Redo Apply:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE - 
> DISCONNECT FROM SESSION;

The statement includes the DISCONNECT FROM SESSION option so that Redo Apply runs in a background session. See Section 8.3, "Applying Redo Data to Physical Standby Databases" for more information.

3.2.7 Verify the Physical Standby Database Is Performing Properly

After you create the physical standby database and set up redo transport services, you may want to verify database modifications are being successfully transmitted from the primary database to the standby database.

On the standby database, query the V$MANAGED_STANDBY view to verify that redo is being transmitted from the primary database and applied to the standby database. For example:

SQL> SELECT CLIENT_PROCESS, PROCESS, THREAD#, SEQUENCE#, STATUS FROM 
V$MANAGED_STANDBY WHERE CLIENT_PROCESS='LGWR' OR PROCESS='MRP0';
 
CLIENT_PROCESS PROCESS   THREAD#    SEQUENCE#  STATUS
-------------- --------- ---------- ---------- ------------
N/A            MRP0      1          80         APPLYING_LOG
LGWR           RFS       1          80         IDLE

The query output should show one line for the primary database with a CLIENT_PROCESS of LGWR. This indicates that redo transport is functioning correctly and the primary redo thread is being sent to the standby.

Note:

If the Primary database is an Oracle RAC database, then there will be one line with a CLIENT_PROCESS of LGWR for each primary instance that is currently active.

The query output should also show one line for the MRP. If the MRP status shows APPLYING_LOG and the SEQUENCE# is equal to the sequence number currently being sent by the primary database, then the standby has resolved all gaps and is currently in real-time apply mode.

Note:

The MRP may show a SEQUENCE# older than the sequence number currently being sent from the primary. This indicates that it is applying archive log files that were sent as a gap and it has not yet caught up. Once all gaps have been resolved, the same query will show that the MRP is applying the current SEQUENCE#.

3.3 Post-Creation Steps

At this point, the physical standby database is running and can provide the maximum performance level of data protection. The following list describes additional actions you can take on the physical standby database:

  • Upgrade the data protection mode

    Chapter 6 provides information about configuring the different data protection modes.

  • Enable Flashback Database

    Flashback Database removes the need to re-create the primary database after a failover. Flashback Database enables you to return a database to its state at a time in the recent past much faster than traditional point-in-time recovery, because it does not require restoring data files from backup nor the extensive application of redo data. You can enable Flashback Database on the primary database, the standby database, or both. See Section 15.2 and Section 15.3 for scenarios showing how to use Flashback Database in an Oracle Data Guard environment. Also, see Oracle Database Backup and Recovery User's Guide for more information about Flashback Database.

3.4 Creating a Physical Standby of a CDB

You can create a physical standby of a multitenant container database (CDB) just as you can create a physical standby of a regular primary database. The following are some of the behavioral differences to be aware of when you create and use a physical standby of a CDB:

  • The database role is defined at the CDB level, not at the individual container level.

  • If you execute a switchover or failover operation, the entire CDB undergoes the role change.

  • Any DDL related to role changes must be executed in the root container because a role is associated with an entire CDB. Individual pluggable databases (PDBs) do not have their own roles.

  • In a physical standby of a CDB, the syntax of SQL statements is generally the same as for noncontainer databases. However, the effect of some statements, including the following, may be different:

    • ALTER DATABASE RECOVER MANAGED STANDBY functions only in the root container; it is not allowed in a PDB.

    • A role is associated with an entire CDB; individual PDBs do not have their own roles. Therefore, the following role change DDL associated with physical standbys affect the entire CDB:

      ALTER DATABASE SWITCHOVER TO target_db_name

      ALTER DATABASE ACTIVATE PHYSICAL STANDBY

  • The ALTER PLUGGABLE DATABASE [OPEN|CLOSE] SQL statement is supported on the standby, provided you have already opened the root container.

  • The ALTER PLUGGABLE DATABASE RECOVER statement is not supported on the standby. (Standby recovery is always at the CDB level.)

  • To administer a multitenant environment, you must have the CDB_DBA role.

  • Oracle recommends that the standby database have its own keystore.

  • In a multitenant environment, the redo must be shipped to the root container of the standby database.

    The following is an example of how to determine whether redo is being shipped to the root container. Suppose your primary database has the following settings:

    LOG_ARCHIVE_DEST_2='SERVICE=boston ASYNC VALID_FOR=(ONLINE_LOGFILES,
    PRIMARY_ROLE) DB_UNIQUE_NAME=boston'
    

    Redo is being shipped to boston. The container ID (CON_ID) for the root container is always 1, so you must make sure that the CON_ID is 1 for the service boston. To do this, check the service name in the tnsnames.ora file. For example:

    boston = (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=sales.us.example.com))
    

    The service name for boston is sales.us.example.com.

    On the standby database, query the CDB_SERVICES view to determine the CON_ID. For example:

    SQL> SELECT NAME, CON_ID FROM CDB_SERVICES;
    
    NAME                                 CON_ID
    ---------------------------------------------
    sales.us.example.com                 1
    

    The query result shows that the CON_ID for boston is 1.

See Also:

3.5 Creating a PDB in a Primary Database

This section discusses creating a PDB in a primary database, when a physical standby is being used.

In an Oracle Data Guard configuration, a PDB on a primary database is created in the same way that a PDB on a regular database is created. The steps to create a PDB on a regular database are documented in the Oracle Database Administrator's Guide. Before following those steps, note the following:

  • To specify whether the new PDB being created is included in standby CDBs, use the STANDBYS clause of the SQL CREATE PLUGGABLE DATABASE statement. Specify ALL (the default) to include the new PDB in all standby CDBs. Specify NONE to exclude the new PDB from all standby CDBs.

    When a PDB is excluded from all standby CDBs, the PDB's data files are offline and marked as unnamed on all of the standby CDBs. Any new standby CDBs that are instantiated after the PDB has been created must disable the PDB for recovery explicitly to exclude it from the standby CDB. It is possible to enable a PDB on a standby CDB after it was excluded on that standby CDB.

    Note:

    The STANDBYS clause is available starting with Oracle Database 12c Release 1 (12.1.0.2).
  • If you plan to create a PDB as a clone from a different PDB, then copy the data files that belong to the source PDB over to the standby database. (This step is not necessary in an Active Data Guard environment because the data files are copied automatically when the PDB is created on the standby database.)

  • If you plan to create a PDB from an XML file, then copy the data files specified in the XML file to the standby database.

    If your standby database has the Active Data Guard option enabled (open read only), then copy to the standby database the same set of PDB data files that will be plugged into the primary database. To minimize disruptions to managed standby recovery or database sessions running on systems that have Active Data Guard enabled, you must copy these files to the standby database before plugging in the PDB at the primary database. Ensure that the files are copied to an appropriate location where they can be found by managed standby recovery:

    • If data files reside in standard operating system file systems, then the location of the files at the standby database should be based on the value of the DB_FILE_NAME_CONVERT parameter. For more details about setting primary database initialization parameters, see Section 3.1.4

    • If data files reside in ASM, then use the ASMCMD utility to copy the files to the following location at the standby database:

      <db_create_file_dest>/<db_unique_name>/<GUID>/datafile
      

      The GUID parameter is the global unique identifier assigned to the PDB; once assigned, it does not change. To find the value of the GUID parameter, query the V$CONTAINERS view before unplugging the PDB from its original source container. The following example shows how to find the value of the GUID parameter for the PDB whose PDB container ID in the source container is 3:

      SELECT guid
        FROM V$CONTAINERS
       WHERE con_id=3;
       
      GUID
       
      D98C12257A951FC4E043B623F00A7AF5
      

      In this example, if the value of the DB_CREATE_FILE_DEST parameter is +DATAFILE and the value of the DB_UNIQUE_NAME parameter is BOSTON, then the data files should be copied to:

      +DATAFILE/BOSTON/D98C12257A951FC4E043B623F00A7AF5/datafile
      

Note that the path name of the data files on the standby database must be the same as the path name that will result when you create the PDB on the primary, unless the DB_FILE_NAME_CONVERT database initialization parameter has been configured on the standby. In that case, the path name of the data files on the standby database should be the path name on the primary with DB_FILE_NAME_CONVERT applied.

Note:

Oracle recommends that the standby database have its own keystore.

See Also: