Oracle DBMS_PDB
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.1 to 12.1.0.2. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Interested in Oracle GoldenGate? Check out the IGGOUG,
Purpose Provides an interface to examine and manipulate data about pluggable databases.
AUTHID CURRENT_USER
Dependencies
DBMS_ASSERT DBMS_PDB_EXEC_SQL X$KSPPCV
DBMS_OUTPUT PDB_PLUG_IN_VIOLATIONS X$KSPPI
Documented Yes
First Available 12.1.0
Security Model Owned by SYS with EXECUTE granted to EXECUTE_CATALOG_ROLE role. The script catqm_int.sql also grants EXECUTE to XDB.
Source {ORACLE_HOME}/rdbms/admin/dbmspdb.sql
Subprograms
 
CHECK_PLUG_COMPATIBILITY
Determines whether a pluggable database described by file pdb_descr_file is compatibile with the current CDB dbms_pdb.check_plug_compatibility(
pdb_descr_file IN VARCHAR2,
pdb_name       IN VARCHAR2 DEFAULT NULL)
RETURN BOOLEAN;
conn / as sysdba

ALTER PLUGGABLE DATABASE pdborcl CLOSE;

ALTER PLUGGABLE DATABASE pdborcl OPEN READ ONLY;

exec dbms_pdb.describe('/home/oracle/pdborcl.xml', 'PDBORCL');

BEGIN
  IF dbms_pdb.check_plug_compatibility('/home/oracle/pdborcl.xml', 'PDBDEV') THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/

SELECT *
FROM pdb_plug_in_violations;
 
CLEANUP_TASK
Performs cleanup task previously performed by SMON -- returns 0 if the next scheduled time for the job does not need to be changed. N if the next schedule job should be N seconds from now (not my experience as shown below)
dbms_pdb.cleanup_task(task_id IN NUMBER) RETURN NUMBER;
SELECT dbms_pdb.cleanup_task(153)
FROM dual;
       *
ORA-00600: internal error code, arguments: [kpdbCleanupTaskInt:taskid], [153], [], [], [], [], [], [], [], [], [], []
ORA-06512: at "SYS.DBMS_PDB", line 116
 
DESCRIBE
Generates XML that describes tablespaces and datafiles belonging to a pluggable database dbms_pdb.describe(pdb_descr_file IN VARCHAR2, pdb_name IN VARCHAR2 DEFAULT NULL);
-- replace this XML
exec dbms_pdb.describe('c:\tmp\orabase_desc.xml', 'ORABASE');

-- sample output XML file content
<?xml version="1.0" encoding="UTF-8"?>
<tablespaces>
  <byteorder>1</byteorder>
  <csid>178</csid>
  <ncsid>2000</ncsid>
  <vsn>202375170</vsn>
  <guid>7B17537267EA4F84850F5D91C90789E3</guid>
  <uscnbas>2492451</uscnbas>
  <uscnwrp>0</uscnwrp>
  <rdba>4194824</rdba>
  <tablespace>
    <name>SYSTEM</name>
    <type>0</type>
    <tsn>0</tsn>
    <status>1</status>
    <bmunitsize>8</bmunitsize>
    <issft>0</issft>
    <file>
      <path>C:\ORACLE\PRODUCT\ORADATA\ORABASE\UWPDB\SYSTEM01.DBF</path>
      <afn>11</afn>
      <rfn>1</rfn>
      <createscnbas>2365579</createscnbas>
      <createscnwrp>0</createscnwrp>
      <fileblocks>32000</fileblocks>
      <blocksize>8192</blocksize>
      <status>1</status>
    </file>
  </tablespace>
  <tablespace>
    <name>SYSAUX</name>
    <type>0</type>
    <tsn>1</tsn>
    <status>1</status>
    <bmunitsize>8</bmunitsize>
    <issft>0</issft>
    <file>
      <path>C:\ORACLE\ORADATA\ORABASE\UWPDB\SYSAUX01.DBF</path>
      <afn>12</afn>
      <rfn>4</rfn>
      <createscnbas>2365580</createscnbas>
      <createscnwrp>0</createscnwrp>
      <fileblocks>78080</fileblocks>
      <blocksize>8192</blocksize>
      <status>1</status>
    </file>
  </tablespace>
  <tablespace>
    <name>TEMP</name>
    <type>1</type>
    <tsn>2</tsn>
    <status>1</status>
    <bmunitsize>128</bmunitsize>
    <issft>0</issft>
    <file>
      <path>C:\ORACLE\ORADATA\ORABASE\UWPDB\TEMP01.DBF</path>
      <afn>4</afn>
      <rfn>1</rfn>
      <createscnbas>2359485</createscnbas>
      <createscnwrp>0</createscnwrp>
      <fileblocks>2560</fileblocks>
      <blocksize>8192</blocksize>
      <status>0</status>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>80</incsize>
    </file>
  </tablespace>
</tablespaces>
 
EXEC_AS_ORACLE_SCRIPT
This procedure enables execution of certain restricted statements (most DDLs) on metadata-linked objects, from within a PDB Note: This procedure is called by the package initialization section. This is accomplished by running the statement as an oracle script (i.e. with the parameter _oracle_script set to TRUE). This is for use by Oracle internal packages only.

dbms_pdb.exec_as_oracle_script(sql_stmt IN VARCHAR2);
TBD
 
NONCDB_TO_PDB
Helper procedure for noncdb_to_pdb.sql dbms_pdb.noncdb_to_pdb(phase IN NUMBER);
exec dbms_pdb.noncdb_to_pdb(1);
exec dbms_pdb.noncdb_to_pdb(1);
 
RECOVER
Generates an XML file describing a pluggable database by using data files belonging to the database. The XML file can be used to plug the PDB into a CDB using CREATE PLUGGABLE DATABASE. dbms_pdb.recover(
pdb_descr_file IN VARCHAR2,
pdb_name       IN VARCHAR2,
filenames      IN VARCHAR2);
exec dbms_pdb.recover('/home/oracle/recover_pdborcl.xml', 'PDBORCL', '/???
 
SYNC_PDB
After plug, syncs the PDB with the CDB, so that it will be ready for use dbms_pdb.sync_pdb;
exec dbms_pdb.sync_pdb;
 
UPDATE_CDBVW_STATS
Updates CDB View Stats -- returns 0 if the next scheduled job change time does not need to be changed: N if the next scheduld time should be N seconds from SYSDATE
dbms_pdb.update_cdbvw_stats RETURN NUMBER;
SELECT dbms_pdb_update_cdbvw_stats
FROM dual;

-- hung the system for a very long time: try again after rebuild

Related Topics
CDBVIEW
Container Database
DBMS_PDB_EXEC_SQL
Packages
Pluggable Database
What's New In 12cR1

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2014 Daniel A. Morgan All Rights Reserved