To migrate a non-container database (CDB) as a PDB, follow these steps:
- Meet the prerequisites.
For information on the prerequisites for migrating a non-container database as a PDB, view Prerequisites for Migrating a Non-CDB as a Pluggable Database.
- Log in to EM CLI by running the following command on the OMS host:
$<OMS_HOME>/bin/emcli login -username=<name_of_user> -password=<password>
- View the help file of the
migrate_noncdb_to_pdbverb by running the following command:
$<OMS_HOME>/bin/emcli help migrate_noncdb_to_pdb
- Run the
$<OMS_HOME>/bin/emcli migrate_noncdb_to_pdb -cdbTargetName=<EM CDB target into which the database will be added as PDB> -cdbTargetType=<EM CDB target type (oracle_database|rac_database)> -cdbDBCreds=<Named DB credentials of CDB user having sysdba privileges> -cdbHostCreds=<Named host credentials for Oracle Home owner of CDB> -migrationMethod=<Migration method to be used (DATAPUMP|PLUG_AS_PDB)> -noncdbTargetName=<EM non-CDB target to be migrated> -noncdbTargetType=<EM non-CDB target type (oracle_database|rac_database)> -noncdbDBCreds=<Named DB credentials for non-CDB user having sysdba privileges> -noncdbHostCreds=<Named host credentials for Oracle Home owner of non-CDB> -pdbName=<Name of the PDB to be created on the CDB> -pdbAdminName=<Username of the PDB administrator to be created> -pdbAdminPassword=<Password for the PDB administrator> [-exportDir=<Temporary file system location on the non-CDB host where the exported files will be stored>] [-importDir=<Temporary file system location on the CDB host used to stage the migration metadata and/or datafiles>] [-useOMF=<Use OMF for datafile location if CDB is OMF enabled (Y|N)>] [-dataFilesLoc=<Location on the CDB host where datafiles for the newly created DB will be stored. Disk Group name in case of ASM>] [-encryptionPwd=<Password to decrypt/encrypt datapump dump file. Mandatory if non-CDB contains encrypted tablespaces>] [-cdbWalletPwd=<Wallet password of the CDB. Mandatory if non-CDB contains encrypted tablespaces>] [-objectExistsAction=<Action to be taken when the exported object with same name is found on the newly created PDB (SKIP|REPLACE). Defaulted to SKIP>] [-precheck=<Perform pre-requisite checks (YES|NO|ONLY). Defaulted to YES>] [-ignoreWarnings=<Ignore the warnings from precheck (Y|N)>]
For example, you can run the following command to migrate a non-CDB as a PDB:
$<OMS_HOME>/bin/emcli migrate_noncdb_to_pdb -migrationMethod=datapump -noncdbTargetName=NON_CDB_NAME -noncdbTargetType=oracle_database -noncdbHostCreds=NON_CDB_HOST_CREDS -noncdbDBCreds=NON_CDB_DB_CREDS -cdbTargetName=CDB_NAME -cdbTargetType=oracle_database -cdbHostCreds=CDB_HOST_CREDS -cdbDBCreds=CDB_DB_CREDS -pdbName=NEW_PDB -pdbAdminName=pdbAdmin -pdbAdminPassword=welcome -precheck=ONLY -ignoreWarnings