DGbroker故障切换示例
1.主库故障
SQL> startup
ORACLE instance started. Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
ORA-: error in identifying control file, check alert log for more info
2.dgmgrl故障提示
DGMGRL> show configuration; Configuration - dgc Protection Mode: MaxPerformance
Databases:
atest1 - Primary database
atest2 - Physical standby database Fast-Start Failover: DISABLED Configuration Status:
ORA-: the Data Guard broker is not yet available
ORA-: cannot reach database "atest1"
DGM-: unable to determine configuration status
3.执行故障切换
DGMGRL> failover to atest2;
Performing failover NOW, please wait...
Failover succeeded, new primary is "atest2"
DGMGRL> show configuration; Configuration - dgc Protection Mode: MaxPerformance
Databases:
atest2 - Primary database
atest1 - Physical standby database (disabled)
ORA-: the standby database needs to be reinstated Fast-Start Failover: DISABLED Configuration Status:
SUCCESS
查看状态如上,提示已切换成功,atest2已成为主库,而atest1处于故障中。
4.处理故障数据库(采用rman复制的方式)
a.故障库需要启动到nomount
b.登录rman
rlwrap rman target sys/@atest2 auxiliary sys/@atest1
c.执行数据库克隆
RMAN> duplicate target database for standby nofilenamecheck from active database; Starting Duplicate Db at -DEC-
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID= device type=DISK contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/11.2.0/db1/dbs/orapwatest' auxiliary format
'/u01/app/oracle/product/11.2.0/db1/dbs/orapwatest' ;
}
executing Memory Script Starting backup at -DEC-
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID= device type=DISK
Finished backup at -DEC- contents of Memory Script:
{
sql clone "alter system set control_files =
''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment=
''Set by RMAN'' scope=spfile";
backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl';
restore clone controlfile to '/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl' from
'/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl';
sql clone "alter system set control_files =
''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment=
''Set by RMAN'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script sql statement: alter system set control_files = ''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment= ''Set by RMAN'' scope=spfile Starting backup at -DEC-
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2./db1/dbs/snapcf_atest.f tag=TAG20151229T212657 RECID= STAMP=
channel ORA_DISK_1: datafile copy complete, elapsed time: ::
Finished backup at -DEC- Starting restore at -DEC-
using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: copied control file copy
Finished restore at -DEC- sql statement: alter system set control_files = ''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment= ''Set by RMAN'' scope=spfile Oracle instance shut down connected to auxiliary database (not started)
Oracle instance started Total System Global Area bytes Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script sql statement: alter database mount standby database contents of Memory Script:
{
set newname for clone tempfile to new;
switch clone tempfile all;
set newname for clone datafile to new;
set newname for clone datafile to new;
set newname for clone datafile to new;
set newname for clone datafile to new;
set newname for clone datafile to new;
set newname for clone datafile to new;
backup as copy reuse
datafile auxiliary format new
datafile auxiliary format new
datafile auxiliary format new
datafile auxiliary format new
datafile auxiliary format new
datafile auxiliary format new
;
sql 'alter system archive log current';
}
executing Memory Script executing command: SET NEWNAME renamed tempfile to /u01/app/oracle/oradata/ATEST1/datafile/o1_mf_temp_%u_.tmp in control file executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting backup at -DEC-
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number= name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_system_c7sxhqz0_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_15qq2g9s_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: ::
channel ORA_DISK_1: starting datafile copy
input datafile file number= name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_system_c7sxv77x_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_16qq2gcr_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: ::
channel ORA_DISK_1: starting datafile copy
input datafile file number= name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_system_06qovlhs_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_17qq2gdu_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: ::
channel ORA_DISK_1: starting datafile copy
input datafile file number= name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_sysaux_07qovlkt_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_sysaux_18qq2gf1_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: ::
channel ORA_DISK_1: starting datafile copy
input datafile file number= name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_undotbs1_08qovlnu_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_undotbs1_19qq2gg5_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: ::
channel ORA_DISK_1: starting datafile copy
input datafile file number= name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_users_09qovlod_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_users_1aqq2ggc_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: ::
Finished backup at -DEC- sql statement: alter system archive log current contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script datafile switched to datafile copy
input datafile copy RECID= STAMP= file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_17qq2gdu_.dbf
datafile switched to datafile copy
input datafile copy RECID= STAMP= file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_sysaux_18qq2gf1_.dbf
datafile switched to datafile copy
input datafile copy RECID= STAMP= file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_undotbs1_19qq2gg5_.dbf
datafile switched to datafile copy
input datafile copy RECID= STAMP= file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_users_1aqq2ggc_.dbf
datafile switched to datafile copy
input datafile copy RECID= STAMP= file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_15qq2g9s_.dbf
datafile switched to datafile copy
input datafile copy RECID= STAMP= file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_16qq2gcr_.dbf
Finished Duplicate Db at -DEC-
d.删除和重新添加备库
DGMGRL> remove database atest1;
Removed database "atest1" from the configuration
DGMGRL> add database atest1;
Database "atest1" added
DGMGRL> disable configuration;
Disabled.
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration; Configuration - dgc Protection Mode: MaxPerformance
Databases:
atest2 - Primary database
atest1 - Physical standby database Fast-Start Failover: DISABLED Configuration Status:
SUCCESS
e.把故障库启动到open状态
SQL> alter database open; Database altered.
5.如果需要,可以把主备库切换切回来
DGMGRL> switchover to atest1;
Performing switchover NOW, please wait...
Operation requires a connection to instance "atest" on database "atest1"
Connecting to instance "atest"...
Connected.
New primary database "atest1" is opening...
Operation requires startup of instance "atest" on database "atest2"
Starting instance "atest"...
ORA-: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "atest1"
DGMGRL> show configuration; Configuration - dgc Protection Mode: MaxPerformance
Databases:
atest1 - Primary database
atest2 - Physical standby database Fast-Start Failover: DISABLED Configuration Status:
SUCCESS
DGbroker故障切换示例的更多相关文章
- 利用 Apache Synapse 模拟 Web 服务
Apache Synapse 是一个简单.轻量级的高性能企业服务总线 (ESB),它是在 Apache Software Foundation 的 Apache License Version 2.0 ...
- Mysql半同步复制模式说明及配置示例 - 运维小结
MySQL主从复制包括异步模式.半同步模式.GTID模式以及多源复制模式,默认是异步模式 (如之前详细介绍的mysql主从复制).所谓异步模式指的是MySQL 主服务器上I/O thread 线程将二 ...
- aws 基于延迟策略配置dns故障切换
前提:由于国内访问首尔地区经常出现不稳定情况,现将请求从nginx(sz)转发到nginx(hk)再转发到首尔地区,在基于不改变nginx(seoul)的配置的前提下,引入aws的延迟策略,同时保证国 ...
- PIX防火墙配置A/S故障切换
PIX防火墙配置A/S故障切换 1.基本命令 failover show failover failover lan enable failover lan interface zwish e2 fa ...
- Swift3.0服务端开发(一) 完整示例概述及Perfect环境搭建与配置(服务端+iOS端)
本篇博客算是一个开头,接下来会持续更新使用Swift3.0开发服务端相关的博客.当然,我们使用目前使用Swift开发服务端较为成熟的框架Perfect来实现.Perfect框架是加拿大一个创业团队开发 ...
- .NET跨平台之旅:将示例站点升级至 ASP.NET Core 1.1
微软今天在 Connect(); // 2016 上发布了 .NET Core 1.1 ,ASP.NET Core 1.1 以及 Entity Framework Core 1.1.紧跟这次发布,我们 ...
- 通过Jexus 部署 dotnetcore版本MusicStore 示例程序
ASPNET Music Store application 是一个展示最新的.NET 平台(包括.NET Core/Mono等)上使用MVC 和Entity Framework的示例程序,本文将展示 ...
- WCF学习之旅—第三个示例之四(三十)
上接WCF学习之旅—第三个示例之一(二十七) WCF学习之旅—第三个示例之二(二十八) WCF学习之旅—第三个示例之三(二十九) ...
- JavaScript学习笔记(一)——延迟对象、跨域、模板引擎、弹出层、AJAX示例
一.AJAX示例 AJAX全称为“Asynchronous JavaScript And XML”(异步JavaScript和XML) 是指一种创建交互式网页应用的开发技术.改善用户体验,实现无刷新效 ...
随机推荐
- Arraylist静态初始化
new ArrayList<String>(Arrays.asList("ab","cd","ef"));
- r语言 技巧总结
1.table函数返回众数,再转为dataframe as.data.frame(table(x)) 2.使用which 返回数组下标 which(rs.list=="rs1008507&q ...
- 关于HFile的存储结构梳理以及快速定位rowkey
转自:http://blog.csdn.net/yangbutao/article/details/8394149 了解了布隆过滤器作用于HFile之上以及对HFile有了更深层次了解. 另有:htt ...
- VHD和VHDX
VHD和VHDX没有太大区别,只是最大容量不一样,用是一样用,一定要转用ghost11,是新建vhdx,然后把vhd和vhdx个挂载,之后用ghost11分区到分区还原. VHD和VHDX简介 相对之 ...
- Struts2之Domain Model(域模型)。
使用原因 为了避免在action中有太多的类,而需要写大量的get().set(). 故在Struts2 使用 了 domain model. Action: private User user; p ...
- 第三百二十一节,Django框架,发送邮件
第三百二十一节,Django框架,发送邮件 全局配置settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' ...
- HTC Desire 816 root教程和方法
每个手机入手之后基本上都需要进行root,不root的话,手机里很多的无有软件都删除不了,咱们的HTC Desire 816也是一样的,也需要进行root才可以删除系统里自带的那些无用的软件,这些软件 ...
- 【AngularJS】AngularJS整合Springmvc、Mybatis环境搭建
近期想学习AngularJS的使用,网上搜了一圈后,折腾了半天解决bug后,成功使用AngularJS整合Springmvc.Spring.Mybatis搭建了一个开发环境.(这里Spring使用的版 ...
- 解决ERROR_INVALID_USER_BUFFER
我用CSocket编写了一个HTTP下载程序,接收数据大概如下: //...... //use CSocket class //send request... //...... ); ) { Zero ...
- C++字符串转化为数字的库函数
原文链接:http://blog.csdn.net/tsinfeng/article/details/5844838 1.atoi 功 能:把一字符串转换为整数 用 法:int atoi(const ...