创建 DataGuard Broker 配置
1. 使用 DGMGRL 连接到 primary database:
$ . oraenv
$ dgmgrl
dgmgrl> connect sys/oracle_4U
2. 创建配置 DGConfig1:
DGMGRL> create configuration 'DGConfig1' as
> primary database is 'u01prmy'
> connect identifier is u01prmy;
注意:DGConfig1 是配置的名称;第二行的’u01prmy’是主库的 db_unique_name; 第三行的’u01prmy’是指 tnsnames.ora 中连接到主库的网络服务名称。
3. 显示配置信息
DGMGRL> show configuration
在配置中添加 Standby Database
1. 添加备库 u01sby1 到配置中:
DGMGRL> add database 'u01sby1' as
> connect identifier is u01sby1;
注意:第一行的’u01sby1’指的是备库的 db_unique_name; 第二行的 u01dby1 是
tnsnames.ora 中连接到 standby database 的网络服务名称。
2. 确认 u01sby1 备库已经加入到配置中:
DGMGRL> show configuration
3. 启用配置和验证配置成功启用:
DGMGRL> enable configuration;
DGMGRL> show configration;