Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

Wesley13
• 阅读 761

Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part-II

Published 3 years ago by Jignesh Jethwa

Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

In my Previous article we have covered How to configured oracle 11g Data Guard on CentOS 6.5, Now we will look into switchover and switch back activity:

After configuring data guard, databases would be either primary and standby database role, and we can altered these roles without loss of data or without resetting logs. called switchover and switch back.

Switchover:

Before performing switchover, kindly verify the state of data guard on both the instances by following SQL queries:

SQL> ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS'; SQL> SELECT sequence#, first_time, next_time, applied FROM v$archived_log ORDER BY sequence#; ... ... 59 08-OCT-14 08-OCT-14 YES 60 08-OCT-14 08-OCT-14 YES 61 08-OCT-14 08-OCT-14 YES

SQL> select dest_name,status,error from v$archive_dest where dest_name='LOG_ARCHIVE_DEST_2'; DEST_NAME


STATUS ERROR


LOG_ARCHIVE_DEST_2 VALID

SQL> select message from v$dataguard_status;

Note: This command will give you appropriate message about the data guard current status.

After getting confirmation on data guard smooth activity, we can instantiate switchover activity by issuing following sort of commands:

On Primary database:

Step-1>>
Connect to Primary database and convert primary database to standby.

[oracle@pr ~]$ sqlplus / as sysdba

SQL> alter database commit to switchover to standby; Database altered.

Step-2>>
Shutdown primary database:

SQL> shutdown immediate;

Step-3>>

Startup nomount old primary database as new standby database:

SQL> startup nomount ORACLE instance started. Total System Global Area 972898304 bytes Fixed Size 2219272 bytes Variable Size 805307128 bytes Database Buffers 159383552 bytes Redo Buffers 5988352 bytes

SQL> alter database mount standby database; Database altered.

SQL> alter database recover managed standby database disconnect from session; Database altered.

Verify database role on old primary database:

SQL> select name,open_mode,database_role from v$database; NAME OPEN_MODE DATABASE_ROLE


RTS MOUNTED PHYSICAL STANDBY

On Standby database:

Step-4>>
On original standby database, Convert old standby database to primary database:

[oracle@dr ~]$ sqlplus / as sysdba

Step-5>>

Convert old standby database as primary and shutdown database:

 SQL> alter database commit to switchover to primary; Database altered.

SQL> shutdown immediate; ORA-01109: database not open Database dismounted. ORACLE instance shut down.

Step-6>>

Startup old standby database as primary database:

SQL> startup ORACLE instance started. Total System Global Area 972898304 bytes Fixed Size 2219272 bytes Variable Size 717226744 bytes Database Buffers 247463936 bytes Redo Buffers 5988352 bytes Database mounted. Database opened.

Verify database role on old standby database:

SQL> select name,open_mode,database_role from v$database; NAME OPEN_MODE DATABASE_ROLE


RTS READ WRITE PRIMARY

Switch over activity have completed successfully, our old primary database has become standby and old standby database has become primary database.

Note

To test above switchover activity, generate multiple archive logs on primary database and verify those archive logs being transferred on standby database.

Switchback:
To switchback, you have to follow same above mentioned 6 steps.

Stay Tune. Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

Share this:

Like this:

Loading...

Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

Steps to configure Manual Data Guard - Oracle 11g Manual Data Guard Part-I

April 27, 2016

In "Oracle"

Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

How to open physical standby database in read only mode - Active Data Guard Part -III

October 15, 2014

In "Oracle 11g"

Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

Switch over and switch back - Oracle 11g Manual Data Guard Part-II

May 12, 2016

In "Oracle"

This entry was posted in Oracle 11gOracle Replication and tagged Data Guard.

Post navigation

← ORA-16038-log 4 sequence# 10702 cannot be archived-ORA-19809: limit exceeded for recovery files-ORA-19804: cannot reclaim 52428800 bytes disk space from 107374182400 limit

How to open physical standby database in read only mode – Active Data Guard Part -III →

6 THOUGHTS ON “ORACLE 11G DATA GUARD SWITCHOVER AND SWITCHBACK – ACTIVE DATA GUARD PART-II”

  1. Shrikant on November 14, 2014

    Very nice help for Switchover and Switchback

    reply

  2. Jignesh Jethwa on November 15, 2014

    Thank you Shrikant for writing… Stay Tune. Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

    reply

  3. Sudheer on August 11, 2015

    Very helpful steps. Is it going to be the same in a actual DR scenario when the Primary went down unexpectedly?

    reply

    • Jignesh Jethwa on August 11, 2015

      Thank you Sudheer for writing!
      Yes, These mentioned steps are used in Actual DR scenario’s.

      Switch over and switchback are the planned activity(like h/w upgrade on primary or any maintenance task) its not unexpectedly happens.
      In case of Primary went down unexpectedly, you need to Failover to the DR database and make DR database as a primary database. Still it is depend on depth of the worst situation on primary database. If Primary database recoverable within RTO than it is okay else you need to Failover.
      Kindly visit on http://dbatricksworld.com/oracle-11g-physical-standby-data-guard-failover-steps-data-guard-part-v/ to know more about Failover.

      Stay Tune. Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

      reply

  4. Ignatious Enas on December 17, 2016

    Dear Jignesh,

    Your article is great !!!

    Now i have my standby database in read-only with apply mode.
    Can i still use the same procedure for switchover and failover ? Or should be bring the Standby DB to mount state fist before starting ?

    Thanks in advance.
    Ignatious Enas

    reply

    • Jignesh Jethwa on December 20, 2016

      Thank you Ignatious for writing!
      You can choose either way, but i would suggest to go with mount state first before starting.
      Stay Tune. Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part

      reply

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
3个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Easter79 Easter79
3年前
Steps to configure Oracle 11g Data Guard Physical Standby – Active Data Guard Part
StepstoconfigureOracle11gDataGuardPhysicalStandby–ActiveDataGuardPartIPublished
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Android蓝牙连接汽车OBD设备
//设备连接public class BluetoothConnect implements Runnable {    private static final UUID CONNECT_UUID  UUID.fromString("0000110100001000800000805F9B34FB");
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
9个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这