create_standby_database

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

Format

emcli create_standby_database      
      -source_db_target_name="<standby 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>"] 
      [-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"]
      [-source_staging_area="<primary staging directory>"] 
      [-storage_type="<storage type>"] 
      [-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>"]

Options

  • source_db_target_name

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

  • source_db_target_type

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

  • 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.

  • asm_inst_creds_name

    ASM instance named credential.

  • 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.

  • 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.

  • 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 wallet credentials for the primary database. Use 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>"

Examples

Example 1

The following command creates a standby database with the database unique name “database1" generated from the backup of a primary single-instance database named “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" generated from the backup of a cluster database named "primary". 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="primary"
      -source_db_target_type="rac_database"
      -dest_oracle_sid="database1"
      -spname="database1"
      -use_broker="Yes"
      -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='opcst'
		-spname='opcst'
		-dest_target_name='opcst'
		-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.

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"
 -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" -use_broker="YES"