`

Dataguard实战(15):RHEL4.5 安装 Oracle10G Dataguard 多个备库 - 使用DGMGRL管理主备库

 
阅读更多

十五、使用DGMGRL管理主备库

修改初始化参数:
SQL> alter system set dg_broker_start=true scope=both;
启动DGMGRL:
$ dgmgrl
连接到主库:
DGMGRL> connect sys@db_wending
Password:*********
创建配置:
DGMGRL> create configuration dgwending as primary database is wending connect identifier is db_wending;
添加备用库:
DGMGRL> add database phystdby as connect identifier is db_phystdby maintained as physical;
DGMGRL> add database logstdby as connect identifier is db_logstdby maintained as logical;
查看配置:
DGMGRL> show configuration
设置数据库属性:
DGMGRL> edit database wending set property 'LogArchiveFormat' = 'log_%t_%s_%r_%d.arc';
显示数据库属性:
DGMGRL> show database verbose wending
DGMGRL> show database verbose phystdby
DGMGRL> show database verbose logstdby
启用配置:
DGMGRL> enable configuration
DGMGRL> enable database wending
DGMGRL> enable database phystdby
DGMGRL> enable database logstdby
检查数据库状态:
DGMGRL> show database wending
DGMGRL> show database phystdby
DGMGRL> show database logstdby
禁用配置:
DGMGRL> disable configuration
禁用某个备用库:
DGMGRL> disable database phystdby;
DGMGRL> disable database logstdby;
从配置中删除备用库:
DGMGRL> remove database phystdby
DGMGRL> remove database logstdby
删除配置:
DGMGRL> remove configuration
执行Switchover切换:
DGMGRL> switchover to phystdby
执行Failover切换:
DGMGRL> failover to phystdby
生成数据库状态报告(如果你遇到Ora-16810时可以使用):
DGMGRL> show database wending statusreport
修改Data Guard的保护模式:
DGMGRL> edit configuration set protection mode as maxperformance;
更改物理备库到只读状态:
DGMGRL> edit database phystdby set state='read-only';
停止主库到备库的日志传送:
DGMGRL> edit database wending set state='log-transport-off';
将主库离线:
DGMGRL> edit database wending set state='offline';
要将主库重新上线,需要先手动启动数据库,然后重新进入DGMGRL:
$ sqlplus '/as sysdba'
SQL> startup;
$ dgmgrl
DGMGRL> connect sys@db_wending
Password:*********
DGMGRL> edit database wending set state='online';

--End--

from:http://hi.baidu.com/edeed/blog/item/cab482027d9dbe084bfb5119.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics