pluggable_databases
Creates, updates, deletes, gets or lists a pluggable_databases resource.
Overview​
| Name | pluggable_databases |
| Type | Resource |
| Id | oci.database.pluggable_databases |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The pluggable database.
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the pluggable database. |
compartmentId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the compartment. |
connectionStrings | object | Connection strings to connect to an Oracle Pluggable Database. |
containerDatabaseId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the CDB. |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). |
freeformTags | object | Free-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"} |
isRestricted | boolean | The 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. |
lifecycleDetails | string | Detailed message for the lifecycle state. |
lifecycleState | string | The current state of the pluggable database. (PROVISIONING, AVAILABLE, TERMINATING, TERMINATED, UPDATING, FAILED, RELOCATING, RELOCATED, REFRESHING, RESTORE_IN_PROGRESS, RESTORE_FAILED, BACKUP_IN_PROGRESS, DISABLED) |
openMode | string | Deprecated. 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) |
pdbName | string | The 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. |
pdbNodeLevelDetails | array | Pluggable Database Node Level Details. Example: [{"nodeName" : "node1", "openMode" : "READ_WRITE"}, {"nodeName" : "node2", "openMode" : "READ_ONLY"}] |
refreshableCloneConfig | object | Pluggable Database Refreshable Clone Configuration. |
systemTags | object | System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). |
timeCreated | string (date-time) | The date and time the pluggable database was created. |
A pluggable database (PDB) is portable collection of schemas, schema objects, and non-schema objects that appears to an Oracle client as a non-container database. To use a PDB, it needs to be plugged into a CDB.<br />To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, talk to a tenancy administrator. If you are an administrator who needs to write policies to give users access, see [Getting Started with Policies](/Content/Identity/Concepts/policygetstarted.htm).<br /><br />Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the pluggable database. |
compartmentId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the compartment. |
connectionStrings | object | Connection strings to connect to an Oracle Pluggable Database. |
containerDatabaseId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the CDB. |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). |
freeformTags | object | Free-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"} |
isRestricted | boolean | The 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. |
lifecycleDetails | string | Detailed message for the lifecycle state. |
lifecycleState | string | The current state of the pluggable database. (PROVISIONING, AVAILABLE, TERMINATING, TERMINATED, UPDATING, FAILED, RELOCATING, RELOCATED, REFRESHING, RESTORE_IN_PROGRESS, RESTORE_FAILED, BACKUP_IN_PROGRESS, DISABLED) |
openMode | string | Deprecated. 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) |
pdbName | string | The 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. |
pdbNodeLevelDetails | array | Pluggable Database Node Level Details. Example: [{"nodeName" : "node1", "openMode" : "READ_WRITE"}, {"nodeName" : "node2", "openMode" : "READ_ONLY"}] |
refreshableCloneConfig | object | Pluggable Database Refreshable Clone Configuration. |
systemTags | object | System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). |
timeCreated | string (date-time) | The date and time the pluggable database was created. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | pluggableDatabaseId, region | Gets information about the specified pluggable database. | |
list | select | region | compartmentId, databaseId, limit, page, sortBy, sortOrder, lifecycleState, pdbName | Gets a list of the pluggable databases in a database or compartment. You must provide either a databaseId or compartmentId value.<br /> |
create | insert | region, pdbName, containerDatabaseId | opc-retry-token, opc-request-id | 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 /> |
update | update | pluggableDatabaseId, region | if-match | Updates the specified pluggable database. |
delete | delete | pluggableDatabaseId, region | if-match, opc-request-id | Deletes the specified pluggable database. |
convert_to_regular_pluggable_database | exec | pluggableDatabaseId, region | if-match, opc-request-id, opc-retry-token | Converts a Refreshable clone to Regular pluggable database (PDB).<br />Pluggable Database will be in READ_WRITE openmode after conversion.<br /> |
local_clone_pluggable_database | exec | pluggableDatabaseId, region, clonedPdbName | if-match, opc-request-id, opc-retry-token | Deprecated. 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_database | exec | pluggableDatabaseId, region | if-match, opc-request-id, opc-retry-token | Refreshes a pluggable database (PDB) Refreshable clone.<br /> |
remote_clone_pluggable_database | exec | pluggableDatabaseId, region, clonedPdbName, targetContainerDatabaseId, sourceContainerDbAdminPassword | if-match, opc-request-id, opc-retry-token | Deprecated. 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_database | exec | pluggableDatabaseId, region | if-match, opc-request-id, opc-retry-token | Starts a stopped pluggable database. The openMode value of the pluggable database will be READ_WRITE upon completion. |
stop_pluggable_database | exec | pluggableDatabaseId, region | if-match, opc-request-id, opc-retry-token | Stops 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.
| Name | Datatype | Description |
|---|---|---|
pluggableDatabaseId | string | The database [OCID](/Content/General/Concepts/identifiers.htm). |
region | string | OCI 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) |
compartmentId | string | The compartment [OCID](/Content/General/Concepts/identifiers.htm). |
databaseId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the database. |
if-match | string | For 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. |
lifecycleState | string | A filter to return only resources that match the given lifecycle state exactly. |
limit | integer | The maximum number of items to return per page. |
opc-request-id | string | Unique identifier for the request. |
opc-retry-token | string | A 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). |
page | string | The pagination token to continue listing from. |
pdbName | string | A filter to return only pluggable databases that match the entire name given. The match is not case sensitive. |
sortBy | string | The 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. |
sortOrder | string | The sort order to use, either ascending (ASC) or descending (DESC). |
SELECT examples​
- get
- list
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
;
Gets a list of the pluggable databases in a database or compartment. You must provide either a databaseId or compartmentId value.<br />
SELECT
id,
compartmentId,
connectionStrings,
containerDatabaseId,
definedTags,
freeformTags,
isRestricted,
lifecycleDetails,
lifecycleState,
openMode,
pdbName,
pdbNodeLevelDetails,
refreshableCloneConfig,
systemTags,
timeCreated
FROM oci.database.pluggable_databases
WHERE region = '{{ region }}' -- required
AND compartmentId = '{{ compartmentId }}'
AND databaseId = '{{ databaseId }}'
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND lifecycleState = '{{ lifecycleState }}'
AND pdbName = '{{ pdbName }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: pluggable_databases
props:
- name: region
value: "{{ region }}"
description: Required parameter for the pluggable_databases resource.
- name: containerDatabaseAdminPassword
value: "{{ containerDatabaseAdminPassword }}"
description: |
The DB system administrator password of the Container Database.
- name: containerDatabaseId
value: "{{ containerDatabaseId }}"
description: |
The [OCID](/Content/General/Concepts/identifiers.htm) of the CDB
- name: definedTags
value: "{{ definedTags }}"
description: |
Defined tags for this resource. Each key is predefined and scoped to a namespace.
For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Free-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"}`
- name: pdbAdminPassword
value: "{{ pdbAdminPassword }}"
description: |
A strong password for PDB Admin. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numbers, and two special characters. The special characters must be _, #, or -.
- name: pdbCreationTypeDetails
description: |
The Pluggable Database creation type.
Use `LOCAL_CLONE_PDB` for creating a new PDB using Local Clone on Source Pluggable Database. This will Clone 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.
sourcePluggableDatabaseSnapshotId and
isThinClone options are supported for Exadata VM cluster on Exascale Infrastructure, Exadata Cloud@Customer VM Cluster on Exadata Cloud@Customer infrastructure, and Exadata Cloud VM cluster on cloud Exadata infrastructure
Use `REMOTE_CLONE_PDB` for creating a new PDB using Remote Clone on Source Pluggable Database. This will Clone 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.
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.
sourcePluggableDatabaseSnapshotId and
isThinClone options are supported for Exadata VM cluster on Exascale Infrastructure, Exadata Cloud@Customer VM Cluster on Exadata Cloud@Customer infrastructure, and Exadata Cloud VM cluster on cloud Exadata infrastructure.
Use `RELOCATE_PDB` for relocating the Pluggable Database from Source CDB and creating it in target CDB. This will relocate a
pluggable database (PDB) to a different database from the source PDB. The source PDB must be in the `READ_WRITE` openMode when
performing the relocate.
value:
creationType: "{{ creationType }}"
- name: pdbName
value: "{{ pdbName }}"
description: |
The 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.
- name: shouldCreatePdbBackup
value: {{ shouldCreatePdbBackup }}
description: |
Indicates whether to take Pluggable Database Backup after the operation.
- name: shouldPdbAdminAccountBeLocked
value: {{ shouldPdbAdminAccountBeLocked }}
description: |
The locked mode of the pluggable database admin account. If false, the user needs to provide the PDB Admin Password to connect to it.
If true, the pluggable database will be locked and user cannot login to it.
default: false
- name: tdeWalletPassword
value: "{{ tdeWalletPassword }}"
description: |
The existing TDE wallet password of the CDB.
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: A 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).
description: A 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).
- name: opc-request-id
value: "{{ opc-request-id }}"
description: Unique identifier for the request.
description: Unique identifier for the request.
UPDATE examples​
- update
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​
- delete
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​
- convert_to_regular_pluggable_database
- local_clone_pluggable_database
- refresh_pluggable_database
- remote_clone_pluggable_database
- start_pluggable_database
- stop_pluggable_database
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 }}"
}'
;
Deprecated. 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 />
EXEC oci.database.pluggable_databases.local_clone_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=
'{
"clonedPdbName": "{{ clonedPdbName }}",
"pdbAdminPassword": "{{ pdbAdminPassword }}",
"shouldPdbAdminAccountBeLocked": {{ shouldPdbAdminAccountBeLocked }},
"targetTdeWalletPassword": "{{ targetTdeWalletPassword }}"
}'
;
Refreshes a pluggable database (PDB) Refreshable clone.<br />
EXEC oci.database.pluggable_databases.refresh_pluggable_database
@pluggableDatabaseId='{{ pluggableDatabaseId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
;
Deprecated. 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 />
EXEC oci.database.pluggable_databases.remote_clone_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=
'{
"clonedPdbName": "{{ clonedPdbName }}",
"pdbAdminPassword": "{{ pdbAdminPassword }}",
"shouldPdbAdminAccountBeLocked": {{ shouldPdbAdminAccountBeLocked }},
"targetTdeWalletPassword": "{{ targetTdeWalletPassword }}",
"sourceContainerDbAdminPassword": "{{ sourceContainerDbAdminPassword }}",
"targetContainerDatabaseId": "{{ targetContainerDatabaseId }}"
}'
;
Starts a stopped pluggable database. The openMode value of the pluggable database will be READ_WRITE upon completion.
EXEC oci.database.pluggable_databases.start_pluggable_database
@pluggableDatabaseId='{{ pluggableDatabaseId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
;
Stops a pluggable database. The openMode value of the pluggable database will be MOUNTED upon completion.
EXEC oci.database.pluggable_databases.stop_pluggable_database
@pluggableDatabaseId='{{ pluggableDatabaseId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
;