904 Bedford St, New York NY 10014

(+1) 5184-453-1514

Open Order for PDBs- Containers and Pluggables

New in 23c, you can define an open order for the PDBs. This gives priority to mission-critical PDBs so that they are started first. The priority is for opening and upgrades. Priority values are lower to higher values, with the lower values being processed first. Values can be the same but will be processed in any order with the same value. Priorities will not be copied from source to target PDBs by plug/unplug or refreshable clones.

To change the priority value, use the ALTER PLUGGABLE DATABASE … PRIORITY statement. Values are between 1 and 4096.

SQL> alter pluggable database mmpdb priority 1; SQL> select con_id, priority from v$pdbs;

Starting/Stopping a PDB

From the root container, you can change the open mode of a PDB with the following:

SQL> alter pluggable database salespdb open;

As we discussed in the previous section, you can change the state of the PDB:

SQL> startup pluggable database salespdb open read only;

You can also open or close all pluggables, which will follow the open order with the priority you have set for the PDBs.

SQL> alter pluggable database all open;

SQL> alter pluggable database all close immediate;

From the pluggable database, connect as SYS, and this will look similar to the CDB commands to start and shut down:

$ sqlplus pdbsys/Cr4zyPa$$word1@mm23c:1521/salespdb as sysdba SQL> startup;

To shut down the PDB database when connected to it, use the following command:

SQL> shutdown immediate;

Creating a Pluggable Database Within a CDB

After you have created a CDB, you can start creating PDBs within it. When you instruct Oracle to create a PDB, under the covers it actually copies files from an existing database (seed, PDB, or non-CDB, database instance, which is available in previous versions from 19c and lower) and then builds the new PDB’s metadata in the CDB. The key here is to correctly reference what database you want Oracle to use as a template for creating the
new PDB.
There are several tools for creating (cloning) a PDB, namely, the CREATE PLUGGABLE DATABASE SQL statement, the DBCA utility, and Enterprise Manager Cloud Control. If you understand how to create PDBs using SQL and DBCA, you should easily be able to use the Enterprise Manager screens to achieve the same objectives.
With the CREATE PLUGGABLE DATABASE statement, you can use any of the following sources to create a PDB:

• Seed database

• Existing PDB (either local or remote)

• Non-CDB database

• Unplugged PDB

With the DBCA, you can create a PDB from any of the following sources:

• Seed database

• RMAN backup

• Unplugged PDB

In the following sections, all the CREATE PLUGGABLE DATABASE variants of creating a PDB are covered. With the DBCA, we already created a PDB with the CDB, and you can also create the new PDB from the seed database. You should be able to modify that example for your various needs.

Search

Popular Posts

  • Recovery Catalog Versions – RMAN Backups and Reporting
    Recovery Catalog Versions – RMAN Backups and Reporting

    I recommend that you create a recovery catalog for each version of the target databases that you are backing up. Doing so will save you some headaches with compatibility issues and upgrades. I have found it easier to use a recovery catalog when the database version of the rman client is the same version used…

  • Registering a Target Database – RMAN Backups and Reporting
    Registering a Target Database – RMAN Backups and Reporting

    Now, you can register a target database with the recovery catalog. Log in to the target database server. Ensure that you can establish connectivity to the recovery catalog database. For instance, one approach is to populate the TNS_ADMIN/tnsnames.ora file with an entry that points to the remote database. On the target database server, register the…

  • Creating a Recovery Catalog – RMAN Backups and Reporting
    Creating a Recovery Catalog – RMAN Backups and Reporting

    When I use a recovery catalog, I prefer to have a dedicated database that is used only for the recovery catalog. This ensures that the recovery catalog is not affected by any maintenance or downtime required by another application (and vice versa). Listed next are the steps for creating a recovery catalog: 1. Create a…

Tags