oracle11g dataguard切換
1.檢視主庫是否滿足切換條件
SQL> select switchover_status from v$database; SWITCHOVER_STATUS ---------------------------------------- TO STANDBY
有時候會顯示 SESSION ACTIVE,這表示當前還有活動的會話連線。
2.執行下面的命令切換
SQL> alter database commit to switchover to physical standby; Database altered.
如果第一步切換條件檢視顯示 SESSION ACTIVE,那麼在這裡使用下面命令
SQL> alter database commit to switchover to physical standby WITH SESSION SHUTDOWN;
3.關閉資料庫重啟到 mount
SQL> shutdown immediate; ORA-01012: not logged on 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@oraclerac2 ~]$ sqlplus "/ as sysdba" SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 1 17:45:33 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount; ORACLE instance started. Total System Global Area 2.1379E+10 bytes Fixed Size 2262656 bytes Variable Size 2885683584 bytes Database Buffers 1.8455E+10 bytes Redo Buffers 36073472 bytes Database mounted.
4.用 Read Only 模式開啟
SQL> alter database open read only; Database altered.
5.啟動 Redo 應用模式
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION; Database altered.
6.切換後檢視角色
SQL> select database_role,switchover_status from v$database; DATABASE_ROLE SWITCHOVER_STATUS -------------------------------- ---------------------------------------- PHYSICAL STANDBY TO PRIMARY
7.以上操作都是原來的主庫完成的,下面的操作在原來的備庫完成
8.檢視 Standby Database 是否滿足切換條件
SQL> select database_role,switchover_status from v$database; DATABASE_ROLE SWITCHOVER_STATUS -------------------------------- ---------------------------------------- PHYSICAL STANDBY TO PRIMARY
9.執行下面命令進行切換
SQL> alter database commit to switchover to primary; Database altered.
10.開啟資料庫
SQL> alter database open; Database altered.
11.切換後檢視角色
SQL> select database_role,switchover_status from v$database; DATABASE_ROLE SWITCHOVER_STATUS -------------------------------- ---------------------------------------- PRIMARY TO STANDBY
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20893244/viewspace-2168909/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle DataGuard 主備切換 (switchover) oracle11gOracle
- DATAGUARD強行切換
- DATAGUARD失敗切換
- Oracle 11.2.0.4 physical dataguard和snapshot dataguard切換Oracle
- 【DATAGUARD】Oracle Dataguard物理備庫切換最佳實踐(sqlplus)OracleSQL
- 基於單機的DataGuard切換文件
- 基於多種場景DataGuard切換方案
- DataGuard---->物理StandBy的角色切換之switchover
- ORACLE 12C DATAGUARD環境搭建和主從切換Oracle
- 物理DataGuard客戶端無縫切換--客戶端TAF 配置客戶端
- 【ARCH】留存,Oracle11g之前Dataguard環境刪除歸檔指令碼Oracle指令碼
- 程式切換(上下文切換)
- 【DG】Oracle11g異構平臺之Linux To Windows DataGuard安裝配置--duplicateOracleLinuxWindows
- 棧切換
- 切換java版本Java
- 切換UNDO(zt)
- 切換 PHP 版本PHP
- ubuntu切換源Ubuntu
- Git分支切換Git
- jdk 多版本切換JDK
- 多螢幕切換
- centos 切換 jdk 版本CentOSJDK
- linux zsh 切換 bashLinux
- Mac切換Python版本MacPython
- GCC 多版本切換GC
- Redis主從切換Redis
- lnmp 切換PHP版本LNMPPHP
- iOS 切換鍵盤iOS
- uniapp 滑動切換APP
- DG的切換操作
- cd 切換目錄
- valet 切換 PHP 版本PHP
- cd:切換目錄
- IP地址切換工具
- jq切換皮膚
- (九)主題切換
- 【DATAGUARD】Oracle Dataguard nologging 塊修復Oracle
- 【Dataguard】DataGuard運維注意事項運維