之前演示的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. javascript的slice()与splice()方法

    (1)数组和String对象都有slice()方法. //Array var list = ['A','B','C','D','DS']; console.log(list.slice(,));//截 ...

  2. Eclipse自动补全设置与Eclipse源代码下载

    以前使用VisualStudio和Sublime写代码的时候有很完善的代码提示,但是最近开始使用Eclipse弄JAVA的时候发现它的代码提示不是很习惯.上网找了一些资料,修改了代码提示的方式,记录在 ...

  3. 一个MySql Sql 优化技巧分享

    有天发现一个带inner join的sql 执行速度虽然不是很慢(0.1-0.2),但是没有达到理想速度.两个表关联,且关联的字段都是主键,查询的字段是唯一索引. sql如下: SELECT p_it ...

  4. BZOJ3932 CQOI2015 任务查询系统 【主席树】

    BZOJ3932 CQOI2015 任务查询系统 Description 最近实验室正在为其管理的超级计算机编制一套任务管理系统,而你被安排完成其中的查询部分.超级计算机中的任务用三元组(Si,Ei, ...

  5. ajax 上传读取excel

    $("#btnImport").click(function () { $("#File").click() })///委托 $("#File&quo ...

  6. copy, retain, assign , readonly , readwrite,strong,weak,nonatomic整理

    copy:建立一个索引计数为1的对象,然后释放旧对象 对NSString对NSString 它指出,在赋值时使用传入值的一份拷贝.拷贝工作由copy方法执行,此属性只对那些实行了NSCopying协议 ...

  7. check sub-string in the string

    if "blah" not in somestring: continue

  8. spring--集合注入(常规方法)

    数据,list,set,map,Properties 集合注入 package Spring_collections; /** * Created by luozhitao on 2017/8/11. ...

  9. Docker-Compose API too old for Windows

    I was working on some code with a Docker Windows container today and ran into this error message: ER ...

  10. js中对数字进行正则判断

    <script type="text/javascript"> function SubmitCk(num) { var reg = /^([a-zA-Z0-9]+[_ ...