Unplugging and Dropping a Pluggable Database
To unplug and drop a PDB, follow these steps:
- Meet the prerequisites.
For information on the prerequisites for unplugging and dropping a PDB, see Prerequisites for Unplugging and Dropping 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
unplug_pluggable_database
verb by running the following command:$<OMS_HOME>/bin/emcli help unplug_pluggable_database
- Run the
unplug_pluggable_database
verb:$<OMS_HOME>/bin/emcli unplug_pluggable_database -cdbTargetName=<Specify the CDB target name from which PDB needs to be unplugged> -cdbTargetType=<Specify the CDB target type - oracle_database, rac_database> -cdbHostCreds=<Specify the host credentials on which the CDB target is located> -cdbTargetCreds=<Specify the credentials of container database on which the PDB will be unplugged.> -pdbName=<Specify name of the PDB that needs to be unplugged> [-unplugPDBToSWLIB=<Specifies that unplugged PDB should be uploaded to Software Library (SWLIB)>] [-pdbTemplateNameInSWLIB=<If -unplugPDBToSWLIB, specify the name to be used for PDB Template component in SWLIB.>] [-tempStagingLocation=<If -unplugPDBToSWLIB, specify a temporary working directory for copying staging SWLIB files.>] -unplugPDBTemplateType=<Specify the PDB template type - ARCHIVE, RMAN, XML.> [-pdbArchiveLocation=<If -unplugPDBTemplateType=ARCHIVE, this is fully qualified archive location with file name>] [-pdbMetadataFile=<If -unplugPDBTemplateType=RMAN or XML, this is fully qualified path for the PDB metadata file>] [-pdbDatabackup=<If -unplugPDBTemplateType=RMAN, this is fully qualified path for the PDB datafile backup>]
For example, you can run the following command to unplug and drop a PDB:
$<OMS_HOME>/bin/emcli unplug_pluggable_database -cdbTargetName=db -cdbTargetType=oracle_database -cdbHostCreds=HOST_CREDS -cdbTargetCreds=CDB_CREDS -pdbName=db_pdb -unplugPDBTemplateType=ARCHIVE -pdbArchiveLocation=/u01/app/unplugged/db_pdb.tar.gz