zoukankan      html  css  js  c++  java
  • 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 newtest snewtest
    db name newtest newtest
    ip 10.10.0.23 10.10.0.24

    1 主库上查询状态

    [oracle@localhost dbs]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:53:39 2018
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select open_mode ,database_role from v$database;
    
    OPEN_MODE            DATABASE_ROLE
    -------------------- ----------------
    READ WRITE           PRIMARY
    

    2 备库上查询状态

    [oracle@localhost trace]$ sqlplus  / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:55:23 2018
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select open_mode ,database_role from v$database;
    
    OPEN_MODE            DATABASE_ROLE
    -------------------- ----------------
    READ ONLY WITH APPLY PHYSICAL STANDBY
    

    3.备库上swichover

    [oracle@localhost trace]$ dgmgrl /
    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> switchover to snewtest;
    Performing switchover NOW, please wait...
    New primary database "snewtest" is opening...
    Operation requires startup of instance "newtest" on database "newtest"
    Starting instance "newtest"...
    Unable to connect to database
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    
    Failed.
    Warning: You are no longer connected to ORACLE.
    
    Please complete the following steps to finish switchover:
    		start up instance "newtest" of database "newtest"
    

    4.新备库上开启数据库

    [oracle@localhost dbs]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:56:29 2018
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    Connected to an idle instance.
    
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area  784998400 bytes
    Fixed Size                  2257352 bytes
    Variable Size             478154296 bytes
    Database Buffers          301989888 bytes
    Redo Buffers                2596864 bytes
    Database mounted.
    Database opened.
    

    5. 新备库上查询状态

    SQL> select open_mode ,database_role from v$database;
    
    OPEN_MODE            DATABASE_ROLE
    -------------------- ----------------
    READ ONLY            PHYSICAL STANDBY
    

    6.我们看到数据库打开了adg 但是 状态还是readonly,此时还没应用redo**

    [oracle@localhost dbs]$ dgmgrl /
    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> edit database newtest set state='ONLINE'
    > ;
    Succeeded.
    DGMGRL> exit
    

    7.再次查看新备库的状态

    [oracle@localhost dbs]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:57:35 2018
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select open_mode ,database_role from v$database;
    
    OPEN_MODE            DATABASE_ROLE
    -------------------- ----------------
    READ ONLY WITH APPLY PHYSICAL STANDBY
    

    8.查看新主库的数据库状态以及dgbroke的状态

    [oracle@localhost trace]$ sqlplus  / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:57:24 2018
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select open_mode ,database_role from v$database;
    
    OPEN_MODE            DATABASE_ROLE
    -------------------- ----------------
    READ WRITE           PRIMARY
    
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@localhost trace]$ dgmgrl /
    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> show configuration;
    
    Configuration - dg_newtest
    
      Protection Mode: MaxPerformance
      Databases:
    	snewtest - Primary database
    	newtest  - Physical standby database
    
    Fast-Start Failover: DISABLED
    
    Configuration Status:
    SUCCESS
  • 相关阅读:
    android关闭屏幕时不锁屏实现
    android Seekbar 拖动按钮显示不全问题
    webview在compileSdkVersion 大于等于23 android6.0以上系统执行js代码异常,但是在compileSdkVersion小于23 android6.0以下系统却执行正常问题
    Seekbar扩大点击区域
    android .9背景图作为TextView背景时文字无法居中问题
    android 使用系统级别权限
    自定义ViewPager,避免左右滑动时与水平滑动控件冲突
    ListVIew中包含水平滑动控件,左右滑动时容易触发上下滑动
    Android输入法挤乱布局问题
    android WebView缩放时卡顿问题
  • 原文地址:https://www.cnblogs.com/chinesern/p/8687088.html
Copyright © 2011-2022 走看看