Skip to main content

pluggable_databases

Creates, updates, deletes, gets or lists a pluggable_databases resource.

Overview​

Namepluggable_databases
TypeResource
Idoci.database.pluggable_databases

Fields​

The following fields are returned by SELECT queries:

The pluggable database.

NameDatatypeDescription
idstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the pluggable database.
compartmentIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the compartment.
connectionStringsobjectConnection strings to connect to an Oracle Pluggable Database.
containerDatabaseIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the CDB.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
isRestrictedbooleanThe restricted mode of the pluggable database. If a pluggable database is opened in restricted mode, the user needs both create a session and have restricted session privileges to connect to it.
lifecycleDetailsstringDetailed message for the lifecycle state.
lifecycleStatestringThe current state of the pluggable database. (PROVISIONING, AVAILABLE, TERMINATING, TERMINATED, UPDATING, FAILED, RELOCATING, RELOCATED, REFRESHING, RESTORE_IN_PROGRESS, RESTORE_FAILED, BACKUP_IN_PROGRESS, DISABLED)
openModestringDeprecated. Use [PluggableDatabaseNodeLevelDetails](#/en/database/latest/datatypes/PluggableDatabaseNodeLevelDetails) for OpenMode details. The mode that pluggable database is in. Open mode can only be changed to READ_ONLY or MIGRATE directly from the backend (within the Oracle Database software). (READ_ONLY, READ_WRITE, MOUNTED, MIGRATE)
pdbNamestringThe name for the pluggable database (PDB). The name is unique in the context of a [container database](#/en/database/latest/Database/). The name must begin with an alphabetic character and can contain a maximum of thirty alphanumeric characters. Special characters are not permitted. The pluggable database name should not be same as the container database name.
pdbNodeLevelDetailsarrayPluggable Database Node Level Details. Example: [{"nodeName" : "node1", "openMode" : "READ_WRITE"}, {"nodeName" : "node2", "openMode" : "READ_ONLY"}]
refreshableCloneConfigobjectPluggable Database Refreshable Clone Configuration.
systemTagsobjectSystem tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
timeCreatedstring (date-time)The date and time the pluggable database was created.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectpluggableDatabaseId, regionGets information about the specified pluggable database.
listselectregioncompartmentId, databaseId, limit, page, sortBy, sortOrder, lifecycleState, pdbNameGets a list of the pluggable databases in a database or compartment. You must provide either a databaseId or compartmentId value.<br />
createinsertregion, pdbName, containerDatabaseIdopc-retry-token, opc-request-idCreates and starts a pluggable database in the specified container database.<br />Pluggable Database can be created using different operations (e.g. LocalClone, RemoteClone, Relocate ) with this API.<br />Use the [StartPluggableDatabase](#/en/database/latest/PluggableDatabase/StartPluggableDatabase) and [StopPluggableDatabase](#/en/database/latest/PluggableDatabase/StopPluggableDatabase) APIs to start and stop the pluggable database.<br />
updateupdatepluggableDatabaseId, regionif-matchUpdates the specified pluggable database.
deletedeletepluggableDatabaseId, regionif-match, opc-request-idDeletes the specified pluggable database.
convert_to_regular_pluggable_databaseexecpluggableDatabaseId, regionif-match, opc-request-id, opc-retry-tokenConverts a Refreshable clone to Regular pluggable database (PDB).<br />Pluggable Database will be in READ_WRITE openmode after conversion.<br />
local_clone_pluggable_databaseexecpluggableDatabaseId, region, clonedPdbNameif-match, opc-request-id, opc-retry-tokenDeprecated. Use [CreatePluggableDatabase](#/en/database/latest/PluggableDatabase/CreatePluggableDatabase) for Pluggable Database LocalClone Operation.<br />Clones and starts a pluggable database (PDB) in the same database (CDB) as the source PDB. The source PDB must be in the READ_WRITE openMode to perform the clone operation.<br />
refresh_pluggable_databaseexecpluggableDatabaseId, regionif-match, opc-request-id, opc-retry-tokenRefreshes a pluggable database (PDB) Refreshable clone.<br />
remote_clone_pluggable_databaseexecpluggableDatabaseId, region, clonedPdbName, targetContainerDatabaseId, sourceContainerDbAdminPasswordif-match, opc-request-id, opc-retry-tokenDeprecated. Use [CreatePluggableDatabase](#/en/database/latest/PluggableDatabase/CreatePluggableDatabase) for Pluggable Database RemoteClone Operation.<br />Clones a pluggable database (PDB) to a different database from the source PDB. The cloned PDB will be started upon completion of the clone operation. The source PDB must be in the READ_WRITE openMode when performing the clone.<br />For Exadata Cloud@Customer instances, the source pluggable database (PDB) must be on the same Exadata Infrastructure as the target container database (CDB) to create a remote clone.<br />
start_pluggable_databaseexecpluggableDatabaseId, regionif-match, opc-request-id, opc-retry-tokenStarts a stopped pluggable database. The openMode value of the pluggable database will be READ_WRITE upon completion.
stop_pluggable_databaseexecpluggableDatabaseId, regionif-match, opc-request-id, opc-retry-tokenStops a pluggable database. The openMode value of the pluggable database will be MOUNTED upon completion.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
pluggableDatabaseIdstringThe database [OCID](/Content/General/Concepts/identifiers.htm).
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
compartmentIdstringThe compartment [OCID](/Content/General/Concepts/identifiers.htm).
databaseIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the database.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
lifecycleStatestringA filter to return only resources that match the given lifecycle state exactly.
limitintegerThe maximum number of items to return per page.
opc-request-idstringUnique identifier for the request.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringThe pagination token to continue listing from.
pdbNamestringA filter to return only pluggable databases that match the entire name given. The match is not case sensitive.
sortBystringThe field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for PDBNAME is ascending. The PDBNAME sort order is case sensitive.
sortOrderstringThe sort order to use, either ascending (ASC) or descending (DESC).

SELECT examples​

Gets information about the specified pluggable database.

SELECT
id,
compartmentId,
connectionStrings,
containerDatabaseId,
definedTags,
freeformTags,
isRestricted,
lifecycleDetails,
lifecycleState,
openMode,
pdbName,
pdbNodeLevelDetails,
refreshableCloneConfig,
systemTags,
timeCreated
FROM oci.database.pluggable_databases
WHERE pluggableDatabaseId = '{{ pluggableDatabaseId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates and starts a pluggable database in the specified container database.<br />Pluggable Database can be created using different operations (e.g. LocalClone, RemoteClone, Relocate ) with this API.<br />Use the [StartPluggableDatabase](#/en/database/latest/PluggableDatabase/StartPluggableDatabase) and [StopPluggableDatabase](#/en/database/latest/PluggableDatabase/StopPluggableDatabase) APIs to start and stop the pluggable database.<br />

INSERT INTO oci.database.pluggable_databases (
containerDatabaseAdminPassword,
containerDatabaseId,
definedTags,
freeformTags,
pdbAdminPassword,
pdbCreationTypeDetails,
pdbName,
shouldCreatePdbBackup,
shouldPdbAdminAccountBeLocked,
tdeWalletPassword,
region,
opc-retry-token,
opc-request-id
)
SELECT
'{{ containerDatabaseAdminPassword }}',
'{{ containerDatabaseId }}' /* required */,
'{{ definedTags }}',
'{{ freeformTags }}',
'{{ pdbAdminPassword }}',
'{{ pdbCreationTypeDetails }}',
'{{ pdbName }}' /* required */,
{{ shouldCreatePdbBackup }},
{{ shouldPdbAdminAccountBeLocked }},
'{{ tdeWalletPassword }}',
'{{ region }}',
'{{ opc-retry-token }}',
'{{ opc-request-id }}'
RETURNING
id,
compartmentId,
connectionStrings,
containerDatabaseId,
definedTags,
freeformTags,
isRestricted,
lifecycleDetails,
lifecycleState,
openMode,
pdbName,
pdbNodeLevelDetails,
refreshableCloneConfig,
systemTags,
timeCreated
;

UPDATE examples​

Updates the specified pluggable database.

UPDATE oci.database.pluggable_databases
SET
definedTags = '{{ definedTags }}',
freeformTags = '{{ freeformTags }}'
WHERE
pluggableDatabaseId = '{{ pluggableDatabaseId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
compartmentId,
connectionStrings,
containerDatabaseId,
definedTags,
freeformTags,
isRestricted,
lifecycleDetails,
lifecycleState,
openMode,
pdbName,
pdbNodeLevelDetails,
refreshableCloneConfig,
systemTags,
timeCreated;

DELETE examples​

Deletes the specified pluggable database.

DELETE FROM oci.database.pluggable_databases
WHERE pluggableDatabaseId = '{{ pluggableDatabaseId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-request-id = '{{ opc-request-id }}'
;

Lifecycle Methods​

Converts a Refreshable clone to Regular pluggable database (PDB).<br />Pluggable Database will be in READ_WRITE openmode after conversion.<br />

EXEC oci.database.pluggable_databases.convert_to_regular_pluggable_database
@pluggableDatabaseId='{{ pluggableDatabaseId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"containerDatabaseAdminPassword": "{{ containerDatabaseAdminPassword }}",
"shouldCreatePdbBackup": {{ shouldCreatePdbBackup }},
"tdeWalletPassword": "{{ tdeWalletPassword }}"
}'
;