← Oracle// SCRIPTS

PDB & Multitenant

How to save a PDB open state in Oracle Multitenant

Preserve a PDB open state so it returns to that mode after a CDB restart, with ALTER PLUGGABLE DATABASE SAVE STATE.

12c18c19c21c23ai26ai

How to clone a PDB in Oracle Multitenant

Create a new PDB as a local clone of an existing one with CREATE PLUGGABLE DATABASE ... FROM, then open it.

12c18c19c21c23ai26ai

How to plug in a PDB in Oracle Multitenant

Plug a previously unplugged PDB into a CDB using its XML manifest, with CREATE PLUGGABLE DATABASE ... USING, then check for violations.

12c18c19c21c23ai26ai

How to open or close a PDB in Oracle Multitenant

Open a pluggable database READ WRITE or close it with ALTER PLUGGABLE DATABASE, then verify the open mode.

12c18c19c21c23ai26ai

How to check PDB saved state in Oracle Multitenant

Check which PDBs have a saved open state, so they reopen automatically when the CDB restarts, from DBA_PDB_SAVED_STATES.

12c18c19c21c23ai26ai

How to check the current container in Oracle Multitenant

Find which container your session is in and list all containers in the CDB, from SYS_CONTEXT and V$CONTAINERS.

12c18c19c21c23ai26ai

How to list all PDBs and their open mode in Oracle

List the pluggable databases in a CDB with their open mode, restricted flag, and size, from V$PDBS and CDB_PDBS.

12c18c19c21c23ai26ai

How to drop a PDB in Oracle Multitenant

Permanently drop a pluggable database with DROP PLUGGABLE DATABASE, with the INCLUDING versus KEEP DATAFILES options.

12c18c19c21c23ai26ai

How to check PDB plug-in violations in Oracle Multitenant

Find plug-in violations (option, patch, or parameter mismatches) that keep a plugged PDB from opening cleanly, from PDB_PLUG_IN_VIOLATIONS.

12c18c19c21c23ai26ai

How to unplug a PDB in Oracle Multitenant

Unplug a PDB into an XML manifest so it can be plugged into another CDB, using ALTER PLUGGABLE DATABASE UNPLUG INTO.

12c18c19c21c23ai26ai

How to create a new PDB from seed in Oracle Multitenant

Create a new pluggable database from PDB$SEED with a local admin user, using CREATE PLUGGABLE DATABASE, then open it.

12c18c19c21c23ai26ai

How to project tablespace growth per PDB in Oracle Multitenant

PL/SQL report that walks every PDB in a container database and prints per-tablespace growth history plus 30/60/90 day projections from AWR.

12c18c19c21c23ai26ai