Oracle DG主備啟動和關閉流程
環境:
Oracle 11g RAC和DG
關閉操作流程:
RAC節點:
關閉primary主機:
SQL>shutdown immediate
無法shutdown immediate
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup restrict;
ORACLE instance started.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
關閉standby主機:
SQL>alter database recover managed standby database cancel;
SQL>shutdown immediate
開啟操作流程:
開啟standby主機:
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1.7103E+10 bytes
Fixed Size 2245480 bytes
Variable Size 2181041304 bytes
Database Buffers 1.4898E+10 bytes
Redo Buffers 21708800 bytes
Database mounted.
SQL> select RECOVERY_MODE from v$archive_dest_status where rownum<5;
RECOVERY_MODE
-----------------------
IDLE
IDLE
IDLE
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
開啟primary主機:
primary主機是RAC,會自動拉起來。
primary主機RAC一切正常。
發現standby主機監聽不正常:
重啟監聽。
[oracle@dg ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 11-DEC-2017 15:12:16
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@dg ~]$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 11-DEC-2017 15:12:37
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@dg ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 11-DEC-2017 15:12:44
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/dg/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dg)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 11-DEC-2017 15:12:45
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/dg/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dg)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@dg ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 11-DEC-2017 15:13:29
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 11-DEC-2017 15:12:45
Uptime 0 days 0 hr. 0 min. 44 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/dg/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dg)(PORT=1521)))
Services Summary...
Service "DG" has 1 instance(s).
Instance "DG", status READY, has 1 handler(s) for this service...
The command completed successfully
開啟standby主機的只讀功能:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL> alter database open read only;
Database altered.
SQL> select RECOVERY_MODE from v$archive_dest_status where rownum<5;
RECOVERY_MODE
-----------------------
IDLE
IDLE
IDLE
IDLE
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
SQL> select RECOVERY_MODE from v$archive_dest_status where rownum<5;
RECOVERY_MODE
-----------------------
MANAGED REAL TIME APPLY
IDLE
IDLE
IDLE
主備的alert日誌正常:
RAC01 alert日誌:
Thread 1 advanced to log sequence 35614 (LGWR switch)
Current log# 2 seq# 35614 mem# 0: +DATA/prd/onlinelog/group_2.257.929893623
Mon Dec 11 15:50:16 2017
LNS: Standby redo logfile selected for thread 1 sequence 35614 for destination LOG_ARCHIVE_DEST_2
Mon Dec 11 15:50:16 2017
Archived Log entry 94045 added for thread 1 sequence 35613 ID 0x35485ff1 dest 1:
RAC02 alert日誌:
Thread 2 advanced to log sequence 18461 (LGWR switch)
Current log# 3 seq# 18461 mem# 0: +DATA/prd/onlinelog/group_3.261.929893729
Mon Dec 11 15:32:10 2017
LNS: Standby redo logfile selected for thread 2 sequence 18461 for destination LOG_ARCHIVE_DEST_2
Mon Dec 11 15:32:11 2017
Archived Log entry 94043 added for thread 2 sequence 18460 ID 0x35485ff1 dest 1:
DG alert日誌:
Media Recovery Waiting for thread 2 sequence 18461 (in transit)
Recovery of Online Redo Log: Thread 2 Group 8 Seq 18461 Reading mem 0
Mem# 0: /oracle/oradata/standby08.log
Mon Dec 11 15:50:16 2017
RFS[4]: Selected log 6 for thread 1 sequence 35614 dbid 893924085 branch 929893623
Mon Dec 11 15:50:16 2017
Media Recovery Waiting for thread 1 sequence 35614 (in transit)
Recovery of Online Redo Log: Thread 1 Group 6 Seq 35614 Reading mem 0
Mem# 0: /oracle/oradata/standby06.log
Mon Dec 11 15:51:44 2017
Archived Log entry 40467 added for thread 1 sequence 35613 ID 0x35485ff1 dest 1:
如果透過重啟監聽無法解決DG節點的監聽問題,可以透過動態註冊監聽來解決
alter system register
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22996654/viewspace-2148550/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle DG主備啟動關閉順序Oracle
- oracle自動啟動和關閉的方法Oracle
- Oracle例項的啟動和關閉Oracle
- oracle啟動與關閉Oracle
- ORACLE DataGuard 關閉啟動Oracle
- Oracle自動啟動和關閉的方法 (轉)Oracle
- Oracle DG異構主備支援Oracle
- 啟動/關閉與冷備份Oracle資料庫Oracle資料庫
- 2 Day DBA-管理Oracle例項-關閉和啟動Oracle例項-使用OEMDC關閉和啟動Oracle例項Oracle
- oracle 例項啟動和關閉解讀Oracle
- oracle啟動和關閉指令碼for LinuxOracle指令碼Linux
- Oracle資料庫的啟動和關閉Oracle資料庫
- ORACLE RAC 的啟動和關閉順序Oracle
- ORACLE啟動模式及關閉Oracle模式
- Oracle RAC 啟動與關閉Oracle
- ORACLE資料庫的啟動和關閉(轉)Oracle資料庫
- MRP 程式開啟和關閉實時應用 Oracle11g DGOracle
- mysql的啟動和關閉MySql
- 2 Day DBA-管理Oracle例項-關於例項的啟動和關閉-管理啟動和關閉許可權Oracle
- Oracle 11gR2 RAC的關閉和啟動Oracle
- Linux 下 Oracle隨系統自動啟動和關閉LinuxOracle
- Oracle監聽啟動後自動關閉Oracle
- linux svn啟動和關閉Linux
- MySQL Windows下關閉和啟動MySqlWindows
- 資料庫啟動和關閉資料庫
- 【DG】Oracle之級聯DG--(cascade dg) --(一主一備一級聯)Oracle
- ORACLE資料庫的啟動和關閉之二(轉)Oracle資料庫
- Oracle資料庫的幾種啟動和關閉方式Oracle資料庫
- 深刻理解Oracle資料庫的啟動和關閉Oracle資料庫
- 深刻理解 oracle 資料庫的啟動和關閉Oracle資料庫
- oracle 啟動 關閉步驟詳解Oracle
- 批處理開啟和關閉OracleOracle
- oracle資料庫不同啟動命令和關閉命令全面解析Oracle資料庫
- 深刻理解Oracle資料庫的啟動和關閉(轉)Oracle資料庫
- MySQL啟動和關閉命令總結MySql
- ASM CRS 例項啟動和關閉ASM
- AIX上關閉和啟動X serverAIServer
- rhel as3下自動啟動和關閉oracle的指令碼S3Oracle指令碼