Enterprise Manager Cloud Control enables you to clone databases using the Full Clone method, or by using the classic cloning wizard which enables you clone databases using RMAN backup, staging areas, or an existing backup.
This chapter outlines the following procedures which you can use to create a database clone. For other advanced cloning methods, see Enterprise Manager Cloud Administration Guide.
To create a Full Clone database, you can use either of the following solutions:
To create a full clone database, follow these steps:
To create a full clone of a database execute the verb emcli db_clone_management -createFullClone -input_file="location of file containing properties for creating the database clone
".
Sample properties file:
CLONE_TYPE=DUPLICATE SRC_DB_TARGET_NAME=xxyy.us.example.com SRC_DB_TARGET_TYPE=oracle_database SRC_DB_CRED=NC_DB_CRED:SYSCO SRC_HOST_NORMAL_NAMED_CRED=NC_HOST_CRED:SYSCO COMMON_GLOBAL_DB_NAME=clonedb.example.com COMMON_DB_SID=clonedb DB_TARGET_NAME=clonedb.xxy.example.com DATABASE_TYPE=dbTypeSI TARGET_HOST_LIST=desthost.example.com ORACLE_HOME_NAME=OraDB12Home2_29 ORACLE_HOME_LOC=/scratch/app/product/11.2.0./dbhome_1 ORACLE_BASE_LOC=/scratch/app/base HOST_NORMAL_NAMED_CRED=NC_HOST_CRED2:SYSCO DB_STORAGE_TYPE=FS DB_FILE_LOC=/scratch/app/oradata FRA_STORAGE_TYPE=FS FLASH_REC_AREA=/scratch/user/app/fra FRA_SIZE=4395 ARCHIVE_LOG_MODE=NO DEST_LISTENER_SELECTION=DEST_DB_HOME LISTENER_PORT=1526 ENABLE_LIVE_CLONE=true DB_ADMIN_PASSWORD_SAME=true DATABASE_PASSWORDS=right1 DB_TEMPLATE_STAGE=/tmp
Note:
The sample file shown above may not be valid for different types of full clone. As in, you may need to have different parameters for a live clone, or a point-in-time clone. Similarly, for a Single Instance, or a RAC clone. To know the necessary parameters to be added in the input file for a particular type of clone, enter the commandemcli db_clone_management -print_properties
.To verify the status of the database clone creation, execute the verb emcli get_instance_status -instance={instance GUID}
.
To create a full clone PDB, you can use either of the following solutions:
You can create a full clone of a PDB using the new Clone PDB Wizard. To create a full clone PDB, follow these steps:
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.
You can clone databases using the older cloning wizard. This section consists of the following:
You can use the Enterprise Manager Clone Database wizard to clone an Oracle database instance to an existing Oracle home. After you have an Oracle database instance in a known state (for example, you've configured it, tuned it, and tested it), you may want to clone that database to another existing Oracle home.
The following table lists the cloning methods and their cloning process:
Table 15-1 Oracle Database Cloning Methods
Cloning Method | Cloning Process |
---|---|
Cloning an Oracle Database Using Recovery Manager (RMAN) Backup |
|
|
|
|
To clone an Oracle database using RMAN backup, follow these steps:
To clone an Oracle database by copying database files via staging areas, follow these steps: