程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> JAVA編程 >> JAVA綜合教程 >> Oracle 12c far sync active dataguard 架構使用DGMGRL管理配置

Oracle 12c far sync active dataguard 架構使用DGMGRL管理配置

編輯:JAVA綜合教程

Oracle 12c far sync active dataguard 架構使用DGMGRL管理配置


最近一直在學習Oracle 12C 數據庫,所以進行了一些文檔梳理。 這裡我主要介紹如何在Oracle 12c far sync active dataguard 架構上配置DG Broker

一:查看數據庫版本:
  1. SQL> col BANNER for a90
  2. SQL> select * from v$version;

  3. BANNER CON_ID
  4. ------------------------------------------------------------------------------------------ ----------
  5. Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0
  6. PL/SQL Release 12.1.0.2.0 - Production 0
  7. CORE 12.1.0.2.0 Production 0
  8. TNS for Linux: Version 12.1.0.2.0 - Production 0
  9. NLSRTL Version 12.1.0.2.0 - Production 0

二:去除DG redo log 同步參數設置:
  1. primary:
  2. alter system set log_archive_dest_2='';

  3. alter system set log_archive_dest_3='';

  4. fay sync:
  5. alter system set log_archive_dest_2='';

  6. standby:
  7. alter system set log_archive_dest_2='';
  8. alter system set log_archive_dest_3='';

注:在12cR1以前版本中,配置dg broker是不需要去除。但是在12cR1以上版本中,如果不去除已配置了dg redo log同步參數,那麼在創建dg broker的時候會出現如下錯誤:

  1. DGMGRL> create configuration dg12c_broker as primary database is dg12cpy connect identifier is xxxx;
  2. Error: ORA-16698: LOG_ARCHIVE_DEST_n parameter set for object to be added
  3. Failed.

  4. 錯誤說明:

  5. dg12c@dgpy /home/oracle$ oerr ora 16649
  6. 16649, 0000, "possible failover to another database prevents this database from being opened"
  7. // *Cause: An attempt to open the primary database was made either after
  8. // a failover occurred, or when it was likely to have occurred as
  9. // the result of the primary being isolated from the fast-start
  10. // failover target standby database and from the fast-start failover
  11. // observer.
  12. // *Action: Check if a failover did occur. If fast-start failover is enabled,
  13. // and a failover did not occur, ensure that connectivity exists
  14. // between the primary database and either the observer or the
  15. // target standby database. Then, try opening the database again.

三:修改dg broker初始化參數:
分別在主庫,far sync實例和備庫上執行:
  1. SQL> alter system set dg_broker_start=true scope=both;

四:配置dg broker:

primary:

創建broker配置:
  1. DGMGRL> create configuration dg12c_broker as primary database is dg12cpy connect identifier is dg12cpy;
  2. Configuration "dg12c_broker" created with primary database "dg12cpy"

添加備用數據庫到配置中:
  1. DGMGRL> add database dg12csd as connect identifier is dg12csd maintained as physical;
  2. Database "dg12csd" added

啟動配置:
  1. DGMGRL> enable configuration
  2. Enabled.

查看配置:

  1. DGMGRL> show configuration
  2. Configuration - dg12c_broker
  3. Protection Mode: MaxPerformance
  4. Members:
  5. dg12cpy - Primary database
  6. dg12csd - Physical standby database
  7. Fast-Start Failover: DISABLED
  8. Configuration Status:
  9. SUCCESS (status updated 20 seconds ago)

  10. DGMGRL> show database verbose 'dg12csd'
  11. Database - dg12csd
  12. Role: PHYSICAL STANDBY
  13. Intended State: APPLY-ON
  14. Transport Lag: 0 seconds (computed 1 second ago)
  15. Apply Lag: 0 seconds (computed 1 second ago)
  16. Average Apply Rate: 20.00 KByte/s
  17. Active Apply Rate: 1.05 MByte/s
  18. Maximum Apply Rate: 3.18 MByte/s
  19. Real Time Query: ON
  20. Instance(s):
  21. dg12c
  22. Properties:
  23. DGConnectIdentifier = 'dg12csd'
  24. ObserverConnectIdentifier = ''
  25. LogXptMode = 'ASYNC'
  26. RedoRoutes = ''
  27. DelayMins = '0'
  28. Binding = 'optional'
  29. MaxFailure = '0'
  30. MaxConnections = '1'
  31. ReopenSecs = '300'
  32. NetTimeout = '30'
  33. RedoCompression = 'DISABLE'
  34. LogShipping = 'ON'
  35. PreferredApplyInstance = ''
  36. ApplyInstanceTimeout = '0'
  37. ApplyLagThreshold = '0'
  38. TransportLagThreshold = '0'
  39. TransportDisconnectedThreshold = '30'
  40. ApplyParallel = 'AUTO'
  41. StandbyFileManagement = 'AUTO'
  42. ArchiveLagTarget = '0'
  43. LogArchiveMaxProcesses = '4'
  44. LogArchiveMinSucceedDest = '1'
  45. DbFileNameConvert = ''
  46. LogFileNameConvert = ''
  47. FastStartFailoverTarget = ''
  48. InconsistentProperties = '(monitor)'
  49. InconsistentLogXptProps = '(monitor)'
  50. SendQEntries = '(monitor)'
  51. LogXptStatus = '(monitor)'
  52. RecvQEntries = '(monitor)'
  53. StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgsd)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dg12csd_DGMGRL)(INSTANCE_NAME=dg12c)(SERVER=DEDICATED)))'
  54. StandbyArchiveLocation = '/opt/oracle/oradata/dg12c/archive'
  55. AlternateLocation = ''
  56. LogArchiveTrace = '0'
  57. LogArchiveFormat = 'arch_%r_%t_%s.dbf'
  58. TopWaitEvents = '(monitor)'
  59. Database Status:
  60. SUCCESS

啟動standby 配置:

  1. DGMGRL> ENABLE DATABASE 'dg12csd'
  2. Enabled.

  3. DGMGRL> show database 'dg12csd'
  4. Database - dg12csd
  5. Role: PHYSICAL STANDBY
  6. Intended State: APPLY-ON
  7. Transport Lag: 0 seconds (computed 0 seconds ago)
  8. Apply Lag: 0 seconds (computed 0 seconds ago)
  9. Average Apply Rate: 20.00 KByte/s
  10. Real Time Query: ON
  11. Instance(s):
  12. dg12c
  13. Database Status:
  14. SUCCESS

添加far sync 配置:

  1. DGMGRL> ENABLE FAR_SYNC dg12cfy;
  2. Enabled.

  3. DGMGRL> show configuration;
  4. Configuration - dg12c_broker
  5. Protection Mode: MaxPerformance
  6. Members:
  7. dg12cpy - Primary database
  8. dg12csd - Physical standby database
  9. dg12cfy - Far sync instance
  10. Fast-Start Failover: DISABLED
  11. Configuration Status:
  12. SUCCESS (status updated 7 seconds ago)

在 Broker 中設置 Redo 傳輸:

  1. DGMGRL> EDIT DATABASE 'dg12cpy' SET PROPERTY 'RedoRoutes'='(LOCAL : dg12cfy SYNC)';
  2. Property "RedoRoutes" updated

  3. DGMGRL> EDIT FAR_SYNC 'dg12cfy' SET PROPERTY 'RedoRoutes'='(dg12cpy : dg12csd ASYNC )';
  4. Property "RedoRoutes" updated
查看配置:

  1. DGMGRL> SHOW CONFIGURATION;
  2. Configuration - dg12c_broker
  3. Protection Mode: MaxPerformance
  4. Members:
  5. dg12cpy - Primary database
  6. dg12cfy - Far sync instance
  7. dg12csd - Physical standby database
  8. Fast-Start Failover: DISABLED
  9. Configuration Status:
  10. SUCCESS (status updated 23 seconds ago)

修改高可用模式:

  1. DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MaxAvailability;
  2. Succeeded.

  3. DGMGRL> SHOW CONFIGURATION;
  4. Configuration - dg12c_broker
  5. Protection Mode: MaxAvailability
  6. Members:
  7. dg12cpy - Primary database
  8. dg12cfy - Far sync instance
  9. dg12csd - Physical standby database
  10. Fast-Start Failover: DISABLED
  11. Configuration Status:
  12. SUCCESS (status updated 30 seconds ago)

  13. DGMGRL> show configuration when primary is 'dg12cpy';
  14. Configuration when dg12cpy is primary - dg12c_broker
  15. Members:
  16. dg12cpy - Primary database
  17. dg12cfy - Far sync instance
  18. dg12csd - Physical standby database

五:驗證同步:

PRIMARY:

  1. SQL> alter session set container=pdb1;
  2. Session altered.

  3. SQL> create table t2 as select * from t1 where 1=0;
  4. Table created.

  5. SQL> insert into t2(id,name) values (1,'dfrt');
  6. 1 row created.

  7. SQL> commit;
  8. Commit complete.

  9. SQL> select * from t2;
  10. ID NAME
  11. ---------- ------------------------------------------------------------
  12. 1 dfrt

STANDBY:

  1. SQL> alter session set container=pdb1;
  2. Session altered.

  3. SQL> select * from t2;
  4. no rows selected

  5. SQL> select * from t2;
  6. ID NAME
  7. ---------- ------------------------------------------------------------
  8. 1 dfrt








  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved