About Pluggable Databases
This article provides details about pluggable databases and managing their various features, such as backup, restore, relocate, and clone.
The multitenant architecture enables an Oracle Database to be a container database. A container database (CDB) contains one or more user-created, pluggable databases and application containers. A pluggable database (PDB) is a portable collection of schemas, schema objects, and nonschema objects that appears to an application as a separate database. At the physical level, each pluggable database has its own set of data files that store the data for the pluggable database. The container database includes all the data files for the pluggable databases contained within it and a set of system data files that store metadata for the container database itself.
Oracle 19c or later databases created in a DB system include an initial pluggable database that you can access from the database details page in the OCI Console. Using the OCI Console or APIs, you can start, stop, clone, and delete pluggable databases. You can also create additional pluggable databases in the container database. All pluggable database operations performed using the OCI Console or APIs can be monitored using the work request generated by the operation. For more information, see Work Requests.
You can create and manage pluggable databases in the DB system using the OCI Console and APIs.
Note:
Generally, the term 'database' refers to the container database (CDB).Related Topics
Create
You can have more than one pluggable database in a pluggable database. Pluggable databases must be created one at a time, and creating a new pluggable database has no effect on existing pluggable databases in the pluggable database.
To create a pluggable database using the OCI Console, see Create a Pluggable Database.
Restore
A pluggable database can be restored from a backup. The following two types of restore are supported:
- Out-of-place restore: You can restore a pluggable database by creating a container database from the backup, then selecting a pluggable database or a subset of them you want to restore on the new database.
- In-place restore: You can restore a pluggable database within the same container database to its last known good state or to a specified timestamp.
You can perform an in-place restore when you want to move a pluggable database back to a specified state or time. Both the container database and pluggable database must be up and running, and only one pluggable database can be restored at a time.
- If you have multiple pluggable databases in your container database and want to restore multiple of them to the same container database, then you could restore each individual pluggable database, one pluggable database at a time, from the container database backup.
- When the container database is down, you can restore the complete container database, and all the pluggable databases in that container database will also be restored.
- You could either restore the database to the specified time stamp or to its last known good state.
To restore a pluggable database using the OCI Console, see Restore a Pluggable Database.
Relocate
You can relocate a pluggable database from one container database to another container database within the same availability domain (AD) to the same or a later database version across compartments, DB systems, or VCNs. If two different VCNs are used, then both VCNs must be peered before relocating. During relocation, the pluggable database will be removed from the source container database and moved to the destination container database that is up and running. In a Data Guard association, a pluggable database relocated to the primary will be synchronized with the standby as well.
To relocate a pluggable database using the OCI Console, see Relocate a Pluggable Database.
Clone
A clone is an independent and complete copy of the given database as it existed at the time of the cloning operation. You can create clones of your pluggable database within the same container database or a different container database and refresh the cloned pluggable database.
- Local clone: A copy of the pluggable database is created within the same container database.
- Remote clone: A copy of the pluggable database is created on a different container database.
You can perform a remote clone of a pluggable database from one container database to another container database within the same availability domain (AD) to the same or a later database version across compartments, DB systems, or VCNs. If two different VCNs are used, then both VCNs must be peered before cloning.
- Refreshable clone: A copy of the pluggable database is created on a different container database, and you will be able to refresh the cloned pluggable database.
You can perform a refreshable clone of a pluggable database from one container database to another container database within the same availability domain (AD) to the same or a later database version across compartments, DB systems, or VCNs. If two different VCNs are used, then both VCNs must be peered before cloning.
To clone a pluggable database using the OCI Console, see Clone a Pluggable Database.
Refreshable Clone
A refreshable clone enables you to keep your remote clone updated with the source pluggable database.
- You can only refresh while the pluggable database is in mount mode.
- The only open mode you can have is read-only, and refresh cannot be performed while it is in read-only mode.
- A database link user credential is required for creating a refreshable clone.
- Clone, relocate, and in-place restore operations are not supported in the refreshable clone. Relocate and in-place restore operations are not supported in the source, and the source can only be deleted after disconnecting or deleting the refreshable clone.
- When cloning a pluggable database from 19c to 23ai, the cloned pluggable database is automatically upgraded to 23ai. For example, if you use refreshable clones to clone to 23ai and then convert it to a regular pluggable database, all necessary upgrade steps are automatically handled, converting the refreshable clone into a fully upgraded 23ai pluggable database.
- In a Data Guard association, a refreshable clone cannot be created on standby, but it can be created on the primary. However, the primary will not be synced to the standby.
- A pluggable database in standby cannot be used as the source for a refreshable pluggable database.
To create a refreshable clone using the OCI Console, see Clone a Pluggable Database.
To refresh a clone using the OCI Console, see Refresh a Pluggable Database.
Convert Refreshable Clone to Regular Pluggable Database
You can convert a refreshable clone to a regular pluggable database by disconnecting the refreshable clone (destination pluggable database) from the source pluggable database at any time. If the refresh pluggable database is in a Data Guard association, when it is converted to a regular pluggable database, then the pluggable database will be synced to the standby as part of the conversion process.
To convert a pluggable database using the OCI Console, see Convert a Refreshable Clone to a Regular Pluggable Database.
SQL Worksheets
The SQL Worksheet provides a web-based SQL workspace where you can enter SQL statements directly in the browser using a database connection. From the SQL Worksheet, you can run SQL statements or scripts against the database and create database objects.
You need to create a connection to use the SQL Worksheet. The SQL Worksheet utilizes the connection you create with the service to provide you the ability to run SQL commands and scripts from the Console. Scripts used in the SQL Worksheet can reside in either OCI Object Storage or on your local drive. Using the Connection selection menu, you can change the connection that the SQL Worksheet is using instantly.
Connections are resources that contain the necessary information for accessing an Oracle Database in OCI. Connections are created by simply providing information about the location of the database. The connection also contains the user used to access the database and the location of the password that is stored in the OCI Vault.
To create a connection, launch and use the SQL worksheet using the OCI Console, see SQL Worksheets.
Backup
You can take a backup of the pluggable database optionally during create, clone, or relocate operations when the container database is configured with the auto-backup feature. The pluggable database backup destination will always be the same as the container database, and the backups cannot be accessed directly or created on demand. Oracle recommends immediately backing up the pluggable database after you create or clone it. This is because the pluggable database will not be recoverable until the next daily auto-backup completes successfully, leading to a possible data loss.
Open Modes
On the OCI Console, you can see the open modes of a pluggable database, such as read-write, read-only, and mounted. If the pluggable database status is the same across all nodes, the system displays the same status for all pluggable databases. If the pluggable database statuses are different across the nodes, the system displays a message indicating on which nodes the pluggable databases are opened in read-write mode. You cannot change the open mode of a pluggable database through the API or OCI Console. However, you can start or stop a pluggable database. Starting the pluggable database will start it in read-write mode. Stopping the pluggable database will close it, and it will remain in mount mode.
Limitations of Pluggable Database Management
- New pluggable databases created with SQL are not immediately discovered and displayed in the OCI Console. However, OCI performs sync operations regularly to discover manually created pluggable databases, and they should be visible in the OCI Console and API-based tools within 6 hours of creation. Oracle recommends using the OCI Console or API-based tools (including the OCI CLI, SDKs, and Terraform) to create pluggable databases.
- Pluggable database operations are supported only for databases using Oracle Database 19c and later.
- Pluggable databases are backed up at the container database level, and each backup includes all the pluggable databases in the container database. OCI does not support the creation of backups for individual pluggable databases.