Unplugging an Application Container from a CDB

You can unplug an application container from a CDB.

About Unplugging an Application Container

Unplugging an application container disassociates the application container from a CDB.

Typically, you unplug an application container when you want to move the application container to a different CDB. Also, you can unplug the application container when you no longer want it to be available.

Unplugging an application container is similar to unplugging a PDB. To unplug an application container, connect to its CDB root and use the ALTER PLUGGABLE DATABASE statement to specify an XML file or a .pdb file. When you specify an XML file (.xml extension), it will contain metadata about the application container after it is unplugged. The SQL statement creates the XML file, and it contains the required information to enable a CREATE PLUGGABLE DATABASE statement on a target CDB to plug in the application container. When you specify a .pdb file, it contains a compressed archive of the XML file that describes the application container and the files used by the application container (such as the data files and wallet file). A .pdb file enables you to copy a single, compressed file (instead of multiple files) to a new location to plug the application container into a CDB.

Before it can be unplugged, the application container must not have any application PDBs plugged into it, and it must be closed. When you unplug an application container, the unplugged application container is in mounted mode. The unplug operation makes some changes in the application container’s data files to record, for example, that the application container was successfully unplugged. Because it is still part of the CDB, the unplugged application container is included in an RMAN backup of the entire CDB. Such a backup provides a convenient way to archive the unplugged application container in case it is needed in the future.

To completely remove the application container from the CDB, you can drop it. The only operation supported on an unplugged application container is dropping the application container. The application container must be dropped from the CDB before it can be plugged back into the same CDB. An application container is usable only when it is plugged into a CDB.

See Also:

Unplugging an Application Container

Unplug an application container by using an ALTER PLUGGABLE DATABASE ... UNPLUG INTO statement.

Prerequisites

You must meet the following prerequisites:

  • The current user must have SYSDBA or SYSOPER administrative privilege, and the privilege must be either commonly granted or locally granted in the PDB. The user must exercise the privilege using AS SYSDBA or AS SYSOPER at connect time.

  • The application container must have been opened at least once.

  • The application container must not have any application PDBs plugged into it.

  • The application container must not have an application seed plugged into it.

Note:

If you are unplugging an application container that includes data that was encrypted with Transparent Data Encryption, then follow the instructions in Oracle Database Advanced Security Guide.

To unplug an application container:

  1. In SQL*Plus, ensure that the current container is the root of the CDB.

  2. Close the application container.

    In an Oracle Real Application Clusters (Oracle RAC) environment, the application container must be closed on all instances.

  3. Run the ALTER PLUGGABLE DATABASE statement with the UNPLUG INTO clause, and specify the application container to unplug and the name and location of the application container’s XML metadata file or .pdb file.

Example 14-5 Unplugging Application Container salesact

This ALTER PLUGGABLE DATABASE statement unplugs the application container salesact and creates the salesact.xml metadata file in the /oracle/data/ directory:

ALTER PLUGGABLE DATABASE salesact UNPLUG INTO '/oracle/data/saleact.xml';