create_standby_database

Creates a standby database generated from a backup of a primary database.

Format

emcli create_standby_database      
      -source_db_target_name="<primary database target name>"
      -source_db_target_type="oracle_database|rac_database"
      -dest_oracle_sid="<standby instance name>"
      -spname="<standby database unique name>"
      [-source_db_creds_name="<primary database credential name>"] 
      [-source_host_creds_name="<primary database host credential name>"] 
      [-dest_host_creds_name="<standby database host credential name>"]
      [-win_svc_host_creds_name="<standby database windows service host credential name>" 
      [-asm_inst_creds_name="<asm instance credential name>"] 
      [-dest_host_name="<standby host name>"] 
      [-dest_oracle_home="<standby database Oracle home>"] 
      [-dest_target_name="<standby database target name>"] 
      [-use_duplicate="Yes|No"]
      [-degree_of_parallelism="<number of parallel channels used by RMAN>"]
      [-source_staging_area="<primary staging directory>"] 
      [-storage_type="<storage type>"]
      [-multiplex_locs="<multiplex locations>"] 
      [-dest_db_database_area="<standby database files location>"] 
      [-dest_db_recovery_area="<standby database fast recovery area>"] 
      [-dest_listener_selection="<standby database listener selection>"] 
      [-dest_listener_name="<standby database listener name>"] 
      [-dest_listener_port="<standby database listener port>"] 
      [-stby_type="<standby type>"] 
      [-use_broker="Yes|No"]
      [-use_sys_dba_monitoring_creds] 
      [-dest_staging_area="<standby staging directory>"] 
      [-configure_with_oracle_restart]
      [-src_ssh_tunnel_port="<ssh tunnel port used by standby database to connect to primary database>"]
      [-dest_ssh_tunnel_port="<ssh tunnel port used by primary database to connect to standby database>"]
      [-src_gateway_creds_name="<primary database host hybrid gateway agent credential name>"]
      [-dest_gateway_creds_name="<standby database host hybrid gateway agent credential name>"]
      [-dest_GI_host_creds_name="<standby database grid infrastructure credential name>"]
      [-tde_wallet_creds_name="<transparent data encryption wallet credentials of the primary database>"]
      [-tde_wallet_location="<transparent data encryption wallet location>"]
      [-redo_transport_user_creds="<named credential for the redo transport user password>"]

[ ] indicates that the parameter is optional

Options

  • source_db_target_name

    Primary database Enterprise Manager target name. Can either be a single-instance database or a cluster database.

  • source_db_target_type

    Primary database target type. Specify oracle_database for single instance, or rac_database for a cluster database.

  • dest_oracle_sid

    Standby database instance name.

  • spname

    Standby database unique name.

  • source_db_creds_name

    Primary database named credential for a user with SYSDBA or SYSDG role. Default is to use preferred credential.

  • source_host_creds_name

    Primary database host named credential for an operating system user who can access the primary database Oracle home. Default is to use preferred credential.

  • dest_host_creds_name

    Standby database host named credential for an operating system user who can access the primary database Oracle home. Default is to use preferred credential.

  • win_svc_host_creds_name

    Windows host credentials of the Oracle Home user account under which the database services are configured.

  • asm_inst_creds_name

    Automatic Storage Management (ASM) named credential. Supported credential types are SYSDBA and SYSASM.

  • dest_host_name

    Standby database host name. Default is primary host name.

  • dest_oracle_home

    Standby database Oracle home location. Default is primary database Oracle home location.

  • dest_target_name

    Standby database Enterprise Manager target name. Default is standby database unique name.

  • use_duplicate

    Database files moved directly to clone the database host by the Recovery Manager (RMAN). Default is yes.

  • degree_of_parallelism

    Number of parallel channels used by RMAN to copy the database files. The specified value is considered only when use_duplicate is set.

    Default value is 2.

  • source_staging_area

    Staging area used to store the backup of a primary database. This option is applicable only when use_duplicate is not set.

  • storage_type

    Standby database storage type.

    • FILE_SYSTEM: Standby database files are in a regular file system.

    • ASM_STORAGE: Standby database uses Automatic Storage Management (ASM).

    Default is FILE_SYSTEM.

  • multiplex_locs

    Multiplex locations for the redo logs and control files. A maximum of five comma-separated locations can be specified.

  • dest_db_database_area

    Standby database files Oracle-managed files (OMF) location. Can be a regular file system (if storage_type is FILE_SYSTEM) or an ASM diskgroup (if storage_type is ASM_STORAGE).

  • dest_db_recovery_area

    Standby database fast recovery area.

  • dest_listener_selection

    Standby database listener selection.

    • GRID_INFRA: Uses the Grid Infrastructure Home listener.

    • DEST_DB_HOME: Uses the listener from the standby database Oracle home.

    Default is GRID_INFRA.

  • dest_listener_name

    Standby database listener name. This option is applicable only if dest_listener_selection is set to DEST_DB_HOME.

    If not specified, default value is the first existing TCP listener found in the standby database Oracle home. Note that if dest_listener_name is specified, then dest_listener_port must also be specified.

  • dest_listener_port

    Standby database listener port. This option is applicable only if dest_listener_selection is set to DEST_DB_HOME. Note that if dest_listener_port is specified, then dest_listener_name must also be specified.

  • stby_type

    Type of the standby database to be created.

    • PHYSICAL

    • LOGICAL

    Default is PHYSICAL.

  • use_broker

    Uses Data Guard broker to manage the Data Guard configuration. Default is yes.

  • use_sys_dba_monitoring_creds

    Uses SYSDBA credentials to monitor the standby database. Default is no.

  • dest_staging_area

    Staging area used to store the backup files transferred from the primary host. This option is applicable only when use_duplicate is not set.

  • configure_with_oracle_restart

    If the destination host has Oracle Restart configured, it configures the standby database with Oracle Restart. When required, Oracle Restart automatically starts the standby database. Default is no.

  • src_ssh_tunnel_port

    SSH Tunnel port used by the standby database to connect to the primary database. This is the port created on the standby host to forward the connection request to the primary database listener port.

  • dest_ssh_tunnel_port

    SSH Tunnel port used by the primary database to connect to the standby database. This is the port created on the primary host to forward the connection request to the standby database listener port.

  • src_gateway_creds_name

    Hybrid Gateway Agent named credential for the primary database host.

  • dest_gateway_creds_name

    Hybrid Gateway Agent named credential for the standby database host.

  • dest_GI_host_creds_name

    Grid Infrastructure named credentials for an operating system user who can access the grid infrastructure Oracle home.

  • tde_wallet_creds_name

    Transparent Data Encryption (TDE) wallet credentials for the primary database. Use the create_named_credential verb to create these credentials as shown below:
    emcli create_named_credential
    	-cred_name=WC1 -cred_type=GenericPassword
    	-auth_target_type='<system>'
    	-attributes="GENERIC_PASSWORD:<Primary Database TDE Wallet Password>"
  • tde_wallet_location

    Transparent Data Encryption wallet location.

    For Oracle Database versions 18c and higher: The specified path is set as the value for the WALLET_ROOT parameter of the standby database. A directory structure is created under the path specified to store the TDE wallet.

    For Oracle Database versions lower than 18c: The specified path is set in the SQLNET.ENCRYPTION_WALLET_LOCATION parameter in the SQLNET.ORA network configuration file of the standby database. Since all databases running from the standby Oracle home share this setting, the use of $ORACLE_UNQNAME in the path is recommended to ensure that each database is configured with a unique wallet. This value is automatically configured in the environment when the database is started.

  • redo_transport_user_creds
    Credentials used by an existing redo transport user.
    • Required: No
    • Default: The redo transport user will be created using a random password generated based on the password for the user specified by db_cred.
    • Scope: Both

Examples

Example 1

The following command creates a standby database with the database unique name "database1" for the primary single-instance database "database".

emcli create_standby_database
      -source_db_target_name="database"
      -source_db_target_type="oracle_database"
      -dest_oracle_sid="database1"
      -spname="database1"

Example 2

The following command creates a standby database with the database unique name "database1" for the cluster database "database". The standby database uses SYSDBA credentials for monitoring and uses Data Guard broker to manage the Data Guard configuration.

emcli create_standby_database 
	-source_db_target_name="database" 
	-source_db_target_type="rac_database" 
	-dest_oracle_sid="database1" 
	-spname="database1" 
	-use_sys_dba_monitoring_creds="Yes"

Example 3

The following command creates a standby database on the Cloud host 'cloudhost.oracle.com' reachable through a destination gateway for a primary database that is encrypted with TDE. Communication between the primary and standby databases will be established using the specified tunnel ports.

emcli create_standby_database
		-source_db_target_name="primary_database"
		-source_db_target_type="oracle_database"
		-dest_oracle_sid="database1"
		-spname="database1"
		-use_sys_dba_monitoring_creds="YES"
		-source_db_creds_name="SRC_DB_CRED"
		-use_duplicate="YES"
		-asm_inst_creds_name="ASM"
		-dest_db_database_area="DATADG"
		-dest_db_recovery_area="RECODG"
		-dest_listener_selection="DEST_DB_HOME"
		-source_host_creds_name="SRC_HOST_CREDS"
		-dest_host_creds_name="OPC_SSH_NAMED_CREDS"
		-dest_host_name="cloudhost.oracle.com"
		-dest_oracle_home="/scratch/aime/db/product/dbhome_1"
		-dest_gateway_creds_name="DEST_GATEWAY_CREDS"
		-dest_GI_host_creds_name="DEST_GRID_CREDS"
		-src_ssh_tunnel_port="4001"
		-dest_ssh_tunnel_port="4001"
		-configure_with_oracle_restart
		-tde_wallet_creds_name="WC1"

Example 4

The following command creates a standby database on the Cloud host 'cloudhost.oracle.com' reachable through a destination gateway for a primary database. Communication between the primary and standby databases will be established using the specified tunnel ports. This uses 4 parallel RMAN channels to copy the database files.

emcli create_standby_database
 -source_db_target_name="primary_database" 
 -source_db_target_type="oracle_database"
 -dest_oracle_sid="database1" 
 -spname="database1"
 -source_db_creds_name="sys_creds" 
 -source_host_creds_name="oracle_creds"
 -dest_host_creds_name="oracle_creds" 
 -dest_oracle_home="/scratch/oracle_base/product/12.1.0/dbhome_1" 
 -dest_host_name="cloudhost.oracle.com"
 -storage_type="ASM_STORAGE" 
 -asm_inst_creds_name="ASM"
 -use_sys_dba_monitoring_creds="YES" 
 -use_duplicate="YES"
 -degree_of_parallelism="4"
 -dest_db_database_area="DATADG" 
 -dest_db_recovery_area="RECODG"
 -dest_GI_host_creds_name="grid_creds" 
 -src_ssh_tunnel_port="4001"
 -dest_ssh_tunnel_port="4001" 
 -dest_gateway_creds_name="stby_gateway_creds" 
 -src_gateway_creds_name="primary_gateway_creds" 
 -configure_with_oracle_restart

Example 5

The following command creates a standby database with the database unique name "database1" for the primary database with multiplex locations for the redo logs and control files.

emcli create_standby_database 
-source_db_target_name="database" 
-source_db_target_type="oracle_database"
-dest_oracle_sid="database1"
-spname="database1"
-multiplex_locs="/scratch/oracle_base/oradata/database1/loc1,
                 /scratch/oracle_base/oradata/database1/loc2,
                 /scratch/oracle_base/fast_recovery_area/database1/loc3,
                 /scratch/oracle_base/oradata/database1/loc4,
                 /scratch/oracle_base/fast_recovery_area/database1/loc5"