Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[DATAGUARD] Oracle19c Data Guard Broker

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle19c Data Guard Broker describes Data Guard broker as a centralized framework for managing the entire Data Guard configuration through client connections to any database in the configuration. DGMGRL cannot create a standby (GUI can do this). CLI is mainly used for configuration and management. Easy switchover / failover with one command, minimizing overall downtime associated with planned / unplanned downtime broker does not use various SQL*Plus statements to manage the primary and standby databases, but provides a single unified configuration agent to save its configuration details in a flat file. These files are stored on each database node in the data protection configuration. In addition, two copies of the configuration file are always stored on each database for redundancy. The following parameters control where the configuration file is stored. DG_BROKER_CONFIG_FILE1 & DG_BROKER_CONFIG_FILE2 New feature oracle19c dynamically changes the fast-start failover target without disabling the use of observation mode (observe-only mode) to simulate how fast-start failover works without affecting the current environment. Broker configuration information can be exported as a backup and can be imported using the exported backup when the Broker needs to be rebuilt. The new command can be used to set, modify, and display the database, remotely synchronize instances, or restore the values of database initialization parameters in the device. Values set using these commands are applied directly to the database and are not stored in the agent configuration file. The following properties associated with database initialization parameters are not recommended in this version and may be unsupported in future versions. These properties will no longer be stored in the agent profile. ArchiveLagTarget, DataGuardSyncLatency,LogArchiveMaxProcesses,xixLogArchiveMinSucceedDest, LogArchiveTrace,StandbyFileManagement,DbFileNameConvert, LogArchiveFormat, LogFileNameConvert inconsistent attributes are deprecated in this release. This property will always have no value. The following attributes related to logical standby will be recalculated and may be unsupported in future releases: LsbyMaxEventsRecorded, LsbyMaxServers,LsbyMaxSga, LsbyPreserveCommitOrder, LsbyRecordAppliedDdl,LsbyRecordSkipDdl,LsbyRecordSkipErrors, and LsbyParameter no longer support feature MaxConnections parameters that no longer support dg broker configuration environment preparation

Network configuration

-- active and standby reference, mainly pay attention to GLOBAL_DBNAME Db_unique_name+DGMGRLSID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = mydbdg) (ORACLE_HOME = / u01/app/oracle/product/19.0.0/dbhome_1) (SID_NAME = mydbdg)) (SID_DESC = (GLOBAL_DBNAME = mydbdg_DGMGRL) (ORACLE_HOME = / u01/app/oracle/product/19.0.0/dbhome_1 ) (SID_NAME = mydbdg)

Parameters, user environment

-- it can be executed at the master end-- unlock dg users. Sysdg permission must be granted, otherwise the password file cannot be written remotely, and so on. Select username,SYSBACKUP, SYSDG from variable PWFILER usability alter user sysdg identified by oracle account unlock;grant sysdg to sysdg; select username,SYSBACKUP, SYSDG from Variety PWFILEX usability alter-modify parameters, alter system set dg_broker_start=true;-- test connection [oracle@node216 admin] $dgmgrl DGMGRL for Linux: Release 19.0.0.0.0-Production on Tue Feb 18 15:14:07 2020Version 19.3.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.Welcome to DGMGRL, type "help" for information.DGMGRL > connect sysdgPassword:Connected to "mydb19c" Connected as SYSDG.DGMGRL > connect sysdg@mydbdgPassword:Connected to "MYDBDG" Connected as SYSDG.DGMGRL > start configuration master creation configuration information create configuration 'mycdb' as primary database is' mydb19c' connect identifier is mydb19c;-- View DGMGRL > show configuration Configuration-mycdb Protection Mode: MaxPerformance Members: mydb19c-Primary databaseFast-Start Failover: DisabledConfiguration Status:DISABLED backup adds configuration information-- the standby clears the remote information, otherwise an error is reported. This parameter is automatically set to alter system set LOG_ARCHIVE_DEST_2=''; Add database 'mydbdg' as connect identifier is mydbdg maintained as physical;-- to check the configuration information DGMGRL > show configuration when switching later. Configuration-mycdb Protection Mode: MaxPerformance Members: mydb19c-Primary database mydbdg-Physical standby database Fast-Start Failover: DisabledConfiguration Status:DISABLED-- View database trusted configuration information SHOW DATABASE VERBOSE 'South_Sales'-- modify reference command EDIT DATABASE' South_Sales' SET PROPERTY 'LogArchiveFormat'='log_%t_%s_%r_%d.arc';EDIT DATABASE' South_Sales' SET PROPERTY 'StandbyArchiveLocation'='/archfs/arch/'; Startup configuration DGMGRL > ENABLE CONFIGURATION;Enabled.DGMGRL > show configuration Configuration-mycdb Protection Mode: MaxPerformance Members: mydb19c-Primary database mydbdg-Physical standby database Fast-Start Failover: DisabledConfiguration Status:SUCCESS (status updated 6 seconds ago) DGMGRL >-- check database information DGMGRL > show database 'mydbdg' Database-mydbdg Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 0 seconds ago) Apply Lag: 0 seconds (computed 0 seconds ago) Average Apply Rate: 3.00 KByte/s Real Time Query: ON Instance (s): mydbdgDatabase Status:SUCCESSDGMGRL > show database 'mydb19c' Database-mydb19c Role: PRIMARY Intended State: TRANSPORT-ON Instance (s): mydb19cDatabase Status:SUCCESS master / slave switch dgmgrl check information-verify master database DGMGRL > VALIDATE DATABASE 'mydb19c'; Database Role: Primary database Ready for Switchover: Yes Flashback Database Status: mydb19c: Off Managed by Clusterware: mydb19c: NO Validating static connect identifier for the primary database mydb19c... The static connect identifier allows for a connection to database "mydb19c".-- DGMGRL > VALIDATE DATABASE 'mydbdg'; Database Role: Physical standby database Primary Database: mydb19c Ready for Switchover: Yes Ready for Failover: Yes (Primary Running) Flashback Database Status: mydb19c: Off mydbdg: Off Managed by Clusterware: mydb19c: NO mydbdg: NO Validating static connect identifier for the primary database mydb19c... The static connect identifier allows for a connection to database "mydb19c". Current Log File Groups Configuration: Thread # Online Redo Log Groups Standby Redo Log Groups Status (mydb19c) (mydbdg) 1 3 2 Insufficient SRLs Future Log File Groups Configuration: Thread # Online Redo Log Groups Standby Redo Log Groups Status (mydbdg) (mydb19c) 1 30 Insufficient SRLs Warning: standby redo logs not configured for thread 1 on mydb19c Transport-Related Property Settings: Property mydb19c Value mydbdg Value NetTimeout 30 300won-other check statements show database VERBOSE 'mydb19c' Sql check SQL > SELECT SWITCHOVER_STATUS FROM database exchange SWITCHOVERTO STANDBY toggle SWITCHOVER TO 'mydbdg';-- reference log DGMGRL > SWITCHOVER TO' mydbdg' Performing switchover NOW Please wait...Operation requires a connection to database "mydbdg" Connecting... Connected to "MYDBDG" Connected as SYSDG.New primary database "mydbdg" is opening...Operation requires start up of instance "mydb19c" on database "mydb19c" Starting instance "mydb19c"... Connected to "mydb19c" Connected to "mydb19c Connected to" mydb19c "Connected to an idle instance" Oracle instance started.Connected to "mydb19c" Database mounted.Database opened.Connected to "mydb19c" Switchover succeeded After new primary is "mydbdg" switch The recovery process starts automatically, and the new backup library is in read-only mode select name,database_role,open_mode from v$database SQL > NAME DATABASE_ROLE OPEN_MODE- MYDB19C PHYSICAL STANDBY READ ONLY WITH APPLYSQL > show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED-- -2 PDB$SEED READ ONLY NO 3 TESTPDB MOUNTED 4 MYPDB MOUNTED-- launch pdbalter pluggable database mypdb open At this point, dg broker configuration and handover successful fast switchover configuration reference fast failover, without human intervention, automatic switching through the broker tool.

Environmental preparation

-- the master / slave must enable the flashback zone ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;--ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;SHUTDOWN IMMEDIATE;STARTUP MOUNT;SHOW PARAMETER UNDO;ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320 SCOPE=BOTH;ALTER DATABASE ARCHIVELOG;ALTER SYSTEM SET db_recovery_file_dest_size=10g;ALTER SYSTEM SET db_recovery_file_dest=/backup/fra;ALTER DATABASE FLASHBACK ON;ALTER DATABASE OPEN.

Enable

Zero data loss, modified to the maximum available mode DGMGRL > EDIT DATABASE 'mydb19c' SET PROPERTY' LogXptMode'='SYNC';DGMGRL > EDIT DATABASE 'mydbdg' SET PROPERTY' LogXptMode'='SYNC';DGMGRL > EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY; to enable fast automatic failover-check the handover target DGMGRL > show database 'mydbdg' FastStartFailoverTarget; FastStartFailoverTarget =' mydb19c'-- enable enable fast_start failover;-- startup observation start observer -- check the database information select name,FS_FAILOVER_STATUS,FS_FAILOVER_OBSERVER_PRESENT from v$database

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report