zoukankan      html  css  js  c++  java
  • Oracle11gr2_ADG管理之switchover补充

    之前演示的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"
    

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

  • 相关阅读:
    MAC OS下安装Minizip
    MAC OS下安装pkg_config
    计算机图形学-几何变换
    计算机图形学-图形系统
    Unix&Linux大学教程 读书笔记【1-3章】
    Mixins 混入选项操作
    watch监控,对比新值和旧值做出相应判断
    用.native修饰器来对外部组件进行构造器内部方法的调用以及用原生js获取构造器里的方法
    methods 方法选项
    computed 计算选项
  • 原文地址:https://www.cnblogs.com/chinesern/p/8783823.html
Copyright © 2011-2022 走看看