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.

1

2

3

4

5

6

7

[Oracle@rfcg~]$grepdbf/home/oracle/pdb_fina.xml

/u01/app/oracle/oradata/cdb2/pdb_fina/system01.dbf

/u01/app/oracle/oradata/cdb2/pdb_fina/sysaux01.dbf

/u01/app/oracle/oradata/cdb2/pdb_fina/pdb_fina_temp012017-04-04.dbf

/u01/app/oracle/oradata/cdb2/pdb_fina/SAMPLE_SCHEMA_users01.dbf

/u01/app/oracle/oradata/cdb2/pdb_fina/example01.dbf

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.

1

[Oracle@rfcg2~]$mkdir-p/u01/app/oracle/oradata/CDB1/FINA/

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.

1

[Oracle@rfcg~]$mkdir-p/u01/app/oracle/oradata/CDB1/FINA/

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.

1

2

3

4

5

6

7

8

9

10

11

12

13

SQL>alter pluggable database pdb_fina open read write;

Pluggable database altered.

SQL>show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

------------------------------------------------------------

2PDB$SEED READ ONLY NO

3PDB1 READ WRITE NO

4PDB2 READ WRITE NO

5PDB_SERA READ WRITE NO

6PDB_FINA READ WRITE NO|

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.

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.