clone_database

Clones a database.

Format

emcli clone_database
      -source_db_name="source_database_name"
      -dest_global_dbname="global_name_of_clone_database" 
      -dest_oracle_sid="clone_database_instance_name"
      [-dest_host_name="clone_host_name"]  
      [-dest_oracle_home="clone_database_oracle_home"] 
      [-source_db_creds_name="source_database_credential_name"] 
      [-source_host_creds_name="source_database_host_credential_name"] 
      [-dest_host_creds_name="clone_database_host_credential_name"] 
      [-asm_inst_creds_name="asm_instance_credential_name"]  
      [-dest_target_name="clone_database_name"] 
      [-clone_type="clone_type"] 
      [-source_staging_area="source_staging_directory"]  
      [-dest_staging_area="clone_database_staging_directory"]  
      [-dest_storage_type="clone_database_storage_type"] 
      [-dest_database_area="clone_database_files_location"] 
      [-dest_recovery_area="clone_database_fast_recovery_area"] 
      [-dest_listener_selection="clone_database_listener_selection"] 
      [-dest_listener_name="clone_database_listener_name"]
      [-dest_listener_port="clone_database_listener_port"]
      [-configure_with_oracle_restart"] 
      [-job_name="job_name"] 
      [-job_desc="job_description"]
      [-src_ssh_tunnel_port="<ssh tunnel port used by standby to connect to primary>"]
      [-dest_ssh_tunnel_port="<ssh tunnel port used by primary to connect to standby>"]
      [-src_gateway_cred_name="<primary database host hybrid gateway agent credential name>"]
      [-dest_gateway_cred_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 source database>"]

[ ] indicates that the parameter is optional

Options

  • source_db_name

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

  • dest_global_dbname

    Clone database global database name. Usually specified as <name>.<domain>, with <name> being used for the db_unique_name and <domain> for the db_domain_name options.

  • dest_oracle_sid

    Clone database instance name.

  • dest_host_name

    Clone database host name. If not specified, the clone database is created on the same host as the source database.

  • dest_oracle_home

    Clone database Oracle home. If not specified, the Oracle Home of the source database is used.

  • source_db_creds_name

    Source database named credential.

  • source_host_creds_name

    Source database host named credential.

  • dest_host_creds_name

    Destination (clone) host named credential.

  • asm_inst_creds_name

    Automatic Storage Management (ASM) named credential.

  • dest_target_name

    Clone database Enterprise Manager target name.

  • clone_type

    Type of source database backup that will be used for cloning. Valid values are:

    • DUPLICATE — Database files are moved directly to the clone database host by the Recovery Manager (RMAN).

    • STAGING — Database files are backed-up into the staging area and moved to the clone database host through HTTP.

    • EXISTING_BACKUP — Database files are restored from existing backups to the clone database host by the Recovery Manager (RMAN).

  • pitr_date

    Clone database as of the specified date in MM/dd/yyyy hh:mm:a (Month/Date/Year Hours:Minutes:AM/PM marker) format. For example: 03/22/2014 08:25:AM. If not specified, the clone database is created as of the latest point-in-time. This option is applicable when the clone_type is EXISTING_BACKUP.

  • pitr_scn

    Clone database as of the specified System Change Number of the source database. If not specified, the clone database is created as of the latest point-in-time. This option is applicable when the clone_type is EXISTING_BACKUP.

  • encryption_mode

    Encryption mode of the existing source database backups. If not specified, the default value is NONE. This option is applicable when the clone_type is EXISTING_BACKUP. Valid values are:

    • WALLET — Backups are encrypted using Oracle Encryption Wallet.

    • PASSWORD — Backups are encrypted using a password.

    • DUAL — Backups are encrypted using both Oracle Encryption Wallet and a password.

  • backups_encryption_creds_name

    Database named credential for the encrypted backups. This option is applicable if encryption_mode is PASSWORD or DUAL.

    Note:

    this option is applicable only if the clone type is EXISTING_BACKUP and the database backups are encrypted using a password. This database credential should be created in Enterprise Manager of scope GLOBAL with the user name specified as "backup_admin".

  • tape_settings

    Media management vendor settings if the database backups are on tape. This option is applicable when clone_type is EXISTING_BACKUP.

  • db_backups_location

    The location of the backups to be transferred to the destination host. Multiple values can be specified using "," as a delimiter. This option is applicable when cloning to a different host and clone_type is EXISTING_BACKUP.

    Note:

    this option is applicable only if the clone type is EXISTING_BACKUP and the database clone occurs on a different host where the source database backups are not visible. If the backups are visible from the destination host, this option should NOT be specified.

    • It is recommended that if the size of the database backups is very large, the backups should be taken in a common location visible from the destination host.

    • If the source database backups are on ASM diskgroups, ensure that the diskgroups are mounted at the destination host as these backups are not transferred.

    • When you specify this option is specified, all of the available files at this location are transferred to a temporary staging location at the destination host.

    • You can specify multiple values for this option with comma (,) as a delimiter.

  • source_staging_area

    Staging area used to store the backup of source database. This option is applicable when clone_type is STAGING.

  • dest_staging_area

    Staging area used to store backup files transferred from source host. This option is applicable when clone_type is STAGING.

  • dest_storage_type

    Clone database storage type. Valid values are:

    • FILE_SYSTEM — Clone database files will be in a regular file system (using Oracle-managed Files).

    • ASM — The clone database will use Automatic Storage Management (ASM).

  • dest_database_area

    Oracle-managed files (OMF) location for clone database files. This can be a regular file system (if storage_type is FILE_SYSTEM) or an ASM disk group (if storage_type is ASM). If not specified, a default value is used.

  • dest_recovery_area

    Fast recovery area location. If not specified, a default value is used.

  • dest_listener_selection

    Clone database listener selection. Valid values are:

    • GRID_INFRA — Use Grid Infrastructure Home listener.

    • DEST_DB_HOME — Use the listener from the clone database Oracle Home.

  • dest_listener_name

    Clone database listener name. This option is applicable only if dest_listener_selection is DEST_DB_HOME. If not specified, the first existing TCP listener found in the clone database Oracle Home is used. If you specify this option, you must also specify dest_listener_port.

  • dest_listener_port

    Clone database listener port. This option is applicable only if dest_listener_selection is DEST_DB_HOME. If you specify this option, you must also specify dest_listener_name.

  • configure_with_oracle_restart

    Configure the clone database with Oracle Restart if the clone host has Oracle Restart configured. Oracle Restart automatically starts the database when required.

  • job_name

    Unique job name for the clone job in the Enterprise Manager repository.

  • job_desc

    Job description.

  • 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 source 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:<Source Database TDE Wallet Password>"

Example 1

emcli clone_database 
	-source_db_name="database" 
	-dest_target_name="dbClone1" 
	-dest_host_name="host1" 
	-dest_oracle_home="/ade/ngade_gct/oracle" 
	-dest_oracle_sid="dbClone1" 
	-dest_global_dbname="dbClone1" 
	-dest_listener_selection="DEST_DB_HOME" 
	-clone_type="DUPLICATE" 
	-dest_storage_type="FILE_SYSTEM" 

Example 2

emcli clone_database 
	-source_db_name="database" 
	-source_db_creds_name="NC_DBCREDS1" 
	-source_host_creds_name="NC_HOST_CREDS1" 
	-dest_host_name="host1" 
	-dest_host_creds_name="NC_HOST_CREDS2" 
	-dest_oracle_home="/u01/app/oracle/product/11.2.0/dbhome_2" 
	-dest_oracle_sid="TESTDB1" -dest_global_dbname="TESTDB1" 
	-dest_listener_selection="GRID_INFRA" 
	-clone_type="EXISTING_BACKUP" 
	-dest_storage_type="FILE_SYSTEM" 
	-db_backups_location="/oracle/dir1"

Example 3

The following command creates a clone database on the Cloud host 'cloudhost.oracle.com' for a source database that is encrypted with TDE. Communication between the source and cloned databases will be established using the specified tunnel port.

emcli clone_database 
	-source_db_name="database"
	-source_db_creds_name="NC_DBCREDS1"
	-source_host_creds_name="NC_HOST_CREDS1"
	-dest_host_name="cloudhost.oracle.com"
	-dest_host_creds_name="OPC_SSH_NAMED_CREDS"
	-dest_oracle_home="/u01/app/oracle/product/12.1.0/dbhome_2"
	-dest_oracle_sid="TESTDB1"
	-dest_global_dbname="TESTDB1"
	-dest_listener_selection="GRID_INFRA"
	-clone_type="DUPLICATE"
	-dest_storage_type="FILE_SYSTEM"
	-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'