Oracle 12c far sync active dataguard 架构使用DGMGRL管理配置网站安全分享!


最近一直在学习Oracle 12C 数据库,所以进行了一些文档梳理。 这里我主要介绍如何在Oracle 12c far sync active dataguard 架构上配置DG Broker

一:查看数据库版本:
SQL> col BANNER for a90
SQL> select * from v$version;

BANNER CON_ID
—————————————————————————————— ———-
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production 0
PL/SQL Release 12.1.0.2.0 – Production 0
CORE 12.1.0.2.0 Production 0
TNS for Linux: Version 12.1.0.2.0 – Production 0
NLSRTL Version 12.1.0.2.0 – Production 0
二:去除DG redo log 同步参数设置:
primary:
alter system set log_archive_dest_2=”;

alter system set log_archive_dest_3=”;

fay sync:
alter system set log_archive_dest_2=”;

standby:
alter system set log_archive_dest_2=”;
alter system set log_archive_dest_3=”;
注:在12cR1以前版本中,配置dg broker是不需要去除。但是在12cR1以上版本中,如果不去除已配置了dg redo log同步参数,那么在创建dg broker的时候会出现如下错误:

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

错误说明:

dg12c@dgpy /home/oracle$ oerr ora 16649
16649, 0000, “possible failover to another database prevents this database from being opened”
// *Cause: An attempt to open the primary database was made either after
// a failover occurred, or when it was likely to have occurred as
// the result of the primary being isolated from the fast-start
// failover target standby database and from the fast-start failover
// observer.
// *Action: Check if a failover did occur. If fast-start failover is enabled,
// and a failover did not occur, ensure that connectivity exists
// between the primary database and either the observer or the
// target standby database. Then, try opening the database again.
三:修改dg broker初始化参数:
分别在主库,far sync实例和备库上执行:
SQL> alter system set dg_broker_start=true scope=both;
四:配置dg broker:

primary:

创建broker配置:
DGMGRL> create configuration dg12c_broker as primary database is dg12cpy connect identifier is dg12cpy;
Configuration “dg12c_broker” created with primary database “dg12cpy”
添加备用数据库到配置中:
DGMGRL> add database dg12csd as connect identifier is dg12csd maintained as physical;
Database “dg12csd” added
启动配置:
DGMGRL> enable configuration
Enabled.
查看配置:

DGMGRL> show configuration
Configuration – dg12c_broker
Protection Mode: MaxPerformance
Members:
dg12cpy – Primary database
dg12csd – Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 20 seconds ago)

DGMGRL> show database verbose ‘dg12csd’
Database – dg12csd
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Average Apply Rate: 20.00 KByte/s
Active Apply Rate: 1.05 MByte/s
Maximum Apply Rate: 3.18 MByte/s
Real Time Query: ON
Instance(s):
dg12c
Properties:
DGConnectIdentifier = ‘dg12csd’
ObserverConnectIdentifier = ”
LogXptMode = ‘ASYNC’
RedoRoutes = ”
DelayMins = ‘0’
Binding = ‘optional’
MaxFailure = ‘0’
MaxConnections = ‘1’
ReopenSecs = ‘300’
NetTimeout = ’30’
RedoCompression = ‘DISABLE’
LogShipping = ‘ON’
PreferredApplyInstance = ”
ApplyInstanceTimeout = ‘0’
ApplyLagThreshold = ‘0’
TransportLagThreshold = ‘0’
TransportDisconnectedThreshold = ’30’
ApplyParallel = ‘AUTO’
StandbyFileManagement = ‘AUTO’
ArchiveLagTarget = ‘0’
LogArchiveMaxProcesses = ‘4’
LogArchiveMinSucceedDest = ‘1’
DbFileNameConvert = ”
LogFileNameConvert = ”
FastStartFailoverTarget = ”
InconsistentProperties = ‘(monitor)’
InconsistentLogXptProps = ‘(monitor)’
SendQEntries = ‘(monitor)’
LogXptStatus = ‘(monitor)’
RecvQEntries = ‘(monitor)’
StaticConnectIdentifier = ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgsd)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dg12csd_DGMGRL)(INSTANCE_NAME=dg12c)(SERVER=DEDICATED)))’
StandbyArchiveLocation = ‘/opt/oracle/oradata/dg12c/archive’
AlternateLocation = ”
LogArchiveTrace = ‘0’
LogArchiveFormat = ‘arch_%r_%t_%s.dbf’
TopWaitEvents = ‘(monitor)’
Database Status:
SUCCESS
启动standby 配置:

DGMGRL> ENABLE DATABASE ‘dg12csd’
Enabled.

DGMGRL> show database ‘dg12csd’
Database – dg12csd
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: 20.00 KByte/s
Real Time Query: ON
Instance(s):
dg12c
Database Status:
SUCCESS
添加far sync 配置:

DGMGRL> ENABLE FAR_SYNC dg12cfy;
Enabled.

DGMGRL> show configuration;
Configuration – dg12c_broker
Protection Mode: MaxPerformance
Members:
dg12cpy – Primary database
dg12csd – Physical standby database
dg12cfy – Far sync instance
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 7 seconds ago)
在 Broker 中设置 Redo 传输:

DGMGRL> EDIT DATABASE ‘dg12cpy’ SET PROPERTY ‘RedoRoutes’='(LOCAL : dg12cfy SYNC)’;
Property “RedoRoutes” updated

DGMGRL> EDIT FAR_SYNC ‘dg12cfy’ SET PROPERTY ‘RedoRoutes’='(dg12cpy : dg12csd ASYNC )’;
Property “RedoRoutes” updated查看配置:

DGMGRL> SHOW CONFIGURATION;
Configuration – dg12c_broker
Protection Mode: MaxPerformance
Members:
dg12cpy – Primary database
dg12cfy – Far sync instance
dg12csd – Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 23 seconds ago)
修改高可用模式:

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

DGMGRL> SHOW CONFIGURATION;
Configuration – dg12c_broker
Protection Mode: MaxAvailability
Members:
dg12cpy – Primary database
dg12cfy – Far sync instance
dg12csd – Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 30 seconds ago)

DGMGRL> show configuration when primary is ‘dg12cpy’;
Configuration when dg12cpy is primary – dg12c_broker
Members:
dg12cpy – Primary database
dg12cfy – Far sync instance
dg12csd – Physical standby database
五:验证同步:

PRIMARY:

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

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

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

SQL> commit;
Commit complete.

SQL> select * from t2;
ID NAME
———- ————————————————————
1 dfrt
STANDBY:

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

SQL> select * from t2;
no rows selected

SQL> select * from t2;
ID NAME
———- ————————————————————
1 dfrt


最近一直在学习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

www.dengb.comtruehttps://www.dengb.com/wzaq/1159897.htmlTechArticleOracle 12c far sync active dataguard 架构使用DGMGRL管理配置 最近一直在学习Oracle 12C 数据库,所以进行了一些文档梳理。 这里我主要介绍如何在O…

—-想了解更多的网站安全相关处理怎么解决关注<计算机技术网(www.ctvol.com)!!>

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/webstt/websy/98429.html

(0)
上一篇 2020年4月26日
下一篇 2020年4月26日

精彩推荐