Scenario 10: Removing a DG PDB Configuration

When PDB-level Data Guard protection is no longer required, the following commands can be used to remove the DG PDB configuration. The steps in this scenario restore the boston and newyork databases to their states at the end of Scenario 2: Prepare the Environment. The REMOVE PLUGGABLE DATABASE command is used to remove a PDB in the target role that was created using the ADD PLUGGABLE DATABASE command. This command stops the recovery process and removes the pluggable database from the configuration. The associated source PDB is then no longer protected. For this example, the optional REMOVE DATAFILES clause is included to also delete the PDB datafiles when the PDB nyc_sales is removed from the target CDB newyork.
DGMGRL> REMOVE PLUGGABLE DATABASE nyc_sales AT newyork REMOVE DATAFILES; 
Pluggable Database 'nyc_sales' removed. 

DGMGRL> SHOW ALL PLUGGABLE DATABASE AT newyork; 
No pluggable databases at database 'newyork'
After this command executes, the indentation in the SHOW CONFIGURATION output changes to show both databases with the same level of indentation because there now is no redo transport active between the two primary databases.
DGMGRL> SHOW CONFIGURATION
   Configuration - Boston 
   Protection Mode: MaxPerformance  
   Members: 
   boston - Primary database  
     newyork - Primary database in NewYork configuration 
Fast-Start Failover: Disabled 
Configuration Status: 
SUCCESS (status updated 47 seconds ago)
Note that although the datafiles for the nyc_sales PDB have been deleted, the standby redo logfiles for nyc_sales are still present in the fast recovery area and need to be manually deleted. After the standy redo logfiles have been deleted, the state of the DG PDB environment is now the same as it was at the end of Scenario 4: Establish a Connection Between the Configurations and Enable Them. To remove the connection between the Boston and NewYork configurations, issue the following command:
DGMGRL> REMOVE CONFIGURATION NewYork; 
Succeeded. 

DGMGRL> SHOW CONFIGURATION; 
Configuration - Boston 
Protection Mode: MaxPerformance 
Members: 
boston - Primary database 
Fast-Start Failover: Disabled 
Configuration Status: 
SUCCESS (status updated 25 seconds ago) 
To remove the individual Boston and NewYork configurations and restore the state to that at the end of Scenario 2: Prepare the Environment, connect to each configuration and issue the REMOVE CONFIGURATION command:
$ dgmgrl /@boston 
DGMGRL for Linux: Release 23.0.0.0.0 - Development on Thu Mar 9 18:53:48 2023 
Version 23.1.0.0.0 
Copyright (c) 1982, 2023, Oracle and/or its affiliates. All rights reserved. 
Welcome to DGMGRL, type "help" for information. 
Connected to "boston" 
Connected as SYSDBA. 

DGMGRL> REMOVE CONFIGURATION; 
Removed configuration 

DGMGRL> exit 
$ dgmgrl /@newyork DGMGRL for Linux: Release 23.0.0.0.0 - Development on Thu Mar 9 18:54:25 2023 
Version 23.1.0.0.0 
Copyright (c) 1982, 2023, Oracle and/or its affiliates. All rights reserved. 
Welcome to DGMGRL, type "help" for information. 
Connected to "newyork" Connected as SYSDBA. 

DGMGRL> REMOVE CONFIGURATION; 
Removed configuration 

DGMGRL> exit

Optionally, reverse the wallet creation and other initial set up steps from Scenario 1: Prepare the Databases and Scenario 2: Prepare the Environment to restore the environment to its original state