16 Hybrid Solution: Oracle Cloud Infrastructure Management

This chapter contains the following sections:

16.1 Hybrid Cloud Cloning Overview

While managing the IT infrastructure of your enterprise, your Oracle Cloud applications may need to utilize and analyze data stored on-premise. In such a situation, you may need to migrate the data stored on-premise to Oracle Cloud.

Hybrid Cloud management enables you to monitor certain Oracle Cloud targets using an on-premise Cloud Control monitored by Enterprise Manager. The new cloning wizards leverage Hybrid Cloud management and enable you to clone an on-premise database, schema, or a PDB to a database or a PDB that is deployed in Oracle Cloud. Effectively, this enables you to copy or migrate your on-premise data to Oracle Public Cloud.

Additionally, you can also clone databases, schemas, or PDBs that are deployed in Oracle Cloud to a database or PDB that is deployed on-premise, as well as clone databases and PDBs within Oracle Cloud.

16.2 Cloning in Hybrid Cloud Use Cases

The following table lists the use cases covered when cloning in Hybrid Cloud:

Table 16-1 Cloning in Hybrid Cloud Use Cases

Cloning Use case Cloning Solutions

Clone to Oracle Cloud

Clone to Oracle Cloud Using OSS

Cloning to Oracle Cloud Using Oracle Storage Service

Clone from Oracle Cloud

Clone Within Oracle Cloud

16.3 Prerequisites for Cloning in Oracle Cloud

The following are the prerequisites for cloning in Oracle Cloud:

  • The on-premise Cloud Control instance must have the latest patches applied from MOS (Doc ID 1549855.1)

  • If you are cloning a database to Oracle Cloud, you must ensure that a Management Agent has been deployed on the destination host. Also, the destination target must be discovered.

    Note:

    If you do not have Internet access, the Management Agent must be configured in Hybrid Mode. For details on configuring the Management Agent in hybrid mode and deploying it on an Oracle Cloud target, see the Enabling Hybrid Cloud Management in the Oracle Enterprise Manager Cloud Administrator’s Guide.
  • Cloning is supported only if Oracle Software Library is not configured with an upload location of the OMS Agent storage type.

  • It is recommended that you use a Test Master database or a Test Master pluggable database for cloning to Oracle Cloud.

    To create a Test Master database, refer to the Oracle Enterprise Manager Cloud Administration Guide.

    To create a Test Master pluggable database, refer to the Oracle Enterprise Manager Cloud Administration Guide.

  • The on-premise database and the database on Oracle Cloud should not be encrypted, should possess the same character set, and should have the same patch set level.

  • When cloning from on-premise to Oracle Cloud, the SELINUX security policy must set to permissive. If the security policy is enforced or set to enforcing, the cloning procedure may fail in the SecureCopyFiles step in the non-advanced wizard mode. You will need to configure the SELinux to allow RSYNC from the Agent (script).

16.4 Cloning to Oracle Cloud

To clone a database, schema(s), or a pluggable database from on-premise to Oracle Cloud, refer to the following use cases:

16.4.1 Cloning a DB to Oracle Cloud (Oracle Compute Service)

You can clone an on-premise database using one of the following options:

This figure shows how data is transferred between the on-premise host and Oracle Cloud.

Figure 16-1 Cloning a Database to Oracle Cloud


Cloning a Database to Oracle Cloud

16.4.1.1 Cloning a DB to Oracle Cloud Using the Clone Wizard

You can create a full clone of an on-premise database from Enterprise Manager to Oracle Public Cloud. While cloning a database instance, you can optionally choose to clone the Oracle Home. This allows you to move your on-premise database to Oracle Public Cloud. To clone an on-premise database to cloud, follow these steps:

  1. From the Targets menu, select Databases.
  2. For View, select Search List. From the View menu, select Expand All.
  3. Select the database to be cloned and right click the mouse button.
  4. From the Oracle Database menu, select Cloning, then select Clone to Oracle Cloud.
  5. On the Source and Destination: Clone to Oracle Cloud page, do the following:
    • In the Source Credentials section, specify or search and select the database and Oracle Home credentials. If the source database is encrypted, specify the Wallet Password. Click OK.

      Note:

      If the source database is present on a hybrid gateway, the backups and oracle home binaries can be directly be transferred to the Oracle Public Cloud machine. If the source database is present on any other host machine, the Hybrid Gateway details must be specified in this page.
    • In the Data Time Series section, the Prior Point in Time option is selected by default and a timeline of RMAN Backup images appear. Select the appropriate RMAN backup by clicking Select on the image.

    • In the Source Backup Location field, the location of the source backup you have selected appears.

    • In the Destination section, in the Clone to field, the Select Compute Cloud Service is selected by default. This indicates that you are requesting resources on Oracle Public Cloud to clone your on-premise database.

    • In the Database Definition section, specify the Display Name for the database, the Global Database Name, SID.

    • In the Hosts section, you can choose:

      • Clone Oracle Home: If the Oracle Home is not pre-installed on the Oracle Public Cloud machine on which the database is being cloned, select the Clone Oracle Home option.

      • Use an Existing Home: If the Oracle Home is already cloned, select the Use an Existing Home option

    • If you select the Clone Oracle Home option, select the Oracle Public Cloud host machine on which the Oracle Home is to be provisioned. The Shape (size) of the Oracle Public Cloud machine and the Site (Oracle Cloud) is displayed. Specify the following:

      • Database Host Credentials: Specify the database host credentials.

        Note:

        The credentials for accessing the Oracle Public Cloud machine must be SSH key based credentials.
      • Run root scripts that require root privileges: You can either specify the root credentials or choose to enter them later to run the root scripts.

        In the Stage Location field, the location on the Oracle Public Cloud machine where the backups will be staged before cloning is displayed.

    • If you select the Use an Existing Home option, specify the following:

      • Oracle Home Location: Select the location of the Oracle Home on an Oracle Public Cloud machine already managed in Enterprise Manager. The host name of the machine in which the Oracle Home is present is displayed.

      • Database Host Credentials: Specify the database host credentials.

        In the Stage Location field, the location on the Oracle Public Cloud machine where the backups will be staged before cloning is displayed.

      Note:

      All credentials specified for the Oracle Public Cloud machine must be SSH credentials.
    • Hybrid Gateway Server: Specify the host name and credentials for the Hybrid Gateway Server (configured Enterprise Manager Management Agent) which transfers data from Enterprise Manager to Oracle Public Cloud.

      Data is first transferred to the stage location on the Hybrid Gateway Server and then copied to the Oracle Public Cloud host. This stage location (/tmp by default) must contain enough space to store the backups and binaries.

  6. Click Next. The Configuration page appears. Specify the following details:
    • Software Location: Specify the Oracle Base and Oracle Home location where the database is to be cloned.

    • Oracle Database User Groups: Specify the name of the Oracle Database User Group performing this cloning operation.

    • Database Files Location: Specify the location where you want the data files, temp files, redo log files, and control files to be created.

    • Recovery Files Location: Specify the location where you want the recovery files, such as archived redo logs, RMAN backups, and other related files to be created. You can choose to use the fast recovery area. If you do, specify the fast recovery area size. In the Database Mode section, you can enable Read Only.

    • Listener Configuration: In the Hosts section on the previous page, if you have selected:

      • Clone Oracle Home: Specify the Listener Name and Port to create a new listener with which the database will be registered.

      • Use an Existing Home: Select the listener targets running under the new Oracle Home, to register the clone database, You can add new listeners by clicking Add, and specifying the listener name and port.

    • Database Credentials: Specify passwords for the SYS, SYSTEM, and DBSNMP administrative users in the clone database. You can choose to have the same password for all the three users or a different password for each.

    • Transparent Data Encryption: If the source database is encrypted, specify the location in which the Wallet is to be placed on the Oracle Public Host machine. Select the Use same password as source checkbox to use the same password as the host database. Select the Reset/Regenerate the Master Encryption Key to reset the encryption key.

    • Parallelism: Setting a higher Degree of Parallelism will ensure faster recompilation of objects. The default setting is the number of CPU count of the host. Click Next.

  7. On the Initialization Parameters page, you can configure the values of various initialization parameters that affect the operation of the database instance. Select the parameter and click Edit to modify the value of the parameter. Click Next.
  8. On the Post Processing page, you can select masking rules, subsetting rules, or custom scripts such as pre script, post script, and post SQL script. Click Next.
  9. On the Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

  10. On the Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Submit to launch the procedure to clone the database, transfer the selected backups to the destination host via the hybrid gateway. Once cloned, this database can be managed as an Enterprise Manager target.

    To refresh the cloned database, from the Oracle Database menu, select Cloning, then select Clone Management. On the Clone Management Dashboard, select the database and click Refresh. Accept the default values in the wizard and optionally change the Initialization Parameters and Configuration details and click Refresh to refresh he database

16.4.1.2 Cloning a DB to Oracle Cloud Using EMCLI

To clone a database to Oracle Cloud using EMCLI, enter the following command:

emcli db_clone_management -cloneToCloud -input_file=data:/xyz/sdf/clone2cloud.props

where clone2cloud.propsis the properties file which provides the cloning parameters and their values.

Sample Properties File

#------------------------------------------------------------#
#                   Source Details
#------------------------------------------------------------#
SRC_DB_TARGET_NAME=dbprod.xyz.com
SRC_DB_TARGET_TYPE=database1
SRC_HOST_NORMAL_NAMED_CRED=SRCHOSTCRED:SYSMAN
SRC_DB_CRED=DBPROD_CRED:SYSMAN
SRC_WORK_DIR=/tmp
PROFILE_INTERNAL_PATH=Database Provisioning Profiles/11.2.0.4.0/linux_x64/Database db11.us.xyz.com Profile 22-02-2016 05:13 PM
PROFILE_VERSION_URN=oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DatabaseConfigProfile:2C5B357D5FF67E2AE053F17CB10A53F1:0.1
SOURCE_BACKUP_LOCATION=/scratch/dbprod/app/dbprod/fast_recovery_area/backup1456141446021

#------------------------------------------------------------#
#           Hybrid Gateway Details
#------------------------------------------------------------#
FORWARDER_HOST=slc04wim.us.oracle.com
FORWARDER_HOST_CREDS=HOST:SYSMAN
FORWARDER_STAGE_LOCATION=/scratch/fwd

#------------------------------------------------------------#
# Destination Details
#------------------------------------------------------------#
TARGET_HOST_LIST=129.124.22.34
HOST_NORMAL_NAMED_CRED=OPC_CRED:SYSMAN
HOST_PRIV_NAMED_CRED=HOST_CRED_ROOT:SYSMAN
DEST_LOCATION=/u03/backup
DEST_WORK_DIR=/tmp
#------------------------------------------------------------#
# Database Definition
#------------------------------------------------------------#
COMMON_DB_SID=Dcln1
COMMON_DOMAIN_NAME=us.xyz.com
COMMON_GLOBAL_DB_NAME=Dcln1.xyz.com
DATABASE_TYPE=dbTypeSI
DB_ADMIN_PASSWORD_SAME=true
DATABASE_PASSWORDS=welcome1

#------------------------------------------------------------#
# Software Configuration
#------------------------------------------------------------#
CLONE_HOME=Y   # mention it as N if only database cloning is required
#All these below parameters are only required if a new oracle home provisioning needs to be done. 
OINSTALL_GROUP=dba
OSBACKUPDBA_GROUP=dba
OSDBA_GROUP=dba
OSDGDBA_GROUP=opc
OSKMDBA_GROUP=opc
OSOPER_GROUP=opc
ORACLE_BASE_LOC=/u03/home/app/base
ORACLE_HOME_LOC=/u03/home/app/base/product/11.2.0/dbhome_1


#------------------------------------------------------------#
# Database Configuration
#------------------------------------------------------------#
ARCHIVE_LOG_MODE=YES
DB_FILE_LOC=/u03/home/oradata
DB_TARGET_DISPLAY_NAME=Dcln1
DB_TARGET_NAME=Dcln1.xyz.com
FLASH_REC_AREA=/u03/home/app/home/fast_recovery_area
FLASH_REC_AREA_SIZE=4182
LISTENER_PORT=2887
#Only needed if we are provisioning a new home
LISTENER_NAME=LIST_2887

#--------------------------------------------------------------#
# Data file transfer configuration parameters
#--------------------------------------------------------------#
# This will be moved to emctl metadata. for now its a variable in DP
NUMBER_OF_THREADS=10
# This will be moved to emctl metadata. for now its a variable in DP
# The chunk size in bytes. For now default is 250MB
MIN_CHUNK_SIZE=262144000
#Transfer Unit can be FILE or CHUNK
TRANSFER_UNIT=FILE
#Maximum speed in Kbps
BANDWIDTH_LIMIT=2048
#Time out in seconds for data transfer
TIME_OUT=1200

#----------------------------------------------------------------#
#    Wallet Configuration
#----------------------------------------------------------------#
DEST_PATH_TO_WALLET=/u03/wallet
WALLET_PASSWORD=Welcome123
NEW_WALLET_PASSWORD=welcome1
REKEY_REQUIRED=true

16.4.2 Cloning a PDB to Oracle Cloud

To clone an on-premise PDB to a PDB on Oracle Cloud, you can use either of the following solutions:

16.4.2.1 Cloning a PDB to Oracle Cloud Using the Clone Wizard

To clone a PDB to a CDB deployed in Oracle Cloud, follow these steps:

  1. From the Targets menu, select Databases.
  2. For View, select Search List. From the View menu, select Expand All.
  3. Look for the source CDB (the CDB that the source PDB is a part of) in the list, then click the name of the PDB that you want to clone.
  4. From the Oracle Database menu, select Cloning, then select Clone to Oracle Cloud.

    Alternatively, in Step 3, you can right click the name of the PDB that you want to clone, select Oracle Database, select Cloning, then select Clone to Oracle Cloud.

  5. On the Source and Destination: Clone to Oracle Cloud page, do the following:
    • In the Credentials section, specify the SYSDBA credentials for the source CDB, and the host credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Pluggable Database Definition section, specify a name, and a display name for the PDB clone. Enterprise Manager uses the display name to identify the PDB clone target.

    • In the PDB Administrator Credentials section, specify the credentials of the Admin user account that you want to use to administer the PDB clone.

    • In the Container Database section, specify the destination CDB that is deployed in Oracle Cloud (the CDB that the PDB clone must be a part of).

    • In the Credentials section, specify the SYSDBA credentials for the destination CDB, and the host credentials for the destination CDB.

  6. If you do not need to specify anymore details, click Clone. This submits the deployment procedure to clone a PDB to a CDB that is deployed in Oracle Cloud.

    To specify other configuration details, mask data, as well as schedule the cloning process, click Advanced.

    Follow the rest of the steps, if you have selected the Advanced option.

  7. On the Clone to Oracle Cloud: Source and Destination page, verify the details, and then click Next.
  8. On the Clone to Oracle Cloud: Configuration page, in the Database Files Location section, specify the storage location where the datafiles of the PDB clone must be stored.

    In the Advanced Configuration section, specify the storage limits for the maximum size of the PDB clone, and the maximum size of a shared table space within the PDB clone. By default, no limits are placed on the values for these attributes.

    In the Miscellaneous section, select the logging option that you want to use for the table spaces created within the PDB clone.

    Click Next.

  9. On the Clone to Oracle Cloud: Post Processing page, in the Data Masking section, specify the data masking definition that you want to apply after cloning the PDB. Data masking masks sensitive data in a database.

    For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before cloning, and after cloning the PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after cloning the PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

    Click Next.

  10. On the Clone to Oracle Cloud: Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive email notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

  11. On the Clone to Oracle Cloud: Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to clone a PDB to a CDB that is deployed in Oracle Cloud.

16.4.2.2 Cloning a PDB to Oracle Cloud Using EM CLI

You can clone an on-premise pluggable database to Oracle Cloud. Before you proceed with the EM CLI command, it is recommended that you create a Test Master of the on-premise PDB and use the Test Master to create a clone. This is recommended so as to mask the data before it can be transferred over the internet.

To clone an on-premise pluggable database to Oracle Cloud, enter the EM CLI verb emcli pdb_clone_management -input_file=data:/xyz/sdf/pdb_clone.props -cloneToOracleCloud, where pdb_clone.props is the properties file which provides the cloning parameters and their values.

There are three methods in which you can clone a pluggable database. The difference between each of these methods is in the configuration of certain parameters in the properties file. The 3 methods and the details of the configuration parameters are explained below:

  • Operating System (OS) Image backup

    Takes a backup of the source PDB and creates a new PDB. The BACKUP_TYPE parameter should specify the type of backup. The allowed values for BACKUP_TYPE are OSIMAGE, RMAN and TAR. The EXISTING_BACKUP and EXISTING_BACKUP_METADATA parameters should not be provided.

    Sample properties file:

    SRC_PDB_TARGET=cdb_prod_PDB
    SRC_HOST_CREDS=NC_HOST_SCY:SYCO
    SRC_CDB_CREDS=NC_HOST_SYC:SYCO
    SRC_WORK_DIR=/tmp/source
    DEST_HOST_CREDS=NC_SLCO_SSH:SYS
    DEST_LOCATION=/scratch/sray/app/sray/cdb_tm/HR_TM_PDB6
    DEST_CDB_TARGET=cdb_tm
    DEST_CDB_TYPE=oracle_database
    DEST_CDB_CREDS=NC_HOST_SYC:SYCO
    DEST_PDB_NAME=HR_TM_PDB6
    BACKUP_TYPE=OSIMAGE
    
  • Existing backup

    Uses an existing backup of the source PDB and creates a new PDB. The BACKUP_TYPE parameter should specify the type of backup. The allowed values for BACKUP_TYPE are OSIMAGE, RMAN and TAR. The EXISTING_BACKUP parameter should specify the location with the backup name and EXISTING_BACKUP_METADATA should specify the location and the metadata file name for the backup.

    Sample properties file:

    SRC_PDB_TARGET=cdb_prod_PDB
    SRC_HOST_CREDS=NC_HOST_SCY:SYCO
    SRC_CDB_CREDS=NC_HOST_SYC:SYCO
    SRC_WORK_DIR=/tmp/source
    DEST_HOST_CREDS=NC_SLCO_SSH:SYS
    DEST_LOCATION=/scratch/sray/app/sray/cdb_tm/HR_TM_PDB6
    DEST_CDB_TARGET=cdb_tm
    DEST_CDB_TYPE=oracle_database
    DEST_CDB_CREDS=NC_HOST_SYC:SYCO
    DEST_PDB_NAME=HR_TM_PDB6
    EXISTING_BACKUP=/user1/pdbbackup/PDB1_Backup_14297779
    EXISTING_BACKUP_METADATA=/user1/pdbbackup/PDB1_Backup_14297779/PDB1.xml
    BACKUP_TYPE=RMAN
    

    Note:

    To create a PDB backup, enter the verb emcli pdb_backup -inputFile="loaction of file containing properties required for taking backup of PDB", where the sample contents of the properties file is as follows:

    TARGET_HOST_LIST=xyz.abccorp.com
    HOST_NORMAL_NAMED_CRED=XYZ_CRED:CRED_OWNER
    SRC_CDB_NAMED_CRED=CDB1_CRED:CRED_OWNER
    SRC_CDB_TARGET_NAME=CDB1
    SRC_CDB_TARGET_TYPE=oracle_database
    SRC_PDB_TARGET_NAME=CDB1_PDB1
    BACKUP_LOCATION=/user1/pdbbackup
    WORK_DIR_LOCATION=/tmp
    ORACLE_HOME_LOC=/scratch/d121hmcasm/product/12.1.0/dbhome_1
    
  • Unplug/plug

    Unplugs the source PDB and creates a new PDB at the destination using the unplugged source, and then plugs the source back. EXISTING_BACKUP, EXISTING_BACKUP_METADATA and BACKUP_TYPE parameters should not be provided.

    Sample properties file:

    SRC_PDB_TARGET=cdb_prod_PDB
    SRC_HOST_CREDS=NC_HOST_SCY:SYCO
    SRC_CDB_CREDS=NC_HOST_SYC:SYCO
    SRC_WORK_DIR=/tmp/source
    DEST_HOST_CREDS=NC_SLCO_SSH:SYS
    DEST_LOCATION=/scratch/sray/app/sray/cdb_tm/HR_TM_PDB6
    DEST_CDB_TARGET=cdb_tm
    DEST_CDB_TYPE=oracle_database
    DEST_CDB_CREDS=NC_HOST_SYC:SYCO
    DEST_PDB_NAME=HR_TM_PDB6
    

Note:

For all the three methods stated above, in case the destination PDB data files location is ASM then add the parameter DEST_STAGE_DIR who's value will be used as the destination while transferring the source PDB data files. This parameter is optional, if it is not provided a temporary directory will be used. For Linux systems the temporary directory is /tmp.

16.4.3 Cloning Schema(s) to a DB or PDB on Oracle Cloud

You can clone a schema that is on-premise to Oracle Cloud either as a database or a pluggable database using EM CLI verbs.

Note:

As a prerequisite, it is recommended that you create a Test Master of the schema database and to use the schema of the Test Master to create a clone.

To clone a schema that is on-premise to Oracle Cloud either as a database or a pluggable database, follow the steps below:

  1. Enter the EM CLI verb emcli describe_dbprofile_input -data_mode=EXPORT. The output provides all profile creation input variables.

    Note:

    Export is supported only for database and schema whereas import is supported for both database and PDBs. This indicates that the source should always be a database or schema and the destination can either be a database or a PDB.

  2. Use the input variables to create a properties file with values for all the variables.
  3. Create the directory object SCHEMAS_DUMP_DIR.
  4. Export data from the source database by creating a database profile. To do so, enter the verb emcli create_dbprofile - input_file=data:<properties file name along with path>.

    Note:

    Use the properties file created in the previous step for this verb.

    Sample properties file:

    #-----------------------------------------------#
    # SOURCE                                        #
    #-----------------------------------------------#
    REFERENCE_DATABASE=SS_REF_TD_DB
    REFERENCE_DATABASE_TYPE=oracle_database
    REF_DB_CREDENTIALS=CRED_DB:sysman
    REF_HOST_CREDENTIALS=CRED_HOST:sysman
    
    #-----------------------------------------------#
    # DATA CONTENT DETAILS                          #
    #-----------------------------------------------#
    DATA_CONTENT_MODE=EXPORT
    DATA_CONTENT=METADATA_AND_DATA
     
    #-----------------------------------------------#
    # EXPORT DETAILS                                #
    #-----------------------------------------------#
    EXPORT.EXPORT_TYPE=SELECTED_SCHEMAS
    EXPORT.SCHEMA_INCLUDE_LIST.0=HR
    EXPORT.SCHEMA_INCLUDE_LIST.1=PM
    EXPORT.SCHEMA_INCLUDE_LIST.2=OE
    EXPORT.SCHEMA_INCLUDE_LIST.3=IX
    EXPORT.SCHEMA_INCLUDE_LIST.4=SH
    EXPORT.SCHEMA_INCLUDE_LIST.5=BI
    EXPORT.DEGREE_OF_PARALLELISM=1
    EXPORT.DUMP_DIRECTORY_LIST.0=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.dmp,max_size=100
    EXPORT.LOG_FILE_DIRECTORY=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.log
     
    #-----------------------------------------------#
    #         PROFILE DETAILS                       #
    #-----------------------------------------------#
    PROFILE_NAME=Export Dump of Sample schemas10
    PROFILE_VERSION=11.2.0.4.0
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/
    WORKING_DIRECTORY=/tmp
    
  5. Enter the verb to transfer data: emcli data_transfer -input_file=data:/u01/files/data_trans.props.

    Sample properties file:

    #-----------------------------------------#
    # SOURCE                                  #
    #-----------------------------------------#
    SRC_HOST_CREDS=NC_HOST_SRAY
    SOURCE_LOCATION=/tmp/newp/PDB_Backup_142838
    SRC_HOST=bl2.idc.example.com
     
    #-----------------------------------------#
    # DESTINATION                             #
    #-----------------------------------------#
    DEST_HOST_CREDS=NC_HOST_SRAY
    DEST_LOCATION=/scratch/sray/app3/sray/oradata/migda
    DEST_HOST=slo.us.example.com
    
    #-----------------------------------------#
    # HYBRID GATEWAY / FORWARDER             #
    #-----------------------------------------#
    FORWARDER_HOST=slo.us.example.com
    FORWARDER_CRED=ACD_NY:SYSCO
    WORKING_DIRECTORY=/tmp 
    #--------------------------------------------------------------#
    # Data file transfer configuration parameters
    #--------------------------------------------------------------#
    NUMBER_OF_THREADS=10
    #The chunk size in bytes. For now default is 250MB
    MIN_CHUNK_SIZE=262144000
    #Transfer Unit can be FILE or CHUNK
    TRANSFER_UNIT=FILE
    #Maximum speed in Kbps
    BANDWIDTH_LIMIT=2048
    #Time out in seconds for data transfer
    TIME_OUT=1200
    

    Note:

    Remove the Hybrid Gateway parameters if the SSH connection exists between the source and the destination hosts.

  6. Enter the verb to import data in to the destination database: emcli dbimport -input_file=data:/u01/files/dbimport.props.

    Note:

    To clone the destination to database or pluggable database, ensure you provide the required value in the DESTINATION_TARGET_TYPE option in the properties file. For database, enter oracle_database, and for PDB enter oracle_pdb.

    Sample properties file:

    #-----------------------------------------------#
    #         DESTINATION                           #
    #-----------------------------------------------#
    DESTINATION_TARGET=SS_OPC_DB
    DESTINATION_TARGET_TYPE=oracle_database
    DATABASE_CREDENTIAL=CRED_DB:sysman
    HOST_NAMED_CREDENTIAL=CRED_HOST:sysman
     
    #-----------------------------------------------#
    #         PROFILE                               #
    #-----------------------------------------------#
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/Export Dump of Sample schemas10
     
    #-----------------------------------------------#
    #         SCHEMA DETAILS                        #
    #-----------------------------------------------#
    REMAP_SCHEMA_LIST.0=HR:HR
    REMAP_SCHEMA_LIST.1=OE:OE
    REMAP_SCHEMA_LIST.2=PM:PM
    REMAP_SCHEMA_LIST.3=IX:IX
    REMAP_SCHEMA_LIST.4=SH:SH
    REMAP_SCHEMA_LIST.5=BI:BI
    REMAP_TABLESPACE_LIST.0=EXAMPLE:MYTBSP1
    REMAP_TABLESPACE_LIST.1=USERS:MYTBSP1
    REMAP_TABLESPACE_LIST.2=SYSTEM:MYTBSP1
    DEGREE_OF_PARALLELISM=1
    DUMP_FILE_LIST.0=/scratch/ae/dumpdir/samplschemas.dmp
    IMPORT_LOG_FILE_DIRECTORY=DATA_PUMP_DIR
    

16.4.4 Cloning a DB to a PDB on Oracle Cloud

You can clone a database that is on-premise to a pluggable database on Oracle Cloud using EM CLI verbs.

Note:

As a prerequisite it is recommended that you create a Test Master of the database and use the Test Master to create a clone.

To clone a database that is on-premise to Oracle cloud as a pluggable database, follow the steps below:

  1. Enter the EM CLI verb emcli describe_dbprofile_input -data_mode=EXPORT. The output provides all profile creation input variables.

    Note:

    Export is supported only for database and schema whereas import is supported for both database and PDBs. This indicates that the source should always be a database or schema and the destination can either be a database or a PDB.

  2. Use the input variables to create a properties file with values for all the variables.
  3. Create the directory object SCHEMAS_DUMP_DIR.
  4. Export data from the source database by creating a database profile. To do so, enter the verb emcli create_dbprofile - input_file=data:<properties file name along with path>.

    Note:

    Use the properties file created in the previous step for this verb.

    Sample properties file:

    #-----------------------------------------------#
    # SOURCE                                        # 
    #-----------------------------------------------#
    REFERENCE_DATABASE=SS_TM_DB
    REFERENCE_DATABASE_TYPE=oracle_database
    REF_DB_CREDENTIALS=CRED_DB:sysman
    REF_HOST_CREDENTIALS=CRED_HOST:sysman
    
    #-----------------------------------------------#
    # DATA CONTENT DETAILS                          #
    #-----------------------------------------------#
    DATA_CONTENT_MODE=EXPORT
    DATA_CONTENT=METADATA_AND_DATA
     
    #-----------------------------------------------#
    # EXPORT DETAILS                                #
    #-----------------------------------------------#
    EXPORT.EXPORT_TYPE=FULL_DATABASE
    EXPORT.DEGREE_OF_PARALLELISM=1
    EXPORT.DUMP_DIRECTORY_LIST.0=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.dmp,max_size=100
    EXPORT.LOG_FILE_DIRECTORY=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.log
     
    #-----------------------------------------------#
    #         PROFILE DETAILS                       #
    #-----------------------------------------------#
    PROFILE_NAME=Export Dump of Sample schemas10
    PROFILE_VERSION=11.2.0.4.0
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/
    WORKING_DIRECTORY=/tmp
    
  5. Enter the verb to transfer data: emcli data_transfer -input_file=data:/u01/files/data_trans.props.

    Sample properties file:

    #-----------------------------------------#
    # SOURCE                                  #
    #-----------------------------------------#
    SRC_HOST_CREDS=NC_HOST_SRAY
    SOURCE_LOCATION=/tmp/newp/PDB_Backup_1428003803938
    SRC_HOST=b12.idc.example.com
     
    #-----------------------------------------#
    # DESTINATION                             #
    #-----------------------------------------#
    DEST_HOST_CREDS=NC_HOST_SRAY
    DEST_LOCATION=/scratch/sray/app3/sray/oradata/migda
    DEST_HOST=slo.us.example.com
    
    #-----------------------------------------#
    # HYBRID GATEAWAY / FORWARDER             #
    #-----------------------------------------#
    FORWARDER_HOST=slo.us.example.com
    FORWARDER_CRED=ACD_NY:SYSCO
    WORKING_DIRECTORY=/tmp
    

    Note:

    Remove the Hybrid Gateway parameters if the SSH connection exists between the source and the destination hosts.

  6. Enter the verb to import data in to the destination database: emcli dbimport -input_file=data:/u01/files/dbimport.props.

    Note:

    To clone the destination to a pluggable database, ensure you enter oracle_pdbin the DESTINATION_TARGET_TYPE option in the properties file.

    Sample properties file:

    #-----------------------------------------------#
    #         DESTINATION                           #
    #-----------------------------------------------#
    DESTINATION_TARGET=SS_OPC_DB
    DESTINATION_TARGET_TYPE=oracle_database
    DATABASE_CREDENTIAL=CRED_DB:sysman
    HOST_NAMED_CREDENTIAL=CRED_HOST:sysman
     
    #-----------------------------------------------#
    #         PROFILE                               #
    #-----------------------------------------------#
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/Export Dump of Sample schemas10
     
    #-----------------------------------------------#
    #         SCHEMA DETAILS                        #
    #-----------------------------------------------#
    REMAP_SCHEMA_LIST.0=HR:HR
    REMAP_SCHEMA_LIST.1=OE:OE
    REMAP_SCHEMA_LIST.2=PM:PM
    REMAP_SCHEMA_LIST.3=IX:IX
    REMAP_SCHEMA_LIST.4=SH:SH
    REMAP_SCHEMA_LIST.5=BI:BI
    REMAP_TABLESPACE_LIST.0=EXAMPLE:MYTBSP1
    REMAP_TABLESPACE_LIST.1=USERS:MYTBSP1
    REMAP_TABLESPACE_LIST.2=SYSTEM:MYTBSP1
    DEGREE_OF_PARALLELISM=1
    DUMP_FILE_LIST.0=/scratch/ae/dumpdir/samplschemas.dmp
    IMPORT_LOG_FILE_DIRECTORY=DATA_PUMP_DIR
    

16.5 Cloning to Oracle Cloud Using Oracle Storage Service

You can clone an on-premise database to Oracle Cloud by using backups stored in the Oracle Storage Service.

16.5.1 Cloning a Database to Oracle Cloud Using the Clone Wizard (OSS)

You can clone your on-premise database to Oracle Cloud using backups present on the Oracle Storage Service. These backups can be accessed both by the on-premise database as well as Oracle Cloud.

Cloning a database to Oracle Cloud using the Oracle Storage Service involves the following steps:

  • Defining the Oracle Cloud Backup Service Settings.

  • Configuring the Oracle Database Backup Cloud Service Account

  • Creating a database profile that is backed up and stored on the OSS

  • Cloning the Database

Defining the Oracle Cloud Backup Service Settings

The Oracle Public Cloud Database Backup Settings page allows you to define the storage account settings used to connect to the Oracle Cloud Database Backup Service. The global settings on this page are used when configuring individual databases to send backups to the Oracle Cloud Backup Service.

Specify the Service Name, Identity Domain, User ID, and Password. Optionally, if you are a using a custom storage container for your backups, you can specify it in the Backup Container field. Click Save to save your settings.

Configuring the Oracle Database Backup Cloud Service Account

See Defining the Database Backup Cloud Service Settings

Creating a Database Profile (On OSS)

Create a database profile on the Oracle Storage Service. On the Database Profile page, click the Oracle Cloud as Media radio button, select the required option from the storage accounts drop down list and follow the steps to create the profile.

Cloning the Database

  1. From the Targets menu, select Databases.

  2. For View, select Search List. From the View menu, select Expand All.

  3. Select the database to be cloned and right click the mouse button.

  4. From the Oracle Database menu, select Cloning, then select Clone to Oracle Cloud.

  5. On the Source and Destination: Clone to Oracle Cloud page, do the following:

    • In the Source Credentials section, specify or search and select the database and Oracle Home credentials. If the source database is encrypted, specify the Wallet Password. Click OK.


      Clone to Cloud — OSS
    • In the Data Time Series section, the Prior Point in Time option is selected by default and a timeline of RMAN Backup on Oracle Cloud images appear. These backups are present in the Oracle Storage Service and can be directly used to clone the database on Oracle Cloud. Select the appropriate RMAN backup by clicking Select on the image.

    • In the Source Backup Location field, the location of the source backup you have selected appears.

    • In the Database Definition section, specify the Display Name for the database, the Global Database Name, SID.

    • In the Hosts section, you can choose:

      • Clone Oracle Home: If the Oracle Home is not pre-installed on the Oracle Public Cloud machine on which the database is being cloned, select the Clone Oracle Home option.

        Note:

        If you are provisioning a new Oracle Home and if your source is not acting as a hybrid gateway, you must use the hybrid cloud agent to transfer the binaries.
      • Use an Existing Home: If the Oracle Home is already cloned, select the Use an Existing Home option

    • If you select the Clone Oracle Home option, select the Oracle Public Cloud host machine on which the Oracle Home is to be provisioned. The Shape (size) of the Oracle Public Cloud machine and the Site (Oracle Cloud) is displayed. Specify the following:

      • Database Host Credentials: Specify the database host credentials.

      • Run root scripts that require root privileges: You can either specify the root credentials or choose to enter them later to run the root scripts.

    • If you select the Use an Existing Home option, specify the following:

      • Oracle Home Location: Select the location of the Oracle Home on an Oracle Public Cloud machine already managed in Enterprise Manager. The host name of the machine in which the Oracle Home is present is displayed.

      • Database Host Credentials: Specify the database host credentials.

  6. Click Next to navigate to the Configuration page. Specify the following details:

    • Software Location: Specify the Oracle Base and Oracle Home location where the database is to be cloned.

    • Oracle Database User Groups: Specify the name of the Oracle Database User Group performing this cloning operation.

    • Database Files Location: Specify the location where you want the data files, temp files, redo log files, and control files to be created.

    • Recovery Files Location: Specify the location where you want the recovery files, such as archived redo logs, RMAN backups, and other related files to be created. You can choose to use the fast recovery area. If you do, specify the fast recovery area size. In the Database Mode section, you can enable Read Only.

    • Listener Configuration: In the Hosts section on the previous page, if you have selected:

      • Clone Oracle Home: Specify the Listener Name and Port to create a new listener with which the database will be registered.

      • Use an Existing Home: Select the listener targets running under the new Oracle Home, to register the clone database, You can add new listeners by clicking Add, and specifying the listener name and port.

    • Database Credentials: Specify passwords for the SYS, SYSTEM, and DBSNMP administrative users in the clone database. You can choose to have the same password for all the three users or a different password for each.

    • Transparent Data Encryption: If the source database is encrypted, specify the location in which the Wallet is to be placed on the Oracle Public Host machine. Select the Use same password as source checkbox to use the same password as the host database. Select the Reset/Regenerate the Master Encryption Key to reset the encryption key.

    • Parallelism: Setting a higher Degree of Parallelism will ensure faster recompilation of objects. The default setting is the number of CPU count of the host. Click Next.

  7. On the Initialization Parameters page, you can configure the values of various initialization parameters that affect the operation of the database instance. Select the parameter and click Edit to modify the value of the parameter. Click Next.

  8. On the Post Processing page, you can select masking rules, subsetting rules, or custom scripts such as pre script, post script, and post SQL script. Click Next.

  9. On the Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

  10. On the Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Submit to launch the procedure to clone the database, transfer the selected backups to the destination host via the hybrid gateway. Once cloned, this database can be managed as an Enterprise Manager target.

    To refresh the cloned database, from the Oracle Database menu, select Cloning, then select Clone Management. On the Clone Management Dashboard, select the database and click Refresh. Accept the default values in the wizard and optionally change the Initialization Parameters and Configuration details and click Refresh.

16.6 Cloning from Oracle Cloud

To clone a database, schema(s), or a PDB from Oracle Cloud, refer to the following use cases:

16.6.1 Cloning a PDB from Oracle Cloud

To clone a PDB from Oracle Cloud to an on-premise PDB, you can use either of the following solutions:

16.6.1.1 Cloning a PDB from Oracle Cloud Using the Clone Wizard

To clone a PDB from Oracle Cloud to an On-Premise PDB, follow these steps:

  1. From the Targets menu, select Databases.
  2. For View, select Search List. From the View menu, select Expand All.
  3. Look for the source CDB (the CDB that the source PDB is a part of) in the list, then click the name of the PDB that you want to clone.
  4. From the Oracle Database menu, select Cloning, then select Clone from Oracle Cloud.

    Alternatively, in Step 3, you can right click the name of the PDB that you want to clone, select Oracle Database, select Cloning, then select Clone from Oracle Cloud.

  5. On the Source and Destination: Clone from Oracle Cloud page, do the following:
    • In the Credentials section, specify the SYSDBA credentials for the source CDB, and the host credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Pluggable Database Definition section, specify a name, and a display name for the PDB clone. Enterprise Manager uses the display name to identify the PDB clone target.

    • In the PDB Administrator Credentials section, specify the credentials of the Admin user account that you want to use to administer the PDB clone.

    • In the Container Database section, specify the destination CDB that is deployed in the public cloud setup (the CDB that the PDB clone must be a part of).

    • In the Credentials section, specify the SYSDBA credentials for the destination CDB, and the host credentials for the destination CDB.

  6. If you do not need to specify anymore details, click Clone. This submits the deployment procedure to clone a PDB to a CDB that is deployed in a public cloud setup.

    To specify other configuration details, mask data, as well as schedule the cloning process, click Advanced.

    Follow the rest of the steps, if you have selected the Advanced option.

  7. On the Clone from Oracle Cloud: Source and Destination page, verify the details, and then click Next.
  8. On the Clone from Cloud: Configuration page, in the Database Files Location section, specify the storage location where the datafiles of the PDB clone must be stored.

    In the Advanced Configuration section, specify the storage limits for the maximum size of the PDB clone, and the maximum size of a shared table space within the PDB clone. By default, no limits are placed on the values for these attributes.

    In the Miscellaneous section, select the logging option that you want to use for the table spaces created within the PDB clone.

    Click Next.

  9. On the Clone from Cloud: Post Processing page, in the Data Masking section, specify the data masking definition that you want to apply after cloning the PDB. Data masking masks sensitive data in a database.

    For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before cloning, and after cloning the PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after cloning the PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

    Click Next.

  10. On the Clone from Cloud: Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive email notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive email notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

  11. On the Clone from Cloud: Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to clone the selected PDB to a CDB that is deployed in a public cloud setup.

16.6.1.2 Cloning a PDB from Oracle Cloud Using EM CLI

To clone a pluggable database on Oracle Cloud to an on-premise container database, enter the EM CLI verb emcli pdb_clone_management -input_file=data:/xyz/sdf/pdb_clone.props, where pdb_clone.props is the properties file which provides the cloning parameters and their values.

There are three methods in which you can clone a pluggable database. The difference between each of these methods is in the configuration of certain parameters in the properties file. The 3 methods and the details of the configuration parameters are explained below:

  • Operating System (OS) Image backup

    Takes a backup of the source PDB and creates a new PDB. The BACKUP_TYPE parameter should specify the type of backup. The allowed values for BACKUP_TYPE are OSIMAGE, RMAN and TAR. The EXISTING_BACKUP and EXISTING_BACKUP_METADATA parameters should not be provided.

    Sample properties file:

    SRC_PDB_TARGET=cdb_prod_PDB
    SRC_HOST_CREDS=NC_HOST_SCY:SYCO
    SRC_CDB_CREDS=NC_HOST_SYC:SYCO
    SRC_WORK_DIR=/tmp/source
    DEST_HOST_CREDS=NC_SLCO_SSH:SYS
    DEST_LOCATION=/scratch/sray/app/sray/cdb_tm/HR_TM_PDB6
    DEST_CDB_TARGET=cdb_tm
    DEST_CDB_TYPE=oracle_database
    DEST_CDB_CREDS=NC_HOST_SYC:SYCO
    DEST_PDB_NAME=HR_TM_PDB6
    BACKUP_TYPE=OSIMAGE
    
  • Existing backup

    Uses an existing backup of the source PDB and creates a new PDB. The BACKUP_TYPE parameter should specify the type of backup. The allowed values for BACKUP_TYPE are OSIMAGE, RMAN and TAR. The EXISTING_BACKUP parameter should specify the location with the backup name and EXISTING_BACKUP_METADATA should specify the location and the metadata file name for the backup.

    Sample properties file:

    SRC_PDB_TARGET=cdb_prod_PDB
    SRC_HOST_CREDS=NC_HOST_SCY:SYCO
    SRC_CDB_CREDS=NC_HOST_SYC:SYCO
    SRC_WORK_DIR=/tmp/source
    DEST_HOST_CREDS=NC_SLCO_SSH:SYS
    DEST_LOCATION=/scratch/sray/app/sray/cdb_tm/HR_TM_PDB6
    DEST_CDB_TARGET=cdb_tm
    DEST_CDB_TYPE=oracle_database
    DEST_CDB_CREDS=NC_HOST_SYC:SYCO
    DEST_PDB_NAME=HR_TM_PDB6
    EXISTING_BACKUP=/user1/pdbbackup/PDB1_Backup_14297779
    EXISTING_BACKUP_METADATA=/user1/pdbbackup/PDB1_Backup_14297779/PDB1.xml
    BACKUP_TYPE=RMAN
    

    Note:

    To create a PDB backup, enter the verb emcli pdb_backup -inputFile="loaction of file containing properties required for taking backup of PDB", where the sample contents of the properties file is as follows:

    TARGET_HOST_LIST=xyz.abccorp.com
    HOST_NORMAL_NAMED_CRED=XYZ_CRED:CRED_OWNER
    SRC_CDB_NAMED_CRED=CDB1_CRED:CRED_OWNER
    SRC_CDB_TARGET_NAME=CDB1
    SRC_CDB_TARGET_TYPE=oracle_database
    SRC_PDB_TARGET_NAME=CDB1_PDB1
    BACKUP_LOCATION=/user1/pdbbackup
    WORK_DIR_LOCATION=/tmp
    ORACLE_HOME_LOC=/scratch/d121hmcasm/product/12.1.0/dbhome_1
    
  • Unplug/plug

    Unplugs the source PDB and creates a new PDB at the destination using the unplugged source, and then plugs the source back. Both, EXISTING_BACKUP and BACKUP_TYPE parameters should not be provided.

    Sample properties file:

    SRC_PDB_TARGET=cdb_prod_PDB
    SRC_HOST_CREDS=NC_HOST_SCY:SYCO
    SRC_CDB_CREDS=NC_HOST_SYC:SYCO
    SRC_WORK_DIR=/tmp/source
    DEST_HOST_CREDS=NC_SLCO_SSH:SYS
    DEST_LOCATION=/scratch/sray/app/sray/cdb_tm/HR_TM_PDB6
    DEST_CDB_TARGET=cdb_tm
    DEST_CDB_TYPE=oracle_database
    DEST_CDB_CREDS=NC_HOST_SYC:SYCO
    DEST_PDB_NAME=HR_TM_PDB6
    

Note:

For all the 3 methods explained above, in case the destination PDB data files location is ASM then add the parameter DEST_STAGE_DIR who's value will be used as the destination while transferring the source PDB data files. This parameter is optional, if it is not provided a temporary directory will be used. For Linux systems the temporary directory is /tmp.

16.6.2 Cloning Schema(s) from Oracle Cloud to a DB or PDB

You can clone a schema that is on Oracle Cloud to on-premise either as a database or as a pluggable database using EM CLI verbs. To do so, follow the steps below:

  1. Enter the EM CLI verb emcli describe_dbprofile_input -data_mode=EXPORT. The output provides all profile creation input variables.

    Note:

    Export is supported only for database and schema whereas import is supported for both database and PDBs. This indicates that the source should always be a database or schema and the destination can either be a database or a PDB.

  2. Use the input variables to create a properties file with values for all the variables.
  3. Create the directory object SCHEMAS_DUMP_DIR.
  4. Export data from the source database by creating a database profile. To do so, enter the verb emcli create_dbprofile - input_file=data:<properties file name along with path>.

    Note:

    Use the properties file created in the previous step for this verb.

    Sample properties file:

    #-----------------------------------------------#
    # SOURCE                                        # 
    #-----------------------------------------------#
    REFERENCE_DATABASE=SS_TM_DB
    REFERENCE_DATABASE_TYPE=oracle_database
    REF_DB_CREDENTIALS=CRED_DB:sysman
    REF_HOST_CREDENTIALS=CRED_HOST:sysman
    
    #-----------------------------------------------#
    # DATA CONTENT DETAILS                          #
    #-----------------------------------------------#
    DATA_CONTENT_MODE=EXPORT
    DATA_CONTENT=METADATA_AND_DATA
     
    #-----------------------------------------------#
    # EXPORT DETAILS                                #
    #-----------------------------------------------#
    EXPORT.EXPORT_TYPE=SELECTED_SCHEMAS
    EXPORT.SCHEMA_INCLUDE_LIST.0=HR
    EXPORT.SCHEMA_INCLUDE_LIST.1=PM
    EXPORT.SCHEMA_INCLUDE_LIST.2=OE
    EXPORT.SCHEMA_INCLUDE_LIST.3=IX
    EXPORT.SCHEMA_INCLUDE_LIST.4=SH
    EXPORT.SCHEMA_INCLUDE_LIST.5=BI
    EXPORT.DEGREE_OF_PARALLELISM=1
    EXPORT.DUMP_DIRECTORY_LIST.0=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.dmp,max_size=100
    EXPORT.LOG_FILE_DIRECTORY=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.log
     
    #-----------------------------------------------#
    #         PROFILE DETAILS                       #
    #-----------------------------------------------#
    PROFILE_NAME=Export Dump of Sample schemas10
    PROFILE_VERSION=11.2.0.4.0
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/
    WORKING_DIRECTORY=/tmp
    
  5. Enter the verb to transfer data: emcli data_transfer -input_file=data:/u01/files/data_trans.props.

    Sample properties file:

    #-----------------------------------------#
    # SOURCE                                  #
    #-----------------------------------------#
    SRC_HOST_CREDS=NC_HOST_SRAY
    SOURCE_LOCATION=/tmp/newp/PDB_Backup_1428003803938
    SRC_HOST=bl2.idc.example.com
     
    #-----------------------------------------#
    # DESTINATION                             #
    #-----------------------------------------#
    DEST_HOST_CREDS=NC_HOST_SRAY
    DEST_LOCATION=/scratch/sray/app3/sray/oradata/migda
    DEST_HOST=slo.us.example.com
    
    
    #-----------------------------------------#
    # HYBRID GATEAWAY / FORWARDER             #
    #-----------------------------------------#
    FORWARDER_HOST=slo.us.example.com
    FORWARDER_CRED=ACD_NY:SYSCO
    WORKING_DIRECTORY=/tmp
    

    Note:

    Remove the Hybrid Gateway parameters if the SSH connection exists between the source and the destination hosts.

  6. Enter the verb to import data in to the destination database: emcli dbimport -input_file=data:/u01/files/dbimport.props.

    Note:

    To clone the destination to database or pluggable database, ensure you provide the required value in the DESTINATION_TARGET_TYPE option in the properties file. For database, enter oracle_database, and for PDB enter oracle_pdb.

    Sample properties file:

    #-----------------------------------------------#
    #         DESTINATION                           #
    #-----------------------------------------------#
    DESTINATION_TARGET=SS_OPC_DB
    DESTINATION_TARGET_TYPE=oracle_database
    DATABASE_CREDENTIAL=CRED_DB:sysman
    HOST_NAMED_CREDENTIAL=CRED_HOST:sysman
     
    #-----------------------------------------------#
    #         PROFILE                               #
    #-----------------------------------------------#
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/Export Dump of Sample schemas10
     
    #-----------------------------------------------#
    #         SCHEMA DETAILS                        #
    #-----------------------------------------------#
    REMAP_SCHEMA_LIST.0=HR:HR
    REMAP_SCHEMA_LIST.1=OE:OE
    REMAP_SCHEMA_LIST.2=PM:PM
    REMAP_SCHEMA_LIST.3=IX:IX
    REMAP_SCHEMA_LIST.4=SH:SH
    REMAP_SCHEMA_LIST.5=BI:BI
    REMAP_TABLESPACE_LIST.0=EXAMPLE:MYTBSP1
    REMAP_TABLESPACE_LIST.1=USERS:MYTBSP1
    REMAP_TABLESPACE_LIST.2=SYSTEM:MYTBSP1
    DEGREE_OF_PARALLELISM=1
    DUMP_FILE_LIST.0=/scratch/ae/dumpdir/samplschemas.dmp
    IMPORT_LOG_FILE_DIRECTORY=DATA_PUMP_DIR
    

16.6.3 Cloning a DB from Oracle Cloud to an On-Premise PDB

You can clone a database that is on Oracle Cloud to on-premise as a pluggable database using EM CLI verbs. To do so, follow the steps below:

  1. Enter the EM CLI verb emcli describe_dbprofile_input -data_mode=EXPORT. The output provides all profile creation input variables.

    Note:

    Export is supported only for database and schema whereas import is supported for both database and PDBs. This indicates that the source should always be a database or schema and the destination can either be a database or a PDB.

  2. Use the input variables to create a properties file with values for all the variables.
  3. Create the directory object SCHEMAS_DUMP_DIR.
  4. Export data from the source database by creating a database profile. To do so, enter the verb emcli create_dbprofile - input_file=data:<properties file name along with path>.

    Note:

    Use the properties file created in the previous step for this verb.

    Sample properties file:

    #-----------------------------------------------#
    # SOURCE                                        #
    #-----------------------------------------------#
    REFERENCE_DATABASE=SS_TM_DB
    REFERENCE_DATABASE_TYPE=oracle_database
    REF_DB_CREDENTIALS=CRED_DB:sysman
    REF_HOST_CREDENTIALS=CRED_HOST:sysman
    
    #-----------------------------------------------#
    # DATA CONTENT DETAILS                          #
    #-----------------------------------------------#
    DATA_CONTENT_MODE=EXPORT
    DATA_CONTENT=METADATA_AND_DATA
     
    #-----------------------------------------------#
    # EXPORT DETAILS                                #
    #-----------------------------------------------#
    EXPORT.EXPORT_TYPE=FULL_DATABASE
    EXPORT.DEGREE_OF_PARALLELISM=1
    EXPORT.DUMP_DIRECTORY_LIST.0=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.dmp,max_size=100
    EXPORT.LOG_FILE_DIRECTORY=directory=SCHEMAS_DUMP_DIR,file_name=samplschemas.log
     
    #-----------------------------------------------#
    #         PROFILE DETAILS                       #
    #-----------------------------------------------#
    PROFILE_NAME=Export Dump of Sample schemas10
    PROFILE_VERSION=11.2.0.4.0
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/
    WORKING_DIRECTORY=/tmp
    
  5. Enter the verb to transfer data: emcli data_transfer -input_file=data:/u01/files/data_trans.props.

    Sample properties file:

    #-----------------------------------------#
    # SOURCE                                  #
    #-----------------------------------------#
    SRC_HOST_CREDS=NC_HOST_SRAY
    SOURCE_LOCATION=/tmp/newp/PDB_Backup_1428003803938
    SRC_HOST=bl2.idc.example.com
     
    #-----------------------------------------#
    # DESTINATION                             #
    #-----------------------------------------#
    DEST_HOST_CREDS=NC_HOST_SRAY
    DEST_LOCATION=/scratch/sray/app3/sray/oradata/migda
    DEST_HOST=slo.us.example.com
    
    
    #-----------------------------------------#
    # HYBRID GATEAWAY / FORWARDER             #
    #-----------------------------------------#
    FORWARDER_HOST=slo.us.example.com
    FORWARDER_CRED=ACD_NY:SYSCO
    WORKING_DIRECTORY=/tmp
    

    Note:

    Remove the Hybrid Gateway parameters if the SSH connection exists between the source and the destination hosts.

  6. Enter the verb to import data in to the destination database: emcli dbimport -input_file=data:/u01/files/dbimport.props.

    Note:

    To clone the destination to database or pluggable database, ensure you provide the required value in the DESTINATION_TARGET_TYPE option in the properties file. For database, enter oracle_database, and for PDB enter oracle_pdb.

    Sample properties file:

    #-----------------------------------------------#
    #         DESTINATION                           #
    #-----------------------------------------------#
    DESTINATION_TARGET=SS_OPC_DB
    DESTINATION_TARGET_TYPE=oracle_database
    DATABASE_CREDENTIAL=CRED_DB:sysman
    HOST_NAMED_CREDENTIAL=CRED_HOST:sysman
     
    #-----------------------------------------------#
    #         PROFILE                               #
    #-----------------------------------------------#
    PROFILE_LOCATION=Database Provisioning Profiles/12.1.0.1.0/linux_x64/Export Dump of Sample schemas10
     
    #-----------------------------------------------#
    #         SCHEMA DETAILS                        #
    #-----------------------------------------------#
    REMAP_SCHEMA_LIST.0=HR:HR
    REMAP_SCHEMA_LIST.1=OE:OE
    REMAP_SCHEMA_LIST.2=PM:PM
    REMAP_SCHEMA_LIST.3=IX:IX
    REMAP_SCHEMA_LIST.4=SH:SH
    REMAP_SCHEMA_LIST.5=BI:BI
    REMAP_TABLESPACE_LIST.0=EXAMPLE:MYTBSP1
    REMAP_TABLESPACE_LIST.1=USERS:MYTBSP1
    REMAP_TABLESPACE_LIST.2=SYSTEM:MYTBSP1
    DEGREE_OF_PARALLELISM=1
    DUMP_FILE_LIST.0=/scratch/ae/dumpdir/samplschemas.dmp
    IMPORT_LOG_FILE_DIRECTORY=DATA_PUMP_DIR
    

16.6.4 Cloning a DB from Oracle Cloud (Oracle Compute Service)

To clone a database from Oracle Cloud, you can use one of the following solutions:

16.6.4.1 Cloning a DB from Oracle Cloud Using the Clone Wizard

To clone a database from Oracle Cloud, follow these steps:

  1. From the Targets menu, select Databases.
  2. For View, select Search List. From the View menu, select Expand All.
  3. Select the database to be cloned and right click the mouse button.
  4. From the Oracle Database menu, select Cloning, then select Clone to Oracle Cloud.
  5. On the Source and Destination: Clone to Oracle Cloud page, do the following:
    • In the Source Credentials section, specify or search and select the Oracle Cloud database and Oracle Home credentials. Click OK.

    • In the Data Time Series section, the Prior Point in Time option is selected by default and a timeline of RMAN Backup images appear. Select the appropriate RMAN backup by clicking Select on the image.

    • In the Source Backup Location field, the location of the source backup you have selected appears.

    • In the Destination section, in the Clone to field, the Select Compute Cloud Service is selected by default. This indicates that you are requesting resources on Oracle Public Cloud to clone your on-premise database.

    • In the Database Definition section, specify the Display Name for the database, the Global Database Name, SID.

    • In the Hosts section, you can choose:

      • Clone Oracle Home: If the Oracle Home is not pre-installed on the on-premise host on which database is being cloned, select the Clone Oracle Home option.

      • Use an Existing Home: If the Oracle Home is already cloned, select the Use an Existing Home option.

    • If you select the Clone Oracle Home option, select destination machine on which the Oracle Home is to be provisioned. Specify the following:

      • Database Host Credentials: Specify the database host credentials.

      • Run root scripts that require root privileges: You can either specify the root credentials or choose to enter them later to run the root scripts.

        In the Stage Location field, the location on the destination host machine where the backups will be staged before cloning is displayed.

    • If you select the Use an Existing Home option, specify the following:

      • Oracle Home Location: Select the location of the Oracle Home on an Oracle Public Cloud machine already managed in Enterprise Manager. The host name of the machine in which the Oracle Home is present is displayed.

      • Database Host Credentials: Specify the database host credentials.

        In the Stage Location field, the location on the Oracle Public Cloud machine where the backups will be staged before cloning is displayed.

    • Hybrid Gateway Server: Specify the host name and credentials for the Hybrid Gateway Server (configured Enterprise Manager Management Agent) which transfers data from Oracle Cloud to Enterprise Manager. Click Next. The Configuration page appears:

  6. Specify the following details:
    • Software Location: Specify the Oracle Base and Oracle Home location where the database is to be cloned.

    • Oracle Database User Groups: Specify the name of the Oracle Database User Group performing this cloning operation.

    • Database Files Location: Specify the location where you want the data files, temp files, redo log files, and control files to be created.

    • Recovery Files Location: Specify the location where you want the recovery files, such as archived redo logs, RMAN backups, and other related files to be created. You can choose to use the fast recovery area. If you do, specify the fast recovery area size. In the Database Mode section, you can enable Read Only.

    • Listener Configuration: In the Hosts section on the previous page, if you have selected:

      • Clone Oracle Home: Specify the Listener Name and Port to create a new listener with which the database will be registered.

      • Use an Existing Home: Select the listener targets running under the new Oracle Home, to register the clone database, You can add new listeners by clicking Add, and specifying the listener name and port.

    • Database Credentials: Specify passwords for the SYS, SYSTEM, and DBSNMP administrative users in the clone database. You can choose to have the same password for all the three users or a different password for each.

    • Transparent Data Encryption: If the source database is encrypted, specify the location in which the Wallet is to be placed on the Oracle Public Host machine. Select the Use same password as source checkbox to use the same password as the host database. Select the Reset/Regenerate the Master Encryption Key to reset the encryption key.

    • Parallelism: Setting a higher Degree of Parallelism will ensure faster recompilation of objects. The default setting is the number of CPU count of the host. Click Next.

  7. On the Initialization Parameters page, you can configure the values of various initialization parameters that affect the operation of the database instance. Select the parameter and click Edit to modify the value of the parameter. Click Next.
  8. On the Post Processing page, you can select masking rules, subsetting rules, or custom scripts such as pre script, post script, and post SQL script. Click Next.
  9. On the Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning deployment procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

  10. On the Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Submit to launch the procedure to clone the database, transfer the selected backups to the destination host via the hybrid gateway. Once cloned, this database can be managed as an Enterprise Manager target.

    To refresh the cloned database, from the Oracle Database menu, select Cloning, then select Clone Management. On the Clone Management Dashboard, select the database and click Refresh. Accept the default values in the wizard and optionally change the Initialization Parameters and Configuration details and click Refresh to refresh the database

16.6.4.2 Cloning a DB from Oracle Cloud Using EMCLI

You can clone a database from Oracle Cloud using the following EMCLI command:

emcli db_clone_management -cloneFromCloud -input_file=data:/xyz/sdf/clonefromcloud.props

where clonefromcloud.propsis the properties file which provides the cloning parameters and their values.

Sample Properties File

#------------------------------------------------------------#
#                   Source Details
#------------------------------------------------------------#
SRC_DB_TARGET_NAME=hrdb.us.oracle.com
SRC_DB_TARGET_TYPE=oracle_database
SRC_HOST_NORMAL_NAMED_CRED=OPC_209:SYSMAN
SRC_DB_CRED=CLOUDDB_CRED:SYSMAN
SRC_WORK_DIR=/tmp
PROFILE_INTERNAL_PATH=Database Provisioning Profiles/11.2.0.4.0/linux_x64/Database db11.us.oracle.com Profile 22-02-2016 05:13 PM
PROFILE_VERSION_URN=oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DatabaseConfigProfile:2C5B357D5FF67E2AE053F17CB10A53F1:0.1
SOURCE_BACKUP_LOCATION=/u01/hrdb/fast_recovery_area/hrdb/backup1458714912986

#------------------------------------------------------------#
#           Hybrid Gateway Details
#------------------------------------------------------------#
FORWARDER_HOST=slc04wim.us.oracle.com
FORWARDER_HOST_CREDS=HOST:SYSMAN
FORWARDER_STAGE_LOCATION=/scratch/fwd

#------------------------------------------------------------#
# Destination Details
#------------------------------------------------------------#
TARGET_HOST_LIST=slc01aia.us.oracle.com
HOST_NORMAL_NAMED_CRED=SLC01AIA_CRED:SYSMAN
HOST_PRIV_NAMED_CRED=SLC01AIA_CRED_ROOT:SYSMAN
DEST_LOCATION=/scratch/backupStage
DEST_WORK_DIR=/tmp
#------------------------------------------------------------#
# Database Definition
#------------------------------------------------------------#
COMMON_DB_SID=hrcln
COMMON_DOMAIN_NAME=us.oracle.com
COMMON_GLOBAL_DB_NAME=hrcln.us.oracle.com
DATABASE_TYPE=dbTypeSI
DB_ADMIN_PASSWORD_SAME=true
DATABASE_PASSWORDS=welcome1

#------------------------------------------------------------#
# Software Configuration
#------------------------------------------------------------#
#All these are only Applicable if a new oracle home provisioning needs to be done. 
CLONE_HOME=Y
OINSTALL_GROUP=dba
OSBACKUPDBA_GROUP=dba
OSDBA_GROUP=dba
OSDGDBA_GROUP=opc
OSKMDBA_GROUP=opc
OSOPER_GROUP=opc
ORACLE_BASE_LOC=/scratch/app/dbhome11204
ORACLE_HOME_LOC=/scratch/app/dbhome11204/product/11.2.0/dbhome_1


#------------------------------------------------------------#
# Database Configuration
#------------------------------------------------------------#
ARCHIVE_LOG_MODE=YES
DB_FILE_LOC=/scratch/app/dbhome11204/oradata
DB_TARGET_DISPLAY_NAME=HRCLN
DB_TARGET_NAME=hrcln.us.oracle.com
FLASH_REC_AREA=/scratch/app/dbhome11204/fast_recovery_area
FLASH_REC_AREA_SIZE=4182
LISTENER_PORT=2887
//Only needed if we are provisioning a new home
LISTENER_NAME=LIST_2887

#--------------------------------------------------------------#
# Data file transfer configuration parameters
#--------------------------------------------------------------#
# This will be moved to emctl metadata. for now its a variable in DP
NUMBER_OF_THREADS=10
# This will be moved to emctl metadata. for now its a variable in DP
# The chunk size in bytes. For now default is 250MB
MIN_CHUNK_SIZE=262144000
#Transfer Unit can be FILE or CHUNK
TRANSFER_UNIT=FILE
#Maximum speed in Kbps
BANDWIDTH_LIMIT=2048
#Time out in seconds for data transfer
TIME_OUT=1200

#----------------------------------------------------------------#
#    Wallet Configuration
#----------------------------------------------------------------#
DEST_PATH_TO_WALLET=/u03/wallet
WALLET_PASSWORD=Welcome123
NEW_WALLET_PASSWORD=welcome1
REKEY_REQUIRED=true

16.7 Cloning Within Oracle Cloud

To clone a database or a pluggable database within Oracle Cloud, refer to the following use cases:

16.7.1 Cloning a PDB Within Oracle Cloud

To clone a pluggable database within Oracle Cloud, you can use either of the following solutions:

16.7.1.1 Creating a Full Clone Pluggable Database Using the Clone Wizard

You can create a full clone of a PDB using the new Clone PDB Wizard. To create a full clone PDB, follow these steps:

  1. From the Targets menu, select Databases.
  2. For View, select Search List. From the View menu, select Expand All.
  3. Look for the source CDB (the CDB that the source PDB is a part of) in the list, then click the name of the PDB that you want to clone.
  4. From the Oracle Database menu, select Cloning, then select Create Full Clone.

    Alternatively, in Step 3, you can right click the name of the PDB that you want to clone, select Oracle Database, select Cloning, then select Create Full Clone.

  5. On the Source and Destination: Create Full Clone Pluggable Database page, do the following:
    • Specify the SYSDBA credentials for the source CDB. You can choose to use the preferred credentials, use a saved set of named credentials, or specify a new set of credentials.

    • In the Pluggable Database Destination section, specify a name, and a display name for the PDB clone. Enterprise Manager uses the display name to identify the PDB clone target.

    • Select the Refreshable clone check box to create a manually Refreshable PDB.

      Note:

      • Refreshable clone feature is only applicable to Oracle Database version 12.2 and above.

      • To create a Refreshable clone you have to select a different Container Database (CDB). You will not be able to create one in the same CDB.

      • The Refreshable PDB clone is created in read-only mode and can only be either in read-only or mounted state. The clone cannot be opened in read-write mode. Therefore, data masking and post SQL scripts cannot be run on the clone.

    • In the PDB Administrator Credentials section, specify the credentials of the admin user account that you want to use to administer the PDB clone.

    • To clone the PDB to a CDB different from the source CDB, select Clone the Pluggable Database into a different Container Database, then specify the destination CDB.

    • In the Credentials section, specify the destination CDB host credentials. If you chose to clone the PDB to a CDB different from the source CDB, specify the SYSDBA credentials for the destination CDB. Also, if the destination CDB is using Automatic Storage Management (ASM) to manage disk storage, you must specify the ASM credentials.

    Note:

    For Database versions 12.2 and above, if both the source and destination Container Databases are in Archive Log mode and have Local Undo configured, then a Hot clone is performed. Hot clone is the ability to clone a Pluggable Database while the source is open in read-write mode.
  6. You can specify other configuration details, mask data, as well as schedule the cloning process, by selecting the Advanced option. Follow the rest of the steps, if you have selected the Advanced option. If you do not need to specify anymore details, click Clone. This submits the deployment procedure to clone a PDB to a CDB that is deployed in a public cloud setup.
  7. On the Create Full Clone Pluggable Database: Source and Destination page, verify the details specified, and then click Next.
  8. On the Create Full Clone Pluggable Database: Configuration page, do the following:
    • In the Database Files Location section, specify the storage location where the datafiles of the PDB clone must be stored. If the destination CDB is using ASM to manage disk storage, specify the disk group where the datafiles of the PDB clone must be stored.

    • To ensure that only the source PDB data model definition is cloned (and the source PDB data is not cloned), select Exclude User Data.

    • In the Advanced Configuration section, specify the storage limits for the maximum size of the PDB clone, and the maximum size of a shared tablespace within the PDB clone. By default, no limits are placed on the values for these attributes.

    • In the Miscellaneous section, select the logging option that you want to use for the tablespaces created within the PDB clone.

    Click Next.

  9. On the Create Full Clone Pluggable Database: Post Processing page, do the following:
    • In the Data Masking section, specify the data masking definition that you want to apply after cloning the PDB. Data masking masks sensitive data in a database.

      For information on how to create a data masking definition, see Oracle Data Masking and Subsetting Guide. Note that you can apply a data masking definition only if you have the Subset-Masking license pack.

    • In the Custom Scripts section, for Pre Script and Post Script, specify the Oracle Software Library components that contain the scripts that you want to run before cloning, and after cloning the PDB respectively. Also, for SQL Script, specify the SQL scripts that you want to run after cloning the PDB. For Run As User, select the user account that you want to use to run the SQL scripts.

      Click Next.

  10. On the Create Full Clone Pluggable Database: Schedule page, specify an instance name for the cloning deployment procedure. Also, specify the point in time when you want the cloning procedure to begin.

    In the Notification section, select the deployment procedure states for which you want to receive e-mail notifications. For example, if you select Scheduled and Succeeded for Status for Notification, you will receive e-mail notifications when the cloning deployment procedure is scheduled, and when it succeeds.

    Click Next.

  11. On the Create Full Clone Pluggable Database: Review page, review all the details you provided. If you want to edit certain details, click Back to navigate to the required page.

    Click Clone to submit the deployment procedure to create a full clone of the source PDB.

16.7.1.2 Creating a Full Clone Pluggable Database Using EM CLI

To create a full clone of a pluggable database, execute the verb emcli pdb_clone_management -input_file=data:/xyz/sdf/pdb_clone.props, where pdb_clone.props is the properties file.

Sample properties file (pdb_clone.props):

SRC_PDB_TARGET=cdb_prod_PDB
SRC_HOST_CREDS=NC_HOST_SCY:SYCO
SRC_CDB_CREDS=NC_HOST_SYC:SYCO
SRC_WORK_DIR=/tmp/source
DEST_HOST_CREDS=NC_SLCO_SSH:SYS
DEST_LOCATION=/scratch/sray/app/sray/cdb_tm/HR_TM_PDB6
DEST_CDB_TARGET=cdb_tm
DEST_CDB_TYPE=oracle_database
DEST_CDB_CREDS=NC_HOST_SYC:SYCO
DEST_PDB_NAME=HR_TM_PDB6

Note:

  • If you are creating a full clone PDB on Oracle cloud, wherein both the destination PDB and the source PDB are in different CDBs, while both the CDBs are on Oracle Cloud, then ensure that the source PDB is in read-write mode. This is necessary since a database link is created in the destination CDB for cloning the PDB, and a temporary user is created in the source PDB for using the database link. If there is an existing database link in the destination CDB that connects to the source PDB, then use the parameter EXISTING_DB_LINK_NAME to provide the database link name in the properties file.

  • If the PDB full clone (on-premise) needs to be performed using a backup, then the following parameters should be added in the properties file.

    BACKUP_TYPE=RMAN
    DEST_STAGE_DIR=/tmp/bkp_common
    

    If the temporary backup location is shared across source and destination, then add the SKIP_DATA_TRANSFER parameter and set it to 'Y'. For example, SKIP_DATA_TRANSFER=Y. This indicates that the data transfer step should be skipped in the clone procedure.

16.7.2 Cloning a DB Within Oracle Cloud (Oracle Compute Service)

To clone a database within Oracle Cloud, you can use either of the following solutions:

16.7.2.1 Cloning a DB Within Oracle Cloud Using the Clone Wizard

To clone a database from Oracle Cloud using the Clone Wizard, follow the steps as described in Cloning a DB to Oracle Cloud Using the Clone Wizard.

Note:

The Hybrid Cloud Gateway server is not required as the database is being cloned within the Oracle Cloud.

16.7.2.2 Cloning a DB Within Oracle Cloud Using EMCLI

To clone a database within Oracle Cloud using EMCLI, enter the following command:

emcli db_clone_management -cloneToCloud -target_name="database target name" -target_type="database target type - <oracle_database | rac_database>” —input_file=”path of the input file”

Sample Properties File

#------------------------------------------------------------#
#                   Source Details
#------------------------------------------------------------#
SRC_DB_TARGET_NAME=dbprod.us.oracle.com
SRC_DB_TARGET_TYPE=oracle_database
SRC_HOST_NORMAL_NAMED_CRED=SRCHOSTCRED:SYSMAN
SRC_DB_CRED=DBPROD_CRED:SYSMAN
SRC_WORK_DIR=/tmp
PROFILE_INTERNAL_PATH=Database Provisioning Profiles/11.2.0.4.0/linux_x64/Database db11.us.oracle.com Profile 22-02-2016 05:13 PM
PROFILE_VERSION_URN=oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DatabaseConfigProfile:2C5B357D5FF67E2AE053F17CB10A53F1:0.1
SOURCE_BACKUP_LOCATION=/scratch/dbprod/app/dbprod/fast_recovery_area/backup1456141446021

#------------------------------------------------------------#
#           Hybrid Gateway Details
#------------------------------------------------------------#
FORWARDER_HOST=slc04wim.us.oracle.com
FORWARDER_HOST_CREDS=HOST:SYSMAN
FORWARDER_STAGE_LOCATION=/scratch/fwd

#------------------------------------------------------------#
# Destination Details
#------------------------------------------------------------#
TARGET_HOST_LIST=129.124.22.34
HOST_NORMAL_NAMED_CRED=OPC_CRED:SYSMAN
HOST_PRIV_NAMED_CRED=HOST_CRED_ROOT:SYSMAN
DEST_LOCATION=/u03/backup
DEST_WORK_DIR=/tmp
#------------------------------------------------------------#
# Database Definition
#------------------------------------------------------------#
COMMON_DB_SID=Dcln1
COMMON_DOMAIN_NAME=us.oracle.com
COMMON_GLOBAL_DB_NAME=Dcln1.us.oracle.com
DATABASE_TYPE=dbTypeSI
DB_ADMIN_PASSWORD_SAME=true
DATABASE_PASSWORDS=welcome1

#------------------------------------------------------------#
# Software Configuration
#------------------------------------------------------------#
CLONE_HOME=Y   # mention it as N if only database cloning is required
#All these below parameters are only required if a new oracle home provisioning needs to be done. 
OINSTALL_GROUP=dba
OSBACKUPDBA_GROUP=dba
OSDBA_GROUP=dba
OSDGDBA_GROUP=opc
OSKMDBA_GROUP=opc
OSOPER_GROUP=opc
ORACLE_BASE_LOC=/u03/home/app/gaurav
ORACLE_HOME_LOC=/u03/home/app/gaurav/product/11.2.0/dbhome_1


#------------------------------------------------------------#
# Database Configuration
#------------------------------------------------------------#
ARCHIVE_LOG_MODE=YES
DB_FILE_LOC=/u03/home/oradata
DB_TARGET_DISPLAY_NAME=Dcln1
DB_TARGET_NAME=Dcln1.us.oracle.com
FLASH_REC_AREA=/u03/home/app/home/fast_recovery_area
FLASH_REC_AREA_SIZE=4182
LISTENER_PORT=2887
#Only needed if we are provisioning a new home
LISTENER_NAME=LIST_2887

#--------------------------------------------------------------#
# Data file transfer configuration parameters
#--------------------------------------------------------------#
# This will be moved to emctl metadata. for now its a variable in DP
NUMBER_OF_THREADS=10
# This will be moved to emctl metadata. for now its a variable in DP
# The chunk size in bytes. For now default is 250MB
MIN_CHUNK_SIZE=262144000
#Transfer Unit can be FILE or CHUNK
TRANSFER_UNIT=FILE
#Maximum speed in Kbps
BANDWIDTH_LIMIT=2048
#Time out in seconds for data transfer
TIME_OUT=1200

#----------------------------------------------------------------#
#    Wallet Configuration
#----------------------------------------------------------------#
DEST_PATH_TO_WALLET=/u03/wallet
WALLET_PASSWORD=Welcome123
NEW_WALLET_PASSWORD=welcome1
REKEY_REQUIRED=true