签到成功

知道了

CNDBA社区CNDBA社区

Oracle 12c 新特性 --- Oracle Data Guard Broker 支持执行DGMGRL命令脚本

2017-08-16 22:19 3063 0 原创 Oracle 12c
作者: leo

概念

http://www.cndba.cn/cndba/leo1990/article/2123

This feature enables command scripts to be executed through the Oracle Data Guard broker DGMGRL command-line interface; much like in SQL*Plus. DGMGRL commands, SQL commands using the broker SQL command, and operating system commands using the new HOST (or !) capability can be put into a file and executed on the DGMGRL command line.
该特性使命令脚本可以通过Oracle Data Guard broker DGMGRL命令行界面执行;就像在SQL*Plus。DGMGRL命令、使用代理SQL命令的SQL命令,以及使用新的主机(或!)功能的操作系统命令可以放入文件中,并在DGMGRL命令行上执行。
This feature enables customers who use the standard interface to Oracle Data Guard (DGMGRL) in their broker configurations to use scripts for Oracle Data Guard operations.
该特性使使用标准接口的客户可以在其代理配置中使用Oracle Data Guard(DGMGRL),从而为Oracle数据保护操作使用脚本。

实验

http://www.cndba.cn/cndba/leo1990/article/2123
http://www.cndba.cn/cndba/leo1990/article/2123

1)@命令允许执行存储在脚本文件中的DGMGRL命令,脚步里的命令是能在DGMGRL命令行执行的脚步: 详细更多可执行命令可参考官方文档:
http://docs.oracle.com/database/122/DGBKR/oracle-data-guard-broker-commands.htm#DGBKR3668
[[email protected] u01]$ dgmgrl [email protected]
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 16 14:44:15 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> @/u01/test.sql

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 51 seconds ago)

2)使用DGMGRL /(slash)命令重复在命令提示符中输入的最后一个命令。 [[email protected] u01]$ dgmgrl [email protected]
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 16 15:03:27 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> 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 39 seconds ago)

DGMGRL> /

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 40 seconds ago)
3) DGMGRL CONNECT命令将您连接到数据库或far sync instance,该实例是数据保护代理配置的成员。
[[email protected] u01]$ dgmgrl sys/oracle
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 16 15:07:22 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 SYSDG.
DGMGRL> connect sys/oracle
Connected to "pdbcndba_p"
Connected as SYSDG.
DGMGRL> connect [email protected]  
Connected to "pdbcndba_p"
Connected as SYSDBA.
4) 执行 show 和VALIDATE命令
[[email protected] u01]$ dgmgrl sys/oracle
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 16 15:07:22 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 SYSDG.

DGMGRL> show database pdbcndba_p

Database - pdbcndba_p

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    cndba

Database Status:
SUCCESS

DGMGRL> VALIDATE DATABASE pdbcndba_p

  Database Role:    Primary database

  Ready for Switchover:  Yes

  Flashback Database Status:
    pdbcndba_p:  Off

  Managed by Clusterware:
    pdbcndba_p:  NO             
    Warning: Ensure primary database's StaticConnectIdentifier property
    is configured properly so that the primary database can be restarted
    by DGMGRL after switchover

http://www.cndba.cn/cndba/leo1990/article/2123

参考链接:http://www.cndba.cn/cndba/leo1990/article/2123

http://docs.oracle.com/database/122/NEWFT/new-features.htm#NEWFT-GUID-9AD9717E-F720-444E-BB08-BD94961E8F69
http://www.cndba.cn/cndba/leo1990/article/2123http://www.cndba.cn/cndba/leo1990/article/2123http://www.cndba.cn/cndba/leo1990/article/2123

http://docs.oracle.com/database/122/DGBKR/oracle-data-guard-broker-commands.htm#DGBKR-GUID-E3FF7031-FB85-4836-9F66-37DDDA0F8DAE

http://www.cndba.cn/cndba/leo1990/article/2123
http://www.cndba.cn/cndba/leo1990/article/2123

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
leo

leo

关注

坚持你的坚持

  • 202
    原创
  • 0
    翻译
  • 39
    转载
  • 16
    评论
  • 访问:766317次
  • 积分:1270
  • 等级:核心会员
  • 排名:第8名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ