• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Export and Import Data Guard Broker Configuration in Oracle 19c

by admin

Oracle Database 19c onward, you can export/import the broker metadata configuration to a text file. This post outlines the steps to import or export the broker metadata configuration.

For the purpose of this post we aree using below example configuration:

Data Guard Configuration : 
Primary db_unique_name : prim_db
Standby db_unique_name : stby_db

Exporting broker configuration file

1. First, login into the primary database using dgmgrl:

$ dgmgrl [LOGIN]/[PASSWORD]@prim_db

2. Now export the broker configuration file as “dg_config.xml”:

DGMGRL> export configuration to 'dg_config.xml';
Succeeded.
Note: You cannot specify the directory in which the exported configuration is stored. The broker stores the exported configuration in the “trace” directory (ADR).

The export command will fail if a file of the same name already exists. For example:

DGMGRL> export configuration to 'dg_config.xml';
ORA-16571: Oracle Data Guard configuration file creation failure

3. Confirm if the broker configuration is exported to the trace directory:

$ ls -ltr [ADR_BASE]/rdbms/prim_db/[oracle_sid]/trace/dg_config.xml 
-rw-r--r-- 1 oracle oinstall 4707 July 05 04:23 dg_config.xml

Importing broker configuration file

1. Before importing the configuration file, you must remove the existing broker configuration. An error will occur if the broker configuration already exists. For example:

DGMGRL> import configuration from 'dg_config.xml';
ORA-16504: The Oracle Data Guard broker configuration already exists.

2. The specified file name must exist in the “trace” directory (ADR). Let us first remove the existing broker configuration.

$ dgmgrl [LOGIN]/[PASSWORD]@prim_db
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Sat Aug 17 07:59:23 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "prim_db"
Connected as SYSDBA.

DGMGRL> remove configuration;
Removed configuration
DGMGRL>

3. Now import the new configuration which is present in the trace directory. Also, enable the configuration once imported successfully.

DGMGRL> import configuration from 'dg_config.xml';
Succeeded. Run ENABLE CONFIGURATION to enable the imported configuration.
DGMGRL>
DGMGRL> enable configuration;
Enabled.
DGMGRL>

4. Verify the configuration.

DGMGRL> show configuration;

Configuration - [CONFIGURE NAME]

Protection Mode: MaxPerformance
Members:
prim_db - Primary database
stby_db - Physical standby database

Fast-Start Failover: Disabled

Configuration Status:
SUCCESS (status updated 7 seconds ago)

Filed Under: oracle

Some more articles you might also be interested in …

  1. How to Split a Partition Into Multiple Partitions in Oracle 12c
  2. ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
  3. tuned-adm and Oracle
  4. Understanding Oracle Database Recyclebin Features and How to Disable it
  5. What roles can be set as default for a user in Oracle Database
  6. How To Create an Encrypted Tablespace in Oracle 12c Pluggable Database
  7. SQL: Difference between delete and truncate
  8. Oracle 11g New Feature – Archived Redo Log Failover
  9. How to Install/Uninstall/Upgrade Oracle SQLTXPLAIN (SQLT) Tool
  10. Difference between using srvctl vs using sqlplus for start/stop one or more Oracle Database Instances

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright