Up to Oracle 19c, there was no automatic way to backup the configuration of the broker. One solution was to manually copy all executed instructions in a file.
With Oracle 19c, there is now the possibility to export and to import the configuration of the broker. Indeed the new EXPORT CONFIGURATION command will enable to save the metadata contained in the broker configuration file to a text file. This can be very useful if I have to recreate my configuration.
In this blog I have tested this command with following configuration
DGMGRL> show configuration Configuration - db19c Protection Mode: MaxAvailability Members: DB19C_SITE1 - Primary database DB19C_SITE2 - Physical standby database DB19C_SITE3 - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 47 seconds ago) DGMGRL>
We can see the syntax of the EXPORT command with the help command
DGMGRL> help export Export Data Guard Broker configuration to a file. Syntax: EXPORT CONFIGURATION [TO ]; DGMGRL>
Now let’s export the configuration
DGMGRL> EXPORT CONFIGURATION TO db19c_config.txt Succeeded. DGMGRL>
The file is generated in the trace files directory.
[oracle@primaserver trace]$ pwd /u01/app/oracle/diag/rdbms/db19c_site1/DB19C/trace [oracle@primaserver trace]$ ls -l db19c_config.txt -rw-r--r--. 1 oracle oinstall 8469 May 4 12:25 db19c_config.txt [oracle@primaserver trace]$
Let’s remove the configuration
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXPERFORMANCE; Succeeded. DGMGRL> remove configuration; Removed configuration DGMGRL> show configuration ORA-16532: Oracle Data Guard broker configuration does not exist Configuration details cannot be determined by DGMGRL DGMGRL>
Now let’s use the IMPORT command to rebuild the configuration
DGMGRL> IMPORT CONFIGURATION FROM db19c_config.txt Succeeded. Run ENABLE CONFIGURATION to enable the imported configuration. DGMGRL>
As we can see the configuration is disabled after the import
DGMGRL> show configuration Configuration - db19c Protection Mode: MaxAvailability Members: DB19C_SITE1 - Primary database DB19C_SITE2 - Physical standby database DB19C_SITE3 - Physical standby database Fast-Start Failover: Disabled Configuration Status: DISABLED DGMGRL>
So let’s enable it
DGMGRL> ENABLE CONFIGURATION Enabled. DGMGRL> show configuration Configuration - db19c Protection Mode: MaxAvailability Members: DB19C_SITE1 - Primary database Warning: ORA-16629: database reports a different protection level from the protection mode DB19C_SITE2 - Physical standby database DB19C_SITE3 - Physical standby database Fast-Start Failover: Disabled Configuration Status: WARNING (status updated 6 seconds ago) DGMGRL>
The warning is due to the fact that the protection mode was set to MaxPerformance to be able to drop the configuration.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY ; Succeeded. DGMGRL> show configuration Configuration - db19c Protection Mode: MaxAvailability Members: DB19C_SITE1 - Primary database DB19C_SITE2 - Physical standby database DB19C_SITE3 - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 37 seconds ago) DGMGRL>
Now let’s run the EXPORT command without specifying a file name
DGMGRL> EXPORT CONFIGURATION Succeeded. DGMGRL>
We can see in the trace directory that a default name is generated for the file
DB19C_dmon_5912_brkmeta_1.trc
If we run again the export command
DGMGRL> EXPORT CONFIGURATION Succeeded. DGMGRL>
A second default file is created
DB19C_dmon_5912_brkmeta_2.trc
Cet article Oracle 19C : Exporting and Importing Broker Configuration est apparu en premier sur Blog dbi services.