回滚Swtichover
从11.2.0.2开始,如果由于某种原因switchover没有成功,可以回滚switchover。
For physical standby databases in situations where an error occurred and it is not
possible to continue with the switchover, it might still be possible to revert the new
physical standby database back to the primary role by using the following steps. (This
functionality is available starting with Oracle Database 11 g Release 2 (11.2.0.2).)
1. Shut down and mount the new standby database (old primary).
2. Start Redo Apply on the new standby database.
3. Verify that the new standby database is ready to be switched back to the primary
role. Query the SWITCHOVER_STATUS column of the V$DATABASE view on the
new standby database. For example:
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
—————–
TO_PRIMARY
1 row selected
A value of TO PRIMARY or SESSIONS ACTIVE indicates that the new standby
database is ready to be switched to the primary role. Continue to query this
column until the value returned is either TO PRIMARY or SESSIONS ACTIVE.
4. Issue the following statement to convert the new standby database back to the
primary role:
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
If this statement is successful, the database will be running in the primary
database role, and you do not need to perform any more steps.
If this statement is unsuccessful, then continue with Step 5.
一般来说执行到这个步骤,基本就OK了。此时primary database是mount状态,启动到OPEN后,验证同步OK,可以正常工作。
5. When the switchover to change the role from primary to physical standby was
initiated, a trace file was written in the log directory. This trace file contains the
SQL statements required to re-create the original primary control file. Locate the
trace file and extract the SQL statements into a temporary file. Execute the
temporary file from SQL*Plus. This will revert the new standby database back to
the primary role.
6. Shut down the original physical standby database.
7. Create a new standby control file. This is necessary to resynchronize the primary
database and physical standby database. Copy the physical standby control file to
the original physical standby system. Section 3.2.2 describes how to create a
physical standby control file.
8. Restart the original phys ical standby instance.
If this procedure is successful and archive gap management is enabled, the FAL
processes will start and re-archive any missing archived redo log files to the
physical standby database. Force a log switch on the primary database and
examine the alert logs on both the primary database and physical standby
database to ensure the archived redo log file sequence numbers are correct.
See Section 6.4.3.1 for information about archive gap management and
Appendix F for information about locating the trace files.
9. Try the switchover again.
At this point, the Data Guard configuration has been rolled back to its initial state,
and you can try the switchover operation again (after correcting any problems that
might have led to the initial unsuccessful switchover).
回滚Swtichover的更多相关文章
- eclipse,myeclipse 误删文件,回滚历史文件操作
昨天因为误操作把一个写了一上午的代码给删了,找到的这个,以前竟然还没发现有这个功能- -! 具体操作: 1.建立同路径同名的文件 2.文件上右键 --> Compare With --> ...
- Log4net入门(回滚日志文件篇)
在上一篇Log4net(日志文件篇)中,我们使用"log4net.Appender.FileAppender"将日志信息输出到一个单一的文件中,随着应用程序的持续使用,该日志文件会 ...
- spring 事务回滚
1.遇到的问题 当我们一个方法里面有多个数据库保存操作的时候,中间的数据库操作发生的错误.伪代码如下: public method() { Dao1.save(Person1); Dao1.save( ...
- SqlServer批量刷数据执行事务回滚语句备份
企业进行对数据库执行刷数据工作,一段很长的语句希望同时成功或者失败时用到. 1.建立测试环境 /**************************************************** ...
- git用法之[回滚代码]
我们在写代码的任何过程中,都有可能出错,任何过程都有可能要!回!滚!代!码!事关重大!一定要详细讲讲. 一.关于 工作区.暂存区.本地分支: 工作区:即自己当前分支所修改的代码,git add xx ...
- springmvc+mybatis事务回滚
spring-mybatis.xml中 配置了 <!-- 拦截器方式配置事物 --> <tx:advice id="transactionAdvice" tran ...
- 【Java EE 学习 54】【OA项目第一天】【SSH事务管理不能回滚问题解决】【struts2流程回顾】
一.SSH整合之后事务问题和总结 1.引入问题:DAO层测试 假设将User对象设置为懒加载模式,在dao层使用load方法. 注意,注释不要放开. 使用如下的代码块进行测试: 会报错:no sess ...
- 【Java EE 学习 53】【Spring学习第五天】【Spring整合Hibernate】【Spring整合Hibernate、Struts2】【问题:整合hibernate之后事务不能回滚】
一.Spring整合Hibernate 1.如果一个DAO 类继承了HibernateDaoSupport,只需要在spring配置文件中注入SessionFactory就可以了:如果一个DAO类没有 ...
- 【Java EE 学习 52】【Spring学习第四天】【Spring与JDBC】【JdbcTemplate创建的三种方式】【Spring事务管理】【事务中使用dbutils则回滚失败!!!??】
一.JDBC编程特点 静态代码+动态变量=JDBC编程. 静态代码:比如所有的数据库连接池 都实现了DataSource接口,都实现了Connection接口. 动态变量:用户名.密码.连接的数据库. ...
随机推荐
- LoadRunner如何在注册业务脚本中设置参数化唯一性
LR在录制一个网站注册业务的脚本时,突然间遇到一个问题:注册时,由于注册用户需要验证唯一性,所以在LR回放脚本时,用Run-time Viewer工具回放可以发现(先在脚本中设置几个断点),真实运行的 ...
- SQL*Plus break与compute的简单用法
SQL*Plus break与compute的简单用法在SQL*Plus提示符下输出求和报表,我们可以借助break与compute两个命令来实现.这个两个命令简单易用,可满足日常需求,其实质也相当于 ...
- 那些 Cynthia 教我的事 之 PMSec (二)
一.在Foreach之前要判断是否为空. 常常从数据库里取出来表就直接用了,很少记得判断是否有值.不严谨的说. 专业人员写的是酱滴... DataLayer.PMSecDataSet.PMSECReq ...
- 项目总结之SSI (一)
这是我进公司之后做的第一个新项目,从无到有. 去年夏天和同事在会议室里度过的日子还恍如昨日啊,时光啊,你慢些走... 作为一个外部项目,美工设计了一个Win8风格的界面,看到现在做前台的同学做的一样是 ...
- Entity Framework with MySQL
Get Entity Framework: http://msdn.microsoft.com/en-us/data/ee712906 Entity Framework 6 Tools for Vis ...
- 2014年1月9日 Oracle 实用系统函数
1.空值处理 1.1 NVL(column/value,VALUE2) 与SQLSERVER的ISNULL相同 1.2 NVL2(column/value,Value2,Value3) 若参数1为空则 ...
- Spring 之 注解详解
概述 注释配置相对于 XML 配置具有很多的优势: 它可以充分利用 Java 的反射机制获取类结构信息,这些信息可以有效减少配置的工作.如使用 JPA 注释配置 ORM 映射时,我们就不需要指定 PO ...
- jQuery 获取 多个 复选框 和 javascript 对比
$('input[name="teams"]:checked').size() // 全选 $("#quanteam").bind("click&qu ...
- [转]IP地址-子网掩码-默认网关
IP地址:是给每个连接在Internet上的主机分配的一个32bit地址.地址有两部分组成,一部分为网络地址,另一部分为主机地址.IP地址分为A.B.C.D.E 5类.常用的是B和C两类.网络地址的位 ...
- Git学习03 --远程仓库
把本地库的内容推送到远程(github), 用git push命令,实际上是把当前分支master推送到远程. 由于远程库是空的,我们第一次推送master分支时,加上了-u参数,Git不但会把本地的 ...