110 DBMS_PDB

The DBMS_PDB package provides an interface to examine and manipulate data about pluggable databases.

See Also:

For information on related topics -

This chapter contains the following topics:

Using DBMS_PDB

Overview

A multitenant multitenant container database (CDB) is an Oracle database that includes zero, one, or many user-created pluggable databases (PDBs). The DBMS_PDB package provides an interface to examine and manipulate data about pluggable databases.

Security Model

Users must have the EXECUTE privilege to run the procedures of DBMS_PDB package.

Summary of DBMS_PDB Subprograms

Table 110-1 DBMS_PDB Package Subprograms

Subprogram Description

CHECK_PLUG_COMPATIBILITY Function

Uses an XML file describing a pluggable database (PDB) to determine whether it may be plugged into a given multitenant container database (CDB)

DESCRIBE Procedure

Generates an XML file describing the specified pluggable database (PDB)

RECOVER Procedure

Generates an XML file describing a pluggable database by using data files belonging to the pluggable database (PDB)


CHECK_PLUG_COMPATIBILITY Function

This function uses an XML file describing a pluggable database (PDB) to determine whether it may be plugged into a given multitenant container database (CDB).

Syntax

DBMS_PDB.CHECK_PLUG_COMPATIBILITY (
   pdb_descr_file    IN   VARCHAR2, 
   pdb_name          IN   VARCHAR2 DEFAULT NULL) 
 RETURN BOOLEAN;

Parameters

Table 110-2 CHECK_PLUG_COMPATIBILITY Procedure Parameters

Parameter Description

pdb_descr_file

Path of the XML file that will contain description of a PDB

pdb_name

Name which will be given to the PDB represented by pdb_descr_file when plugged into a given CDB. If not specified, the name will be extracted from pdb_descr_file.


Return Values

TRUE if the PDB described by pdb_descr_file is compatible with the given CDB, FALSE otherwise. If this function returns FALSE, then query the PDB_PLUG_IN_VIOLATIONS data dictionary view to find information about the errors that are found.

See Also:

Oracle Database Reference for information about the PDB_PLUG_IN_VIOLATIONS view

DESCRIBE Procedure

This procedure generates an XML file describing the specified pluggable database (PDB). This file can then be passed to the CHECK_PLUG_COMPATIBILITY Function to determine if the PDB described by the XML file may be plugged into a given multitenant container database (CDB).

Syntax

DBMS_PDB.DESCRIBE (
   pdb_descr_file    IN   VARCHAR2, 
   pdb_name          IN   VARCHAR2 DEFAULT NULL);

Parameters

Table 110-3 DESCRIBE Procedure Parameters

Parameter Description

pdb_descr_file

Path of the XML file that will contain description of a PDB

pdb_name

Name of a PDB to be described. A remote database is specified by including @dblink.


Usage Notes

  • If pdb_name is omitted, the PDB to which the session is connected will be described.

  • If pdb_name is omitted, and the session is connected to the Root, an error will be returned.

RECOVER Procedure

This procedure generates an XML file describing a pluggable database by using data files belonging to the pluggable database. This XML file can then be used to plug the pluggable database into a multitenant container database (CDB) using CREATE PLUGGABLE DATABASE statement.This procedure is intended for cases when an XML file describing a pluggable database is corrupted or lost.

Syntax

DBMS_PDB.RECOVER (
   pdb_descr_file    IN   VARCHAR2, 
   pdb_name          IN   VARCHAR2,
   filenames         IN   VARCHAR2);

Parameters

Table 110-4 RECOVER Procedure Parameters

Parameter Description

pdb_descr_file

Path of the XML file that contains description of a pluggable database

pdb_name

Name of a pluggable database

filenames

Comma-separated list of datafile paths and/or directories containing datafiles for the pluggable database