之前演示的switchver总是提示下面的错误,并且需要人工干预:

Oracle11gr2_ADG管理之switchover实战

DGMGRL> switchover to snewtest;

Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:
start up instance "newtest" of database "newtest"

解决方案

1.主库上配置 listener.ora

[oracle@localhost admin]$ vi listener.ora 

# listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools. LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
) SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = newtest)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1/)
(SID_NAME = newtest)
)
(SID_DESC =
(GLOBAL_DBNAME = newtest_DGMGRL)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1/)
(SID_NAME = newtest)
)
)

2.备库上配置 listener.ora

[oracle@localhost ~]$ cd /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/

[oracle@localhost admin]$ vi listener.ora 

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
) SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = newtest)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1/)
(SID_NAME = newtest)
)
(SID_DESC =
(GLOBAL_DBNAME = snewtest_DGMGRL)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1/)
(SID_NAME = newtest)
) )

3. 主备库重启lsrnctl

lsrnctl stop
lsrnctl start

任何库上执行切换

[oracle@localhost admin]$ dgmgrl sys/oracle@newtest
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production Copyright (c) 2000, 2009, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information.
Connected.

切换到备库

DGMGRL> swithover to snewtest
Unrecognized command "swithover", try "help"
DGMGRL> switchover to snewtest;
Performing switchover NOW, please wait...
Operation requires a connection to instance "newtest" on database "snewtest"
Connecting to instance "newtest"...
Connected.
New primary database "snewtest" is opening...
Operation requires startup of instance "newtest" on database "newtest"
Starting instance "newtest"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "snewtest"

切换回主库

DGMGRL> switchover to  newtest;
Performing switchover NOW, please wait...
Operation requires a connection to instance "newtest" on database "newtest"
Connecting to instance "newtest"...
Connected.
New primary database "newtest" is opening...
Operation requires startup of instance "newtest" on database "snewtest"
Starting instance "newtest"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "newtest"

这次的切换变得十分顺利 不需要人工干预了

Oracle11gr2_ADG管理之switchover补充的更多相关文章

  1. Oracle11gr2_ADG管理之switchover实战

    . 环境 db_primary db_stanby 备注 db版本 11.2.0.4.0 11.2.0.4.0 os版本 centos 6.4 centos 6.4 db_unique_name ne ...

  2. SpringMVC拦截器2(资源和权限管理)(作为补充说明)

    SpringMVC拦截器(资源和权限管理) 1.DispatcherServlet SpringMVC具有统一的入口DispatcherServlet,所有的请求都通过DispatcherServle ...

  3. Linux内存管理 (9)mmap(补充)

    之前写过一篇简单的介绍mmap()/munmap()的文章<Linux内存管理 (9)mmap>,比较单薄,这里详细的梳理一下. 从常用的使用者角度介绍两个函数的使用:然后重点是分析内核的 ...

  4. Oracle11gr2_ADG管理之在备库上模拟failover的过程实战

    技术建议和方案. 要求failover后不重建备库,并能够把failover的数据库重新切换回备库 主库为newtest,备库为snewtest 备库上已经开启了闪回 得到一个参考的SCN SQL&g ...

  5. Oracle11gr2_ADG管理之跳归档恢复dg实战

    模拟故障 关闭备库 SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut dow ...

  6. Oracle11gR2_ADG管理之恢复主库的truncate表实战

    备库开启flashback database #关闭备库的同步 SQL> alter database recover managed standby database cancel; Data ...

  7. Oracle11gR2_ADG管理之resinstate实战

    主库上打开闪回 SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES 模拟断电 SQL> ...

  8. Linux学习《第五章用户文件权限管理》之补充学习

  9. Linux内存管理 (9)mmap

    专题:Linux内存管理专题 关键词:文件映射.匿名映射.私有映射.共享映射 mmap/munmap是常用的一个系统调用,使用场景是:分配内存.读写大文件.连接动态库文件.多进程间共享内存. 更详细解 ...

随机推荐

  1. 【test】

    {"type":[    {"name":"专题分类","num":1,"value":[      ...

  2. jQuery轮播插件SuperSlide【2016-10-14】

    [一.页面实现轮播效果] (1)效果下图可以自动轮播 (2)代码  autoPlay控制是否轮播 //banner轮播 $(".banner").slide({mainCell:& ...

  3. tomcat错误:The page you tried to access (/manager/login.do) does not exist

    今天在idea上跑一个项目,所有配置都正常,其他接口测试也正常.唯独“/manage/user”接口在测试的时候后台没反应,也就是程序根本没往下走,postman测试显示如下: 浏览器范围url连接显 ...

  4. BZOJ2342 Shoi2011 双倍回文 【Manacher】

    BZOJ2342 Shoi2011 双倍回文 Description Input 输入分为两行,第一行为一个整数,表示字符串的长度,第二行有个连续的小写的英文字符,表示字符串的内容. Output 输 ...

  5. Appium + Python App自动化(2)第一个脚本

    [1]打开你的夜神模拟器(或者连接你的手机) [2]打开桌面的Appium [3]下载你要测的App的apk文件,放到桌面 [4]拖动你的apk安装包到夜神模拟器里,然后模拟器会提示你安装.安装.原来 ...

  6. eclipse marketplace网络连接失败的解决方法

    2015-12-04 01:12:33 本想在eclipse上安装一个插件,点进help-EclipseMarketplace却连接失败,错误如下: 在help-instal new software ...

  7. vim初探

    https://github.com/spf13/spf13-vim 安装了此博主的开源项目. :vsp   ——竖分屏 :sp   ——横分屏

  8. 数组去重(初识ES6)

    较常见的一问题:数组去重. 方法一:利用hash数组的原理 var arr=[1,3,3,4,5,5,6,6,7,8,69,8,99,9,0,]; function unique(arry){ var ...

  9. Mybatis数据的增删改查

    数据: Student{id int,name String ,age int} 配置mybatis-config.xml <?xml version="1.0" encod ...

  10. dubbox实现REST服务

    一.dubbox的由来 dubbox是当当网基于dubbo的基础上开发的扩展版,也可以认为是dubbo的升级版,根据当前互联网的应用需求,增加了很多扩展的功能. dubbox并没有发布到maven中央 ...