I must thank my fellow DBA César Aguilar and Joel Pérez for his publication in Spanish OTN.

In previous article: Oracle Data Guard 12c in “Multitenant” Architecture: Behavior of PDBs (Part I) we observed how the process of configuration Data Guard 12c in multitenant architecture is reduced, simplifying thus habitual tasks of the previous versions to 12c, we had a Scenario 1 in which we proceeded to create a new plug-in database PDB_SERA in CDB1 and checked how it automatically was part of the configuration.

In the following article, we will continue analyzing the behavior of pluggable databases in Oracle Data Guard12c and the respective advantages of these in a multitenant architecture.

We will propose the following objective and scenario:

Scenario 1:

“Unplug” a PDB_FINA pluggable database from a CDB2 container database in which there is no Data Guard configuration, and then plug it into the container database CDB1 with Data Guard configured.

We will create a user in the pluggable PDB_FINA named “ca”, in this user will create a table with a record.

We will configure the “Active Data Guard” option and check the availability of the objects created in the pluggable PDB_FINA in the standby container.

Usage Tool: SQL * Plus

Our test environment:

  • A CDB1 database with Data Guard configured which has three pluggable databases: PDB1, PDB2 and PDB_SERA.
  • We will now have a CDB2 container in which there is no Data Guard configuration with a pluggable database called PDB_FINA, both container databases (CDB1 and CDB2) reside on the same server and the standby database CDB1 that is part of the Data Guard.

Scenario 1:

We will disconnect the PDB_FINA pluggable database from the CDB2 container.

We checked the location of the datafiles of the PDB_FINA pluggable database; This can be obtained from the generated xml file.

When creating a new pluggable in the primary container as seen in the article Oracle Data Guard 12c in “Multitenant” Architecture: PDBs behavior (Part I) the datafiles of the new pluggable are automatically created in the standby container and the process Synchronization is transparent, however the behavior of the pluggable is different in the Data Guard when plugging a pluggable into the primary container, the datafiles of the pluggable must be copied to the primary container and the standby container before being plugged in.

Previously you should create the directory where the datafiles of the pluggable PDB_FINA will be located.

We proceed to copy the datafiles of the PDB_FINA pluggable database to the standby server

In the primary server where the CDB1 is located, we also create the directory in which the datafiles of the pluggable PDB_FINA database will be located.

We enter the CDB1, we will proceed to connect the pluggable PDB_FINA, we use the parameter “copy” to copy the datafiles of the pluggable PDB_FINA to the CDB1 of the Data Guard and the parameter “file_name_convert” because the directories between the containers CDB1 and CDB2 are Different.

After connecting the PDB_FINA to the CDB1, we proceed to place it in reading and writing mode.

We enter the pluggable PDB_FINA of the primary container and create a user named “ca”, with this user we will create a table with a register and then we will verify that these objects are available in the pluggable PDB_FINA of the standby container.

We create the user “ca” in PDB_FINA of the primary container.

We enter the pluggable PDB_FINA with the user “ca”, create a table called “clients” and add a record.

We enter the standby server where we have the CDB1.

As we can see, listing the pluggable databases of our standby server is already the PDB_FINA as part of the Data Guard solution; The pluggable PDB_FINA is in the “mount” state.

We proceed to open the pluggables in read and write mode and we would have the configuration of an “Active Data Guard”

Enter the PDB_FINA of the standby container and verify that the record created in the client’s table is available.

Conclusion:

As you can see, when we have a configuration with Oracle Data Guard in “Multitenant” architecture, the mechanism of obtaining a database “Standby” of a PDB is quite simple, we just have to add the same to the primary “container”, depending Of the case we will have to copy the datafiles to the standby server (s) and complete the “plug” process, one of the main advantages of this architecture is that we can have the corresponding “Standby “Without reconfiguring the solution.

Leave a Reply