DataGuard Broker is a distributed management architecture that is used to automatically create, maintain, and monitor DataGuard configurations. You can use the OEM (graphical interface) or DGMGRL (command line) to do the following:
1. Create and activate Dataguard configuration, including setting redo transport services and log apply services
2. The entire Dataguard configuration in this configuration can be managed in any system (all main and standby libraries)
3. Manage and monitor dataguard configurations that contain RAC primary or standby databases
4. simplifies the role switching operation, as long as a DGMGRL command or an OEM button can be switchover or failover
5. You can activate the Fast-start failover to automatically fail over when the main library is unavailable. When this feature is activated, data Guard broker Determines whether failover is required and begins to automatically failover to the specified target standby database without the need for DBA intervention or data loss.
Let's demonstrate how broker creates and enables broker configuration.
First, enable Dataguard Broker
The following two steps are required on the master/slave database.
1.1 Enable Dg_broker
sql> ALTER SYSTEM SET dg_broker_start=true scope=both; System altered.
Check the background process and you will find that Oracle has started a process more
11gdg1-> Ps-ef | grep ora_dmonoracle 19675 1 0 03:43? 00:00:00 ORA_DMON_DGTST
1.2 Configure the static listener.
Note: You must configure listener static monitoring on the database, and global_name to be specified as Db_unique_name_dgmgrl.domain
Sid_list_listener = (Sid_list = (Sid_desc = (Global_dbname = 11gdg1_dgmgrl) (Oracle_home =/u01/app/oracle/p roduct/11.2.0/db_1) (sid_name = dgtst)))
Second, the use of DGMGRL
2.1 View DGMGRL Help
11gdg1-> dgmgrl dgmgrl for linux: version 11.2.0.3.0 - 64bit productioncopyright (c) 2000, 2009, oracle. all rights reserved. welcome to dgmgrl, type "Help" for information. dgmgrl> helpthe following commands are available:add adds a standby database to the broker configurationconnect connects to an oracle database instanceconvert Converts a database from one type to anothercreate Creates a broker configurationdisable disables a configuration, a database, oR fast-start failoveredit edits a configuration, database, or instanceenable Enables a configuration, a database, or fast-start failoverexit exits the Programfailover changes a standby database to be the primary databasehelp Displays description and syntax for a commandquit Exits the programreinstate Changes a database marked for reinstatement into a viable standbyrem Comment to be ignored by DGMGRLremove Removes a configuration, database, or instanceshow displays information about a configuration, database, or instanceshutdown shuts down a currently running oracle database instancesql Executes a SQL Statementstart starts the fast-start failover observerstartup starts an oracle database instancestop Stops the fast-start failover Observerswitchover switches roles between a primary and standby databaseUse "Help <command>" to see syntax for Individual commands
2.2 Connecting to a database
When you use DGMGRL for any database operation, you must first connect to the database.
Dgmgrl> help connect connects to an Oracle database Instancesyntax:connect <username>/<password>[@<co Nnect Identifier>]
Connecting to the main library
Dgmgrl> Connect Sys/[email protected]connected.
2.3 Creating a broker's configuration file
dgmgrl> help createcreates a broker configurationsyntax:create CONFIGURATION <configuration name> as PRIMARY DATABASE is <database name> CONNECT IDENTIFIER is <connect identifier>;
This step must be performed on the main library, <database name> specifies db_unique_name instead of db_name
Dgmgrl> CREATE CONFIGURATION DR1 as PRIMARY DATABASE is 11GDG1 CONNECT IDENTIFIER is 11GDG1; Configuration "DR1" created with primary database "11GDG1"
At this point, we just created a configuration that was stored in the configuration file of the primary database, but we did not join the standby data or make the configuration effective. We can view the configuration using Show configuration.
Dgmgrl> show configuration; CONFIGURATION-DR1 Protection mode:maxperformance databases:11gdg1-primary databasefast-start failover:disabled Configuration status:disabled
2.4 Adding from the library to the configuration
dgmgrl> ADD DATABASE 11gdg2;database "11gdg2" added
Because Log_archive_dest_2 is already configured on the main library, it is as follows.
Sql> Show parameter Log_archive_dest_2name TYPE VALUE----------------------------------------------- ----------log_archive_dest_2 string service=11gdg2 ASYNC db_unique_name=11gdg2 valid_for= (primary_role,online_ LogFile
So add execute from library execution
ADD DATABASE 11gdg2;
Yes, if not configured, you need to specify the complete information.
ADD DATABASE 11gdg2 as CONNECT IDENTIFIER is 11gdg2 maintained as physical;
View configuration information
Dgmgrl> show CONFIGURATIONCONFIGURATION-DR1 Protection mode:maxperformance databases:11gdg1-primary Database 11gdg2-physical Standby Databasefast-start failover:disabledconfiguration status:disabled
The standby has been added to the configuration.
2.4 View details of the database DG configuration
dgmgrl> show database verbose 11gdg1;database - 11gdg1 role: primary intended state: offline instance (s): dgtst properties: dgconnectidentifier = ' 11GDG1 ' observerconnectidentifier = ' LogXptMode = ' ASYNC ' delaymins = ' 0 ' Binding = ' Optional ' MaxFailure = ' 0 ' maxconnections = ' 1 ' ReopenSecs = ' nettimeout = ' RedoCompression = ' DISABLE ' logshipping = ' on ' PreferredApplyInstance = ' ApplyInstanceTimeout = ' 0 ' ApplyParallel = ' AUTO ' StandbyFileManagement = ' AUTO ' ArchiveLagTarget = ' 0 ' LogArchiveMaxProcesses = ' 4 ' LogArchiveMinSucceedDest = ' 1 ' DbFileNameConvert = ' LogFileNameConvert = ' faststartfailovertarget = ' inconsistentproperties = ' (monitor) ' InconsistentLogXptProps = ' ( Monitor) ' SendQEntries = ' (monitor) ' logxptstatus = ' (monitor) ' RecvQEntries = ' (monitor) ' SidName = ' dgtst ' StaticConnectIdentifier = ' (description= (address= (protocol=tcp) (host=11gdg1.localdomain.com) (port= 1521)) (Connect_data= (SERVICE_NAME=11GDG1_DGMGRL) (INSTANCE_NAME=DGTST) (server=dedicated))) ' StandbyArchiveLocation = ' Use_db_ Recovery_file_dest ' AlternateLocation = ' LogArchiveTrace = ' 0 ' LogArchiveFormat = '%t_%s_%r.dbf ' TopWaitEvents = ' (monitor) ' database status:disabled
2.5 Making the configuration effective
Dgmgrl> ENABLE CONFIGURATION; Enabled.dgmgrl> SHOW CONFIGURATION; CONFIGURATION-DR1 Protection mode:maxperformance databases:11gdg1-primary database 11gdg2-physical Standby Databasefast-start failover:disabledconfiguration status:success
This article is from the "Ding Dong" blog, please be sure to keep this source http://lqding.blog.51cto.com/9123978/1681701
Oracle Learning Dataguard (vi) Create and enable broker configuration