監聽狀態對dataguard及其日誌傳輸的影響
在DG容災的體系中,監聽作為主備庫的通訊通道,至關重要。這裡我們嘗試一下,把監聽切斷,會導致什麼後果呢?
----檢視主備庫的監聽狀態:
---主庫監聽狀態:
[oracle@host01 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 12-MAR-2017 15:14:59
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host01)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@host01 ~]$
---備庫監聽狀態:
[oracle@oracle ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 12-MAR-2017 15:15:05
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@oracle ~]$
----檢視主備庫的切換狀態:
---主庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM PERFORMANCE FAILED DESTINATION PRIMARY
---備庫:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY MAXIMUM PERFORMANCE NOT ALLOWED PHYSICAL STANDBY
----檢視主備庫當前最大日誌號:
---主庫最大日誌號:
SQL> select max(sequence#), to_char(max(first_time),'yyyy-mm-dd hh24:mi:ss') from v$log_history where thread#=1
2 and RESETLOGS_TIME = (select max(a.RESETLOGS_TIME) from v$log_history a);
MAX(SEQUENCE#) TO_CHAR(MAX(FIRST_T
-------------- -------------------
154 2017-03-12 15:11:35
---備庫最大日誌號:
SQL> select max(sequence#), to_char(max(first_time),'yyyy-mm-dd hh24:mi:ss') from v$log_history where thread#=1
2 and RESETLOGS_TIME = (select max(a.RESETLOGS_TIME) from v$log_history a);
MAX(SEQUENCE#) TO_CHAR(MAX(FIRST_T
-------------- -------------------
152 2017-03-12 12:45:17
----啟動主備庫的監聽:
--主庫監聽啟動:
[oracle@host01 ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 12-MAR-2017 15:27:05
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/host01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host01)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host01)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 12-MAR-2017 15:27:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/host01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host01)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ORA11GR2" has 1 instance(s).
Instance "ORA11GR2", status UNKNOWN, has 1 handler(s) for this service...
Service "SBDB" has 1 instance(s).
Instance "SBDB", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@host01 ~]$
--主庫註冊監聽:
SQL> alter system register;
System altered.
--備庫監聽啟動:
[oracle@oracle ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 12-MAR-2017 15:27:24
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 12-MAR-2017 15:27:26
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ENMO.oracle.com" has 1 instance(s).
Instance "ENMO", status UNKNOWN, has 1 handler(s) for this service...
Service "ORA11GR2" has 1 instance(s).
Instance "ORA11GR2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracle ~]$
--備庫註冊監聽:
SQL> alter system register;
System altered.
----再次檢視主庫的切換狀態:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ WRITE MAXIMUM PERFORMANCE TO STANDBY PRIMARY
---再次檢視備庫的切換狀態:
SQL> select open_mode,protection_mode,switchover_status,database_role from v$database;
OPEN_MODE PROTECTION_MODE SWITCHOVER_STATUS DATABASE_ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY MAXIMUM PERFORMANCE NOT ALLOWED PHYSICAL STANDBY
#當監聽開啟後,主備庫就相互接通,並確定主備庫的關係以及切換狀態。
----備庫引用主庫傳輸的歸檔日誌:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
---主庫切換一個日誌:
SQL> alter system switch logfile;
System altered.
---再次檢視主庫的最大日誌號:
SQL> select max(sequence#), to_char(max(first_time),'yyyy-mm-dd hh24:mi:ss') from v$log_history where thread#=1
2 and RESETLOGS_TIME = (select max(a.RESETLOGS_TIME) from v$log_history a);
MAX(SEQUENCE#) TO_CHAR(MAX(FIRST_T
-------------- -------------------
156 2017-03-12 15:27:37
---再次檢視備庫的最大日誌號:
SQL> select max(sequence#), to_char(max(first_time),'yyyy-mm-dd hh24:mi:ss') from v$log_history where thread#=1
2 and RESETLOGS_TIME = (select max(a.RESETLOGS_TIME) from v$log_history a);
MAX(SEQUENCE#) TO_CHAR(MAX(FIRST_T
-------------- -------------------
156 2017-03-12 15:27:37
#主備庫的最大日誌號相同。
--我們從上面的測試可以看到:當監聽不相通的時候,dataguard容災體系中的主備庫角色沒有影響(已經搭建好DG的情況下),
主庫備庫依然保持該有的角色,但是,主備庫之間,在網路不相通的情況下,不允許主備角色的切換,主庫是 FAILED DESTINATION
的切換狀態,備庫依然是NOT ALLOWED的切換狀態,主要還是受到監聽不相通,主備庫之間的日誌傳輸受阻,從而不允許切換。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2135193/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle10g DataGuard的日誌傳輸方式Oracle
- 關於11G DataGuard 日誌傳輸的案例
- 【Dataguard】Oracle多租戶環境對Dataguard的影響Oracle
- 手工rm刪除歸檔日誌對備份歸檔日誌的影響
- IHS Markit:冠狀病毒對影片監控市場的影響
- Linux中如何檢視日誌命令中的響應狀態?Linux
- 監聽MySQL的binlog日誌工具分析:CanalMySql
- 資料線線損和長度對資料傳輸和網路傳輸的影響
- oracle rac的scan監聽狀態Not All Endpoints RegisteredOracle
- 動態監聽輸入框值的變化
- 新增橋接連線狀態監控、重構日誌系統橋接
- Linux伺服器日誌過大有什麼影響?如何應對?Linux伺服器
- oracle DG 日誌傳輸小結Oracle
- PCMA:冠狀病毒對事件營銷的影響事件
- Advertiser Perceptions:冠狀病毒對廣告的影響
- SQL Server中事務日誌自動增長對效能的影響(下)PGSQLServer
- SQL Server中事務日誌自動增長對效能的影響(上)OSSQLServer
- 【JS】在連續性監聽事件中,監聽當前狀態是否變化JS事件
- 對人工智慧的應用、發展及其影響的思考人工智慧
- 使用Swoole的Websocket監聽使用者連線狀態Web
- DATAGUARD中手工處理日誌GAP
- 【TUNE_ORACLE】Oracle檢查點(四)檢查點對redo日誌的影響和redo日誌大小設定建議Oracle
- sqlserver關於日誌傳輸log shipping的總結SQLServer
- Kubernetes 日誌傳輸中的四大挑戰
- 7 Redo Transport Services 日誌傳輸服務
- 《斯普拉遁3》多人對戰玩法及其對關卡設計的影響
- 點對點傳輸現狀,鐳速高速點對點傳輸解決方案
- listener_scan1.log、listener.log監聽日誌清理
- 檔案傳輸中斷怎麼辦?對檔案會有什麼影響?
- RF傳輸距離是如何影響無線通訊的?
- “視聽作品”引入對網遊產業影響幾何?產業
- 骨傳導耳機不會影響聽力,是真的咩?
- oracle靜態監聽Oracle
- oracle 資料庫lsnrctl監聽的日誌路徑和trace檔案Oracle資料庫
- NewsCred:冠狀病毒對營銷團隊的影響調查
- MySQL中join語句的基本使用教程及其欄位對效能的影響MySql
- Android開發之監聽軟鍵盤狀態(彈出收回)Android
- 度量BGP監測源數量對AS可見性的影響
- [20181112]11g 日誌傳輸壓縮模式.txt模式