檢視已經是true 如果不是的話 執行下面語句 alter system set dg_broker_start=true; SQL> show parameter dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean TRUE --主庫檢視 SQL> show parameter dg NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ cell_offloadgroup_name string dg_broker_config_file1 string /u01/app/oracle/product/12.2.0 /db_1/dbs/dr1pdbcndba_p.dat dg_broker_config_file2 string /u01/app/oracle/product/12.2.0 /db_1/dbs/dr2pdbcndba_p.dat dg_broker_start boolean TRUE inmemory_adg_enabled boolean TRUE
[oracle@~]$ dgmgrl sys/oracle@cndba DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 16 10:59:16 2017 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected to "pdbcndba_p" Connected as SYSDBA.
DGMGRL> create configuration 'dg_cndba' as primary database is 'pdbcndba_p' connect identifier is 'PDBCNDBA_P'; Configuration "dg_cndba" created with primary database "pdbcndba_p" create configuration '配置名稱自定義' as primary database is 'db_unique_name' connect identifier is 'tnsname.ora裡連線主庫'; --檢視配置資訊 DGMGRL> SHOW CONFIGURATION Configuration - dg_cndba Protection Mode: MaxPerformance Members: pdbcndba_p - Primary database Fast-Start Failover: DISABLED Configuration Status: DISABLED
DGMGRL> add database 'pdbcndba_s' as connect identifier is 'PDBCNDBA_S' maintained as physical; Error: ORA-16698: member has a LOG_ARCHIVE_DEST_n parameter with SERVICE attribute set Failed. [oracle@trace]$ oerr ora 16698 16698, 00000, "member has a LOG_ARCHIVE_DEST_n parameter with SERVICE attribute set" // *Cause: One or more LOG_ARCHIVE_DEST_n initialization parameters that // contain a SERVICE attribute for another member in the // configuration were set on the new member when attempting to add a // standby database or far sync instance to the configuration. // *Action: Clear all LOG_ARCHIVE_DEST_n initialization parameters that // contain a SERVICE attribute for another member in the configuration // on the new member to be added. 這個錯誤可以透過在Primary 和 Standby上取消log_archive_dest_n引數來解決,實際這一塊的引數應當是交給DG broker 來管理了,不再需要人為介入設定。 --主備庫執行以下語句,重置引數log_archive_dest_2 SQL> alter system set log_archive_dest_2='' scope=both; System altered. DGMGRL> add database 'pdbcndba_s' as connect identifier is 'PDBCNDBA_S' maintained as physical; Database "pdbcndba_s" added add database 'db_unique_name' as connect identifier is 'tnsname.ora連線備庫' maintained as physical; --檢視配置資訊: DGMGRL> show configuration Configuration - dg_cndba Protection Mode: MaxPerformance Members: pdbcndba_p - Primary database pdbcndba_s - Physical standby database Fast-Start Failover: DISABLED Configuration Status: DISABLED DGMGRL> DGMGRL> enable configuration; Enabled. DGMGRL> DGMGRL> DGMGRL> show configuration Configuration - dg_cndba Protection Mode: MaxPerformance Members: pdbcndba_p - Primary database pdbcndba_s - Physical standby database Error: ORA-16664: unable to receive the result from a member Fast-Start Failover: DISABLED Configuration Status: ERROR (status updated 14 seconds ago) DGMGRL> enable database pdbcndba_s Enabled. DGMGRL> show configuration Configuration - dg_cndba Protection Mode: MaxPerformance Members: pdbcndba_p - Primary database pdbcndba_s - Physical standby database Warning: ORA-16792: configurable property value is inconsistent with member setting Fast-Start Failover: DISABLED Configuration Status: WARNING (status updated 8 seconds ago) DGMGRL> show database pdbcndba_s statusreport; STATUS REPORT INSTANCE_NAME SEVERITY ERROR_TEXT cndba WARNING ORA-16714: the value of property ArchiveLagTarget is inconsistent with the member setting cndba WARNING ORA-16714: the value of property LogArchiveMaxProcesses is inconsistent with the member setting cndba WARNING ORA-16714: the value of property LogArchiveMinSucceedDest is inconsistent with the member setting cndba WARNING ORA-16714: the value of property DataGuardSyncLatency is inconsistent with the member setting cndba WARNING ORA-16714: the value of property LogArchiveTrace is inconsistent with the member setting cndba WARNING ORA-16675: database instance restart required for property value modification to take effect cndba WARNING ORA-16714: the value of property LogArchiveFormat is inconsistent with the member setting 備庫狀態報告6個屬性值與資料庫設定不一致,重新設定 DGMGRL> edit database pdbcndba_s set property LogArchiveFormat='%t_%s_%r.dbf'; Warning: ORA-16675: database instance restart required for property value modification to take effect Property "logarchiveformat" updated DGMGRL> edit database pdbcndba_s set property ArchiveLagTarget=0; Property "archivelagtarget" updated DGMGRL> edit database pdbcndba_s set property LogArchiveMaxProcesses=1; Property "logarchivemaxprocesses" updated DGMGRL> edit database pdbcndba_s set property LogArchiveMinSucceedDest=1; Property "logarchiveminsucceeddest" updated DGMGRL> edit database pdbcndba_s set property DataGuardSyncLatency=0; Property "dataguardsynclatency" updated DGMGRL> edit database pdbcndba_s set property LogArchiveTrace=0; Property "logarchivetrace" updated DGMGRL> show database pdbcndba_s statusreport; STATUS REPORT INSTANCE_NAME SEVERITY ERROR_TEXT DGMGRL> show configuration Configuration - dg_cndba Protection Mode: MaxPerformance Members: pdbcndba_p - Primary database pdbcndba_s - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 49 seconds ago)