zoukankan      html  css  js  c++  java
  • oracle DG 启动和关闭顺序

    启动顺序:先启动备库,后启动主库
    
    关闭顺序:先关闭主库,后关闭备库
    
    1、正确打开备库和主库
    
    备库:
    
    SQL> STARTUP MOUNT;
    
    SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  DISCONNECT FROM SESSION;
    
    主库:
    
    SQL> STARTUP MOUNT;
    
    SQL> ALTER DATABASE ARCHIVELOG;
    
    SQL> ALTER DATABASE OPEN;
    
    
    2、正确关闭顺序
    
    主库
    
    SQL>SHUTDOWN IMMEDIATE;
    
    
    备库:
    
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
    
    SQL>SHUTDOWN IMMEDIATE;
    
    ############################################################################
    
    
    1.  主备切换
    
     1) 主库切换为备库
    
     alter database commit to switchover to physical standby;
    
    主库有会话连接的时候
    
    alter database commit to switchover to physical standby with session shutdown;
    
    shutdown immediate
    
    startup nomount
    
    alter database mount standby database;
    
    alter database recover managed standby database disconnect from session;
    
    2) 从库切换为主库
    
    alter database commit to switchover to primary;
    
    shutdown immediate; 
    
    startup
    
    alter system switch logfile;
    
    3) 从库打开只读实时应用模式
    
    alter database recover managed standby databasecancel; 
    
    alter database open;
    
    alter database recover managed standby database using current logfile disconnect;
    
    4) 检查切换状态
    
    select open_mode,database_role,db_unique_name from v$database;
  • 相关阅读:
    nano编辑器__vi常用命令
    pyCharm最新2018激活方式(记录)
    一、centos7.4安装docker
    C#备份及还原数据库的实现
    System.Drawing.image 与ImageSource 互转
    Socket 异步通信
    图片与base64的互转
    程序中编写log日志
    SQLHelper
    Cond
  • 原文地址:https://www.cnblogs.com/vmsysjack/p/12579264.html
Copyright © 2011-2022 走看看