With the wider adoption of Oracle container databases and the impending de-support of non-container database coming with Oracle Database 20c, it is well worth considering how this will impact your standby databases and Disaster Recovery (DR) environments.
The good news is that overall, the principle of standby databases has not changed significantly but there are a few key points that need to be understood to manage standby databases in the multi-tenant architecture effectively. There are also a few new features that will help with standby database management.
First, let's consider that all Pluggable databases in a container share the same instance components
So, bearing those in mind, how do we protect a pluggable database (PDB) with a Standby database? For the most part, as we did before with a few key clarifications:
Let's walk through a quick example. Once we have our primary container setup with the PDB's we can start thinking about setting up a standby container database.
When using Multi-tenant, the standby is setup at the container level and then all PDB's are protected if you choose them to be. So first we need to set up the CDB with a standby, mostly as we did with non CDB:
From Primary node: sqlplus sys@CNTDB2 as sysdba
From Standby node: sqlplus sys@CNTDB1 as sysdba
13. Start the Physical Standby Database (nomount)
14. Restore the backup
rman target /
restore standby controlfile from '/oracle/app/oracle/recovery_area/CNTDB1/CNTDB1_standby.ctl';
alter database mount;
restore database;
sqlplus / as sysdba
15. Start Standby log apply
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
16. Verify the Physical Standby Database Is Performing Properly
SELECT ROLE, THREAD#, SEQUENCE#, ACTION FROM V$DATAGUARD_PROCESS;
So now we have a standby container DB let's check on the PDB's
set lines 100
column name format a20
SELECT name, open_mode FROM v$pdbs;
NAME OPEN_MODE
-------------------- ----------
PDB$SEED MOUNTED
PDB1 MOUNTED
SQL> SELECT DB_UNIQUE_NAME, OPEN_MODE, DATABASE_ROLE from v$database;
DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
------------------------------ -------------------- ----------------
CNTDB2 MOUNTED PHYSICAL STANDBY
SELECT name, open_mode FROM v$pdbs;
NAME OPEN_MODE
-------------------- ----------
PDB$SEED READ ONLY
PDB1 MOUNTED
Note that the PDB Name matches the primary PDB Name (PDB1)
Given the fact the role is set at the container level, we cannot add a distinct PDB to the standby container without it already having an associated Primary PDB in the Primary CDB. When we add a Primary PDB, we can select at that point whether it is protected by a standby or not. Note that we can also add/remove the standby out with this operation as indeed we did above.
This can be done in one step by either creating a new database or cloning from an existing PDB
SQL > CREATE PLUGGABLE DATABASE TESTPDB2 ADMIN USER PDMADMIN IDENTIFIED BY ******* STANDBYS=('CNTDB2');
This is great as it creates a new PDB (Based on the seed database) and also creates a standby database in the standby container
SQL> CREATE PLUGGABLE DATABASE TESTPDB3 FROM PDB1 STANDBYS=('CNTDB2');
Again, we get a new Primary and standby in one statement very cool!
We do not do this very often but when building a new database, it is a good idea to switch over the roles to ensure that the archivelogs can be sent and applied between the DR and primary sites. As mentioned earlier, this is done at the container database level, and all PDB's are switched.
PRIMARY CDB
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
STARTUP MOUNT;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
NEW PRIMARY (CNTDB2)
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
ALTER DATABASE OPEN;
ALTER PLUGGABLE DATABASE ALL OPEN;
Switch Back using the same process as above.
Snapshot standby is a really great feature of Dataguard and can be used for reporting databases, DR tests, production destructive testing, etc so let’s make sure it still works in 19c! Again, this is done at the Container level with all PDB's affected.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
ALTER DATABASE OPEN;
So, all in all, yes it works largely the same way except that it is all done at container level so all PDB's are converted to snapshot standby at the same time.
These are the changes in Oracle Data Guard Concepts and Administration for Changes in Oracle Database Release 18c, Version 18.1.
Read our latest blog about upgrading your Database to Oracle 19c, and the risk of being unsupported if you don't.
Technical considerations for EBS 12.2.9 and Oracle DB 19c Upgrades
Oracle 19c new features
Oracle 19c Database Upgrade
Upgrade to Oracle 19c now, or face the risk of being unsupported
Oracle® Data Guard Concepts and Administration 19c E96244-03
Data Guard Impact on Oracle Multitenant Environments (Doc ID 2049127.1)
If you are looking for an Oracle partner who can help you with your Oracle Managed Services and goes about it the right way and can back up the talk, then contact us. If you would like to find out more about the E-Business Suite updates or have a question, you can email us at info@claremont.co.uk or phone us on +44 (0) 1483 549004