SlideShare une entreprise Scribd logo
Hot Clone a remote PDB in Data Guard Environments using Transient no-standby PDBs
Introduction
Oracle Multitenant is integrated with Oracle Data Guard. Data Guard is configured at the CDB level and will
replicate all transactions from the primary to the standby for all PDBs in a single stream, including creating
and deleting PDBs. But!
When we create a new PDB, which is a clone from PDB$SEED, or create a local clone, the data files of the
source PDB are already present on the standby site, and hence, the operation replays successfully on the
standby database too.
However, when creating a remote clone, the source data files are only present on the remote CDB but not
on the standby site. The remote clone operation will succeed on the primary but leave you with no data files
on standby.
In this blog post, we will discuss a solution using “transient no-standby PDB” to overcome this challenge.
The Environment
We will use the following:
• Source: Single Instance Database version 19.12, using Multitenant, TDE encrypted, and WE8CED
character set. Database unique name is CDBWE8_fra3s6.
• Target: RAC Database version 19.12 in Active Data Guard configuration, using Multitenant, TDE
encrypted, and AL32UTF8 character set.
• Primary database unique name is RACCDB_AD1.
• Standby database unique name is RACCDB_fra2xr.
The same procedure applies to single-instance and RAC databases as source or target.
The target database doesn’t need to use Active Data Gaurd either. The same applies to Data Guard.
However, the CDB$ROOT needs to be open in read-only mode on standby. In Oracle database version 19c,
the Active Data Guard option license is not required when only the CDB$ROOT is open read-only on
standby.
Oracle Database version 21c
In 21c, a new feature called PDB Recovery Isolation was introduced. With that, a hot clone operation does
not require any further manual steps.
PDB Recovery Isolation requires the Active Data Guard option.
On the Source Database
Step 1: Prepare the C##SYSOPER user on the Source Database
Grant the C##SYSOPER user the required privileges to be used for the database link:
SQL> grant create session, sysoper to C##SYSOPER identified by WElcome123## container=all;
Grant succeeded.
On the Target Primary Database
Step 2: Create Database Link from Target to Source
Create a database link on the target primary database pointing to the source database:
SQL> create database link DBLINK_TO_WE8 connect to C##SYSOPER identified by WElcome123## using
'<connection_string_to_source_database>';
Database link created.
As we are not using a database link with the same name as the database it connects to, we need to
additionally set the global_names parameter to false:
SQL> alter system set global_names=false scope=both sid='*';
System altered.
Step 3: Create a Remote Hot Clone PDB from the Source Database
Use the database link from the previous step to create a hot clone from the source PDB, however providing
the STANDBYS=NONE clause, so the clone PDB will only exist on the primary database, but not on the
standby. This is not our final clone, but just a “transient” one. This is why it’s called “transient no-standby
PDB“.
SQL> create pluggable database TRANSPDB from PDBWE8@DBLINK_TO_WE8 keystore identified by
"WElcome123##" STANDBYS=NONE;
Pluggable database created.
SQL> alter pluggable database TRANSPDB open instances=all;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ----------------- ----------
2 PDB$SEED READ ONLY NO
3 RACPDB READ WRITE NO
4 TRANSPDB READ WRITE NO
Now, if you check the standby site, you’ll see the transient PDB in “MOUNTED” mode, but there are no data
files associated with it:
-- on the standby
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ---------- ---------------
2 PDB$SEED READ ONLY NO
3 RACPDB READ ONLY NO
4 TRANSPDB MOUNTED
SQL> select name from v$datafile where con_id=4;
NAME
--------------------------------------------------------------
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00044
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00045
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00046
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00047
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00048
/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00049
Step 4: Create a self-referencing Database Link on the Primary Database
On the target primary, grant the C##SYSOPER user the required privileges and create a database link using
the connection string of the primary itself:
SQL> grant create session, sysoper to C##SYSOPER identified by WElcome123## container=all;
Grant succeeded.
SQL> create database link DBLINK_TO_PRIM connect to C##SYSOPER identified by WElcome123##
using '<connection_string_of_primary>';
Database link created.
This operation will be replicated via Data Guard redo-apply on the standby database, so we have a
database link on the standby pointing to the primary. This IS COOL!
As the database link on standby is not using the exact name of the database is connecting to, we need to
set global_names in the standby database to false:
-- on standby
SQL> alter system set global_names=false scope=both sid='*';
System altered.
On the Standby Database
Step 5: Set standby_pdb_source_file_dblink on Standby
On the standby database, set the standby_pdb_source_file_dblink parameter to the name of the database
link created in step 4:
SQL> alter system set standby_pdb_source_file_dblink=DBLINK_TO_PRIM scope=both sid='*';
System altered.
This parameter specifies the name of the database link that will automatically be used in the next step to
copy the data files from the primary to standby during a local clone operation.
Back to the Primary Database
Step 6: Create a Local Cold Clone from the Transient PDB
On the primary database, set the transient PDB in read-only mode, and create a clone of it, this time using
STANDBYS=ALL:
SQL> alter pluggable database TRANSPDB close immediate instances=all;
Pluggable database altered.
SQL> alter pluggable database TRANSPDB open read only instances=all;
Pluggable database altered.
SQL> create pluggable database FINALPDB from TRANSPDB keystore identified by "WElcome123##"
STANDBYS=ALL;
Pluggable database created.
-- open thenew PDB
SQL> alter pluggable database FINALPDB open instances=all;
Pluggable database altered.
-- on the standby
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 RACPDB READ ONLY NO
4 TRANSPDB MOUNTED
5 FINALPDB MOUNTED
SQL> select name from v$datafile where con_id=5;
NAME
-----------------------------------------------------------------------------------------
+DATA/RACCDB_FRA2XR/C9A7E2196EE27681E0531F02640A18C1/DATAFILE/system.280.1089037503
+DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/sysaux.281.1089037509
+DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/undotbs1.282.1089037513
+DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/users.283.1089037515
+DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/we8tbs.284.1089037515
+DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/undo_2.285.1089037517
This time, the new PDB clone is created with all data files as on the primary, as the data files have been
copied over the database link created in step 4. This is our final PDB.
However, suppose you use local software wallets to manage the TDE master encryption keys instead of
Oracle Key Vault (OKV) or OCI Vault in Oracle Cloud. In that case, the Data Guard Redo Apply will stop
after opening the PDB, as the standby does not have access to the TDE key of the newly cloned PDB:
dgmgrl
DGMGRL> connect sys;
DGMGRL> show configuration;
Configuration - RACCDB_AD1_RACCDB_fra2xr
Protection Mode: MaxPerformance
Members:
RACCDB_AD1 - Primary database
RACCDB_fra2xr - Physical standby database
Error: ORA-16810: multiple errors or warnings detected for the member
Fast-Start Failover: Disabled
Configuration Status:
ERROR (status updated 37 seconds ago)
If your source PDB did not have a TDE key, then Redo Apply will stop once you create a new one as
described in the next step.
Step 7: Create a new TDE Key for the Final PDB
After cloning an encrypted PDB, do not continue using the same key of the source PDB, but create a new
TDE master encryption key for the newly cloned PDB instead:
SQL> alter session set container=FINALPDB;
Session altered.
SQL> administer key management set key force keystore identified by WElcome123## with backup;
keystore altered.
Step 8: Copy the TDE Wallet Files to the Standby Site
Copy the TDE wallet files from the primary to the standby server:
scp -p /opt/oracle/dcs/commonstore/wallets/tde/RACCDB_AD1/*wallet.*
oracle@<standby_server>:/opt/oracle/dcs/commonstore/wallets/tde/RACCDB_fra2xr/
cwallet.sso 100% 9432 5.8MB/s 00:00
ewallet.p12 100% 9387 8.3MB/s 00:00
For the new keys to get recognized by the standby database, we need to close and re-open the key store on
the standby database:
-- on the standby
SQL> administer key management set keystore close container=ALL;
keystore altered.
-- key store will open automatically as soon as we query the v$encryption_wallet view
SQl> select p.con_id, p.name, p.open_mode, ew.wrl_type, ew.wallet_type, ew.status
from v$pdbs p join v$encryption_wallet ew on (ew.con_id = p.con_id);
CON_ID NAME OPEN_MODE WRL_TYPE WALLET_TYPE STATUS
---------- ------------------------------ -------------------- -------------------- -------------------- --------------------
2 PDB$SEED READ ONLY FILE AUTOLOGIN OPEN
3 RACPDB READ ONLY FILE AUTOLOGIN OPEN
4 TRANSPDB MOUNTED FILE AUTOLOGIN OPEN
5 FINALPDB MOUNTED FILE AUTOLOGIN OPEN
Step 9: Start the Redo Apply
Now, the Redo Apply process can be started again:
DGMGRL> edit database RACCDB_fra2xr set state = 'apply-on';
-- wait a few seconds
DGMGRL> show configuration
Configuration - RACCDB_AD1_RACCDB_fra2xr
Protection Mode: MaxPerformance
Members:
RACCDB_AD1 - Primary database
RACCDB_fra2xr - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 71 seconds ago)
Step 10: Drop the Transient PDB
Finally, you may want to drop the transient PDB. On the primary database:
SQL> alter pluggable database TRANSPDB close immediate instances=all;
Pluggable database altered.
SQL> drop pluggable database TRANSPDB including datafiles;
Pluggable database dropped.
Drop the database links if not needed anymore.
Considerations
Let’s consider the storage and time needed for this scenario:
• Storage: we need 2x the size of the PDB to be cloned on the primary database, once for the transient no-
standby PDB, and once for the final PDB. This is only used temporarily until the transient no-standby PDB is
deleted. However, this might become challenging when cloning huge PDBs.
• Time: we need to execute two cloning operations, one remote, and one local. The time needed mainly
depends on database size, degree of parallelism, and the network throughput between the source and
primary for the first clone, and primary and standby for the second clone. However, the local clone is a cold
clone that just copies the datafiles without the need for any recovery operations. Therefore, the cold clone
should be much faster than the hot clone, especially if the source was a transactional busy database.
If you want to avoid the second local clone, you could continue recovering the transient no-standby PDB on
the standby site .
Conclusion
In Data Guard environments, creating a new PDB or cloning local PDB replays successfully on the standby,
as the data files of the source are present on the standby site too. This is obviously not the case for remote
cloning. To copy the datafiles to the standby, you have to:
1. Create a transient no-standby PDB first, then create a local clone of that PDB while using a database link
from standby to primary (discussed here), or
2. Recover the no-standby PDB on the standby site.
The end.

Contenu connexe

Similaire à Clone_a_remote_PDB_in_Data_Guard_Environments_19c_1698741799.pdf

Oracle 12c - Multitenant Feature
Oracle 12c - Multitenant FeatureOracle 12c - Multitenant Feature
Oracle 12c - Multitenant Feature
Vigilant Technologies
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insights
Kirill Loifman
 
12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions
Franck Pachot
 
Presentation day4 oracle12c
Presentation day4 oracle12cPresentation day4 oracle12c
Presentation day4 oracle12c
Pradeep Srivastava
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New Features
Alex Zaballa
 
Using PDB Relocation to Move a Single PDB to Another Existing CDB
Using PDB Relocation to Move a Single PDB to Another Existing CDBUsing PDB Relocation to Move a Single PDB to Another Existing CDB
Using PDB Relocation to Move a Single PDB to Another Existing CDB
Alireza Kamrani
 
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Markus Flechtner
 
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Markus Flechtner
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
uzzal basak
 
IOUG Collaborate 2015 - PDB Cloning Using SQL Commands
IOUG Collaborate 2015 - PDB Cloning Using SQL CommandsIOUG Collaborate 2015 - PDB Cloning Using SQL Commands
IOUG Collaborate 2015 - PDB Cloning Using SQL Commands
Leighton Nelson
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
uzzal basak
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
SrirakshaSrinivasan2
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi Tenant
Red Stack Tech
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replication
Kanwar Batra
 
Oracle PDB Failover in a Data Guard environment
Oracle PDB Failover in a Data Guard environmentOracle PDB Failover in a Data Guard environment
Oracle PDB Failover in a Data Guard environment
Alireza Kamrani
 
Security Multitenant
Security MultitenantSecurity Multitenant
Security Multitenant
Arush Jain
 
Migration to Oracle Multitenant
Migration to Oracle MultitenantMigration to Oracle Multitenant
Migration to Oracle Multitenant
Jitendra Singh
 
2-day-dba-oracle.pptx
2-day-dba-oracle.pptx2-day-dba-oracle.pptx
2-day-dba-oracle.pptx
Rocky572078
 
oracle dba
oracle dbaoracle dba
oracle dba
uday jampani
 
OOW 17 - database consolidation using the oracle multitenant architecture
OOW 17 - database consolidation using the oracle multitenant architectureOOW 17 - database consolidation using the oracle multitenant architecture
OOW 17 - database consolidation using the oracle multitenant architecture
Pini Dibask
 

Similaire à Clone_a_remote_PDB_in_Data_Guard_Environments_19c_1698741799.pdf (20)

Oracle 12c - Multitenant Feature
Oracle 12c - Multitenant FeatureOracle 12c - Multitenant Feature
Oracle 12c - Multitenant Feature
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insights
 
12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions
 
Presentation day4 oracle12c
Presentation day4 oracle12cPresentation day4 oracle12c
Presentation day4 oracle12c
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New Features
 
Using PDB Relocation to Move a Single PDB to Another Existing CDB
Using PDB Relocation to Move a Single PDB to Another Existing CDBUsing PDB Relocation to Move a Single PDB to Another Existing CDB
Using PDB Relocation to Move a Single PDB to Another Existing CDB
 
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
 
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
IOUG Collaborate 2015 - PDB Cloning Using SQL Commands
IOUG Collaborate 2015 - PDB Cloning Using SQL CommandsIOUG Collaborate 2015 - PDB Cloning Using SQL Commands
IOUG Collaborate 2015 - PDB Cloning Using SQL Commands
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi Tenant
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replication
 
Oracle PDB Failover in a Data Guard environment
Oracle PDB Failover in a Data Guard environmentOracle PDB Failover in a Data Guard environment
Oracle PDB Failover in a Data Guard environment
 
Security Multitenant
Security MultitenantSecurity Multitenant
Security Multitenant
 
Migration to Oracle Multitenant
Migration to Oracle MultitenantMigration to Oracle Multitenant
Migration to Oracle Multitenant
 
2-day-dba-oracle.pptx
2-day-dba-oracle.pptx2-day-dba-oracle.pptx
2-day-dba-oracle.pptx
 
oracle dba
oracle dbaoracle dba
oracle dba
 
OOW 17 - database consolidation using the oracle multitenant architecture
OOW 17 - database consolidation using the oracle multitenant architectureOOW 17 - database consolidation using the oracle multitenant architecture
OOW 17 - database consolidation using the oracle multitenant architecture
 

Plus de Alireza Kamrani

How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
Alireza Kamrani
 
Recovering a oracle datafile without backup
Recovering a oracle datafile without backupRecovering a oracle datafile without backup
Recovering a oracle datafile without backup
Alireza Kamrani
 
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in OracleEDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
Alireza Kamrani
 
Oracle Application Continuity with Oracle RAC for java
Oracle Application Continuity with Oracle RAC for javaOracle Application Continuity with Oracle RAC for java
Oracle Application Continuity with Oracle RAC for java
Alireza Kamrani
 
Oracle database maximum performance on Exadata
Oracle database maximum performance on ExadataOracle database maximum performance on Exadata
Oracle database maximum performance on Exadata
Alireza Kamrani
 
Flashback time travel vs Flash back Data Archive.pdf
Flashback time travel  vs Flash back Data Archive.pdfFlashback time travel  vs Flash back Data Archive.pdf
Flashback time travel vs Flash back Data Archive.pdf
Alireza Kamrani
 
Import option in Oracle Database : tip & trick🧶.pdf
Import option in Oracle Database : tip & trick🧶.pdfImport option in Oracle Database : tip & trick🧶.pdf
Import option in Oracle Database : tip & trick🧶.pdf
Alireza Kamrani
 
🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf
🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf
🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf
Alireza Kamrani
 
Recovering a Oracle datafile without backup.pdf
Recovering a Oracle datafile without backup.pdfRecovering a Oracle datafile without backup.pdf
Recovering a Oracle datafile without backup.pdf
Alireza Kamrani
 
♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf
♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf
♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf
Alireza Kamrani
 
♨️CPU limitation per Oracle database instance
♨️CPU limitation per Oracle database instance♨️CPU limitation per Oracle database instance
♨️CPU limitation per Oracle database instance
Alireza Kamrani
 
Out-of-Place Oracle Database Patching and Provisioning Golden Images
Out-of-Place Oracle Database Patching and Provisioning Golden ImagesOut-of-Place Oracle Database Patching and Provisioning Golden Images
Out-of-Place Oracle Database Patching and Provisioning Golden Images
Alireza Kamrani
 
IO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performanceIO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performance
Alireza Kamrani
 
The Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAsThe Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAs
Alireza Kamrani
 
What is Scalability and How can affect on overall system performance of database
What is Scalability and How can affect on overall system performance of databaseWhat is Scalability and How can affect on overall system performance of database
What is Scalability and How can affect on overall system performance of database
Alireza Kamrani
 
🏗️Improve database performance with connection pooling and load balancing tec...
🏗️Improve database performance with connection pooling and load balancing tec...🏗️Improve database performance with connection pooling and load balancing tec...
🏗️Improve database performance with connection pooling and load balancing tec...
Alireza Kamrani
 
Oracle Database 23c–Fine Grained locking features
Oracle Database 23c–Fine Grained locking featuresOracle Database 23c–Fine Grained locking features
Oracle Database 23c–Fine Grained locking features
Alireza Kamrani
 
Store non-structured data in JSON column types and enhancements of JSON
Store non-structured data in JSON column types and enhancements of JSONStore non-structured data in JSON column types and enhancements of JSON
Store non-structured data in JSON column types and enhancements of JSON
Alireza Kamrani
 
Enhancements in Oracle 23c Introducing the NewOld Returning Clause
Enhancements in Oracle 23c Introducing the NewOld Returning ClauseEnhancements in Oracle 23c Introducing the NewOld Returning Clause
Enhancements in Oracle 23c Introducing the NewOld Returning Clause
Alireza Kamrani
 
PostgreSQL vs Oracle a brief comparison
PostgreSQL vs Oracle a brief  comparisonPostgreSQL vs Oracle a brief  comparison
PostgreSQL vs Oracle a brief comparison
Alireza Kamrani
 

Plus de Alireza Kamrani (20)

How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
 
Recovering a oracle datafile without backup
Recovering a oracle datafile without backupRecovering a oracle datafile without backup
Recovering a oracle datafile without backup
 
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in OracleEDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
 
Oracle Application Continuity with Oracle RAC for java
Oracle Application Continuity with Oracle RAC for javaOracle Application Continuity with Oracle RAC for java
Oracle Application Continuity with Oracle RAC for java
 
Oracle database maximum performance on Exadata
Oracle database maximum performance on ExadataOracle database maximum performance on Exadata
Oracle database maximum performance on Exadata
 
Flashback time travel vs Flash back Data Archive.pdf
Flashback time travel  vs Flash back Data Archive.pdfFlashback time travel  vs Flash back Data Archive.pdf
Flashback time travel vs Flash back Data Archive.pdf
 
Import option in Oracle Database : tip & trick🧶.pdf
Import option in Oracle Database : tip & trick🧶.pdfImport option in Oracle Database : tip & trick🧶.pdf
Import option in Oracle Database : tip & trick🧶.pdf
 
🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf
🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf
🔴Oracle ASM Filter Driver & ASMLIB & UDEV🔴.pdf
 
Recovering a Oracle datafile without backup.pdf
Recovering a Oracle datafile without backup.pdfRecovering a Oracle datafile without backup.pdf
Recovering a Oracle datafile without backup.pdf
 
♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf
♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf
♨️How To Use DataPump (EXPDP) To Export From Physical Standby….pdf
 
♨️CPU limitation per Oracle database instance
♨️CPU limitation per Oracle database instance♨️CPU limitation per Oracle database instance
♨️CPU limitation per Oracle database instance
 
Out-of-Place Oracle Database Patching and Provisioning Golden Images
Out-of-Place Oracle Database Patching and Provisioning Golden ImagesOut-of-Place Oracle Database Patching and Provisioning Golden Images
Out-of-Place Oracle Database Patching and Provisioning Golden Images
 
IO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performanceIO Schedulers (Elevater) concept and its affection on database performance
IO Schedulers (Elevater) concept and its affection on database performance
 
The Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAsThe Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAs
 
What is Scalability and How can affect on overall system performance of database
What is Scalability and How can affect on overall system performance of databaseWhat is Scalability and How can affect on overall system performance of database
What is Scalability and How can affect on overall system performance of database
 
🏗️Improve database performance with connection pooling and load balancing tec...
🏗️Improve database performance with connection pooling and load balancing tec...🏗️Improve database performance with connection pooling and load balancing tec...
🏗️Improve database performance with connection pooling and load balancing tec...
 
Oracle Database 23c–Fine Grained locking features
Oracle Database 23c–Fine Grained locking featuresOracle Database 23c–Fine Grained locking features
Oracle Database 23c–Fine Grained locking features
 
Store non-structured data in JSON column types and enhancements of JSON
Store non-structured data in JSON column types and enhancements of JSONStore non-structured data in JSON column types and enhancements of JSON
Store non-structured data in JSON column types and enhancements of JSON
 
Enhancements in Oracle 23c Introducing the NewOld Returning Clause
Enhancements in Oracle 23c Introducing the NewOld Returning ClauseEnhancements in Oracle 23c Introducing the NewOld Returning Clause
Enhancements in Oracle 23c Introducing the NewOld Returning Clause
 
PostgreSQL vs Oracle a brief comparison
PostgreSQL vs Oracle a brief  comparisonPostgreSQL vs Oracle a brief  comparison
PostgreSQL vs Oracle a brief comparison
 

Dernier

Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
ElizabethGarrettChri
 
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
oaxefes
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
Vietnam Cotton & Spinning Association
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
ytypuem
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
Building a Quantum Computer Neutral Atom.pdf
Building a Quantum Computer Neutral Atom.pdfBuilding a Quantum Computer Neutral Atom.pdf
Building a Quantum Computer Neutral Atom.pdf
cjimenez2581
 
Jio cinema Retention & Engagement Strategy.pdf
Jio cinema Retention & Engagement Strategy.pdfJio cinema Retention & Engagement Strategy.pdf
Jio cinema Retention & Engagement Strategy.pdf
inaya7568
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
asyed10
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
slg6lamcq
 
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
hqfek
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
exukyp
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
Vineet
 
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
lzdvtmy8
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 

Dernier (20)

Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
 
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
一比一原版卡尔加里大学毕业证(uc毕业证)如何办理
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
Building a Quantum Computer Neutral Atom.pdf
Building a Quantum Computer Neutral Atom.pdfBuilding a Quantum Computer Neutral Atom.pdf
Building a Quantum Computer Neutral Atom.pdf
 
Jio cinema Retention & Engagement Strategy.pdf
Jio cinema Retention & Engagement Strategy.pdfJio cinema Retention & Engagement Strategy.pdf
Jio cinema Retention & Engagement Strategy.pdf
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
 
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
 
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
一比一原版格里菲斯大学毕业证(Griffith毕业证书)学历如何办理
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 

Clone_a_remote_PDB_in_Data_Guard_Environments_19c_1698741799.pdf

  • 1. Hot Clone a remote PDB in Data Guard Environments using Transient no-standby PDBs Introduction Oracle Multitenant is integrated with Oracle Data Guard. Data Guard is configured at the CDB level and will replicate all transactions from the primary to the standby for all PDBs in a single stream, including creating and deleting PDBs. But! When we create a new PDB, which is a clone from PDB$SEED, or create a local clone, the data files of the source PDB are already present on the standby site, and hence, the operation replays successfully on the standby database too. However, when creating a remote clone, the source data files are only present on the remote CDB but not on the standby site. The remote clone operation will succeed on the primary but leave you with no data files on standby. In this blog post, we will discuss a solution using “transient no-standby PDB” to overcome this challenge. The Environment We will use the following: • Source: Single Instance Database version 19.12, using Multitenant, TDE encrypted, and WE8CED character set. Database unique name is CDBWE8_fra3s6. • Target: RAC Database version 19.12 in Active Data Guard configuration, using Multitenant, TDE encrypted, and AL32UTF8 character set. • Primary database unique name is RACCDB_AD1. • Standby database unique name is RACCDB_fra2xr. The same procedure applies to single-instance and RAC databases as source or target. The target database doesn’t need to use Active Data Gaurd either. The same applies to Data Guard. However, the CDB$ROOT needs to be open in read-only mode on standby. In Oracle database version 19c, the Active Data Guard option license is not required when only the CDB$ROOT is open read-only on standby. Oracle Database version 21c In 21c, a new feature called PDB Recovery Isolation was introduced. With that, a hot clone operation does not require any further manual steps. PDB Recovery Isolation requires the Active Data Guard option. On the Source Database Step 1: Prepare the C##SYSOPER user on the Source Database Grant the C##SYSOPER user the required privileges to be used for the database link: SQL> grant create session, sysoper to C##SYSOPER identified by WElcome123## container=all; Grant succeeded. On the Target Primary Database Step 2: Create Database Link from Target to Source Create a database link on the target primary database pointing to the source database: SQL> create database link DBLINK_TO_WE8 connect to C##SYSOPER identified by WElcome123## using '<connection_string_to_source_database>'; Database link created. As we are not using a database link with the same name as the database it connects to, we need to additionally set the global_names parameter to false: SQL> alter system set global_names=false scope=both sid='*'; System altered. Step 3: Create a Remote Hot Clone PDB from the Source Database Use the database link from the previous step to create a hot clone from the source PDB, however providing the STANDBYS=NONE clause, so the clone PDB will only exist on the primary database, but not on the standby. This is not our final clone, but just a “transient” one. This is why it’s called “transient no-standby PDB“.
  • 2. SQL> create pluggable database TRANSPDB from PDBWE8@DBLINK_TO_WE8 keystore identified by "WElcome123##" STANDBYS=NONE; Pluggable database created. SQL> alter pluggable database TRANSPDB open instances=all; Pluggable database altered. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ----------------- ---------- 2 PDB$SEED READ ONLY NO 3 RACPDB READ WRITE NO 4 TRANSPDB READ WRITE NO Now, if you check the standby site, you’ll see the transient PDB in “MOUNTED” mode, but there are no data files associated with it: -- on the standby SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ---------- --------------- 2 PDB$SEED READ ONLY NO 3 RACPDB READ ONLY NO 4 TRANSPDB MOUNTED SQL> select name from v$datafile where con_id=4; NAME -------------------------------------------------------------- /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00044 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00045 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00046 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00047 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00048 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00049 Step 4: Create a self-referencing Database Link on the Primary Database On the target primary, grant the C##SYSOPER user the required privileges and create a database link using the connection string of the primary itself: SQL> grant create session, sysoper to C##SYSOPER identified by WElcome123## container=all; Grant succeeded. SQL> create database link DBLINK_TO_PRIM connect to C##SYSOPER identified by WElcome123## using '<connection_string_of_primary>'; Database link created. This operation will be replicated via Data Guard redo-apply on the standby database, so we have a database link on the standby pointing to the primary. This IS COOL! As the database link on standby is not using the exact name of the database is connecting to, we need to set global_names in the standby database to false: -- on standby SQL> alter system set global_names=false scope=both sid='*';
  • 3. System altered. On the Standby Database Step 5: Set standby_pdb_source_file_dblink on Standby On the standby database, set the standby_pdb_source_file_dblink parameter to the name of the database link created in step 4: SQL> alter system set standby_pdb_source_file_dblink=DBLINK_TO_PRIM scope=both sid='*'; System altered. This parameter specifies the name of the database link that will automatically be used in the next step to copy the data files from the primary to standby during a local clone operation. Back to the Primary Database Step 6: Create a Local Cold Clone from the Transient PDB On the primary database, set the transient PDB in read-only mode, and create a clone of it, this time using STANDBYS=ALL: SQL> alter pluggable database TRANSPDB close immediate instances=all; Pluggable database altered. SQL> alter pluggable database TRANSPDB open read only instances=all; Pluggable database altered. SQL> create pluggable database FINALPDB from TRANSPDB keystore identified by "WElcome123##" STANDBYS=ALL; Pluggable database created. -- open thenew PDB SQL> alter pluggable database FINALPDB open instances=all; Pluggable database altered. -- on the standby SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 RACPDB READ ONLY NO 4 TRANSPDB MOUNTED 5 FINALPDB MOUNTED SQL> select name from v$datafile where con_id=5; NAME ----------------------------------------------------------------------------------------- +DATA/RACCDB_FRA2XR/C9A7E2196EE27681E0531F02640A18C1/DATAFILE/system.280.1089037503 +DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/sysaux.281.1089037509 +DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/undotbs1.282.1089037513 +DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/users.283.1089037515 +DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/we8tbs.284.1089037515 +DATA/RACCDB_FRA2XR/D125EC846C2D2376E053A800000A3055/DATAFILE/undo_2.285.1089037517
  • 4. This time, the new PDB clone is created with all data files as on the primary, as the data files have been copied over the database link created in step 4. This is our final PDB. However, suppose you use local software wallets to manage the TDE master encryption keys instead of Oracle Key Vault (OKV) or OCI Vault in Oracle Cloud. In that case, the Data Guard Redo Apply will stop after opening the PDB, as the standby does not have access to the TDE key of the newly cloned PDB: dgmgrl DGMGRL> connect sys; DGMGRL> show configuration; Configuration - RACCDB_AD1_RACCDB_fra2xr Protection Mode: MaxPerformance Members: RACCDB_AD1 - Primary database RACCDB_fra2xr - Physical standby database Error: ORA-16810: multiple errors or warnings detected for the member Fast-Start Failover: Disabled Configuration Status: ERROR (status updated 37 seconds ago) If your source PDB did not have a TDE key, then Redo Apply will stop once you create a new one as described in the next step. Step 7: Create a new TDE Key for the Final PDB After cloning an encrypted PDB, do not continue using the same key of the source PDB, but create a new TDE master encryption key for the newly cloned PDB instead: SQL> alter session set container=FINALPDB; Session altered. SQL> administer key management set key force keystore identified by WElcome123## with backup; keystore altered. Step 8: Copy the TDE Wallet Files to the Standby Site Copy the TDE wallet files from the primary to the standby server: scp -p /opt/oracle/dcs/commonstore/wallets/tde/RACCDB_AD1/*wallet.* oracle@<standby_server>:/opt/oracle/dcs/commonstore/wallets/tde/RACCDB_fra2xr/ cwallet.sso 100% 9432 5.8MB/s 00:00 ewallet.p12 100% 9387 8.3MB/s 00:00 For the new keys to get recognized by the standby database, we need to close and re-open the key store on the standby database: -- on the standby SQL> administer key management set keystore close container=ALL; keystore altered. -- key store will open automatically as soon as we query the v$encryption_wallet view SQl> select p.con_id, p.name, p.open_mode, ew.wrl_type, ew.wallet_type, ew.status from v$pdbs p join v$encryption_wallet ew on (ew.con_id = p.con_id); CON_ID NAME OPEN_MODE WRL_TYPE WALLET_TYPE STATUS ---------- ------------------------------ -------------------- -------------------- -------------------- -------------------- 2 PDB$SEED READ ONLY FILE AUTOLOGIN OPEN 3 RACPDB READ ONLY FILE AUTOLOGIN OPEN
  • 5. 4 TRANSPDB MOUNTED FILE AUTOLOGIN OPEN 5 FINALPDB MOUNTED FILE AUTOLOGIN OPEN Step 9: Start the Redo Apply Now, the Redo Apply process can be started again: DGMGRL> edit database RACCDB_fra2xr set state = 'apply-on'; -- wait a few seconds DGMGRL> show configuration Configuration - RACCDB_AD1_RACCDB_fra2xr Protection Mode: MaxPerformance Members: RACCDB_AD1 - Primary database RACCDB_fra2xr - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 71 seconds ago) Step 10: Drop the Transient PDB Finally, you may want to drop the transient PDB. On the primary database: SQL> alter pluggable database TRANSPDB close immediate instances=all; Pluggable database altered. SQL> drop pluggable database TRANSPDB including datafiles; Pluggable database dropped. Drop the database links if not needed anymore. Considerations Let’s consider the storage and time needed for this scenario: • Storage: we need 2x the size of the PDB to be cloned on the primary database, once for the transient no- standby PDB, and once for the final PDB. This is only used temporarily until the transient no-standby PDB is deleted. However, this might become challenging when cloning huge PDBs. • Time: we need to execute two cloning operations, one remote, and one local. The time needed mainly depends on database size, degree of parallelism, and the network throughput between the source and primary for the first clone, and primary and standby for the second clone. However, the local clone is a cold clone that just copies the datafiles without the need for any recovery operations. Therefore, the cold clone should be much faster than the hot clone, especially if the source was a transactional busy database. If you want to avoid the second local clone, you could continue recovering the transient no-standby PDB on the standby site . Conclusion In Data Guard environments, creating a new PDB or cloning local PDB replays successfully on the standby, as the data files of the source are present on the standby site too. This is obviously not the case for remote cloning. To copy the datafiles to the standby, you have to: 1. Create a transient no-standby PDB first, then create a local clone of that PDB while using a database link from standby to primary (discussed here), or 2. Recover the no-standby PDB on the standby site. The end.