DataGuard---->物理StandBy的角色切换之switchover
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了DataGuard---->物理StandBy的角色切换之switchover,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3039字,纯文字阅读大概需要5分钟。
内容图文
![DataGuard---->物理StandBy的角色切换之switchover](/upload/InfoBanner/zyjiaocheng/518/d3d61ce263064e29afba0721215e5057.jpg)
角色也变为physical standby
Primary>select database_role from v$database; DATABASE_ROLE -------------------------------- PHYSICAL STANDBY
如果此时打开数据库,为只读状态
Primary>alter database open; Database altered. Primary>select open_mode from v$database; OPEN_MODE ---------------------------------------- READ ONLY Primary>
三、StandBy数据库转换为Primary角色
StandBy--->Primary
StandBy>select switchover_status from v$database; SWITCHOVER_STATUS ---------------------------------------- TO PRIMARY StandBy> alter database commit to switchover to primary; Database altered. StandBy>alter database open; Database altered. StandBy>select open_mode from v$database; OPEN_MODE ---------------------------------------- READ WRITE StandBy>select database_role from v$database; DATABASE_ROLE -------------------------------- PRIMARY StandBy>
四、同步测试
1、当前的Primay数据库插入一条数据
Primay>select * from scott.dept; DEPTNO DNAME LOC ---------- ---------------------------- -------------------------- ACCOUNTING NEW YORK RESEARCH DALLAS SALES CHICAGO OPERATIONS BOSTON OPERATIONS OPERATIONS OPERATIONS OPERATIONS rows selected. Primay>INSERT INTO "SCOTT"."DEPT" ("DEPTNO", "DNAME", "LOC") VALUES (‘14‘, ‘OPERATIONS‘, ‘OPERATIONS‘); row created. StandBY>commit; Commit complete. Primay>select * from scott.dept; DEPTNO DNAME LOC ---------- ---------------------------- -------------------------- OPERATIONS OPERATIONS ACCOUNTING NEW YORK RESEARCH DALLAS SALES CHICAGO OPERATIONS BOSTON OPERATIONS OPERATIONS OPERATIONS OPERATIONS rows selected.
2、当前的StandBy启用redo应用
实时redo应用的情况
Primary>alter database recover managed standby database using current logfile disconnect from session; Database altered.
非实时redo应用的情况
alter database recover managed standby database disconnect from session; --应用redo
alter database recover managed standby database cancel; --暂停redo应用
查询
Primary>select * from scott.dept; DEPTNO DNAME LOC ---------- ---------------------------- -------------------------- OPERATIONS OPERATIONS ACCOUNTING NEW YORK RESEARCH DALLAS SALES CHICAGO OPERATIONS BOSTON OPERATIONS OPERATIONS OPERATIONS OPERATIONS rows selected.
无法同步的情况问题解决
1、如果无法同步,切换日志试试
StandBY>alter system switch logfile;
查询Priamry和StandBy的归档日志编号是否相同
StandBY>select max(sequence#) from v$archived_log; MAX(SEQUENCE#) -------------- 22
2、查看配置的服务名中的service_name 和lsnrctl status中的是否相同
DataGuard---->物理StandBy的角色切换之switchover
标签:complete red 插入 lte color rom 相同 alter status
本文系统来源:https://www.cnblogs.com/vmsysjack/p/12158431.html
内容总结
以上是互联网集市为您收集整理的DataGuard---->物理StandBy的角色切换之switchover全部内容,希望文章能够帮你解决DataGuard---->物理StandBy的角色切换之switchover所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。