自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle 12c R2中的ADG會話保留特性

數(shù)據(jù)庫 Oracle
Oracle 12c R2中有一個不錯的特性,那就是Active Data Guard會話保留,原本的叫法是Preserving Active Data Guard Application Connections

[[196974]]

Oracle 12c R2中有一個不錯的特性,那就是Active Data Guard會話保留,原本的叫法是Preserving Active Data Guard Application Connections

怎么理解呢,比如在Active Data Guard上的連接會話,在switchover的過程中會話連接會始終保持不會中斷。這一點聽起來就很有特點,能夠提高用戶體驗度,而且是一種相對透明的方式。

到底怎么樣呢,我們來簡單測試一下,先看看默認情況下的ADG會話情況,切換的過程就直接使用DG Broker來做了,快。

這是一個12cR2的環(huán)境,也使用了Far Sync。

  1. DGMGRL>show  configuration 
  2.  Configuration - dg_test12cs 
  3.   Protection Mode: MaxPerformance 
  4.   Members: 
  5.   test12cs  - Primary database 
  6.     test_sync - Far sync instance  
  7.     test12css - Physical standby database  
  8.  Fast-Start Failover: DISABLED 
  9.  Configuration Status: 

SUCCESS (status updated 10 seconds ago)我們連接到備庫,備庫現(xiàn)在是ADG模式。

  1. SQL> select open_mode from v$database
  2.  OPEN_MODE 
  3.  ---------------------------------------- 

READ ONLY WITH APPLY如果這個時候我們就使用一條語句在備庫端查詢,使用TNS連接,然后DG Broker來切換,切換的情況如下,也是一氣呵成。

  1. DGMGRL> switchover to test12css 
  2.  Performing switchover NOW, please wait... 
  3.  Operation requires a connection to database "test12css" 
  4.  Connecting ... 
  5.  Connected to "test12css" 
  6.  Connected as SYSDBA. 
  7.  New primary database "test12css" is opening... 
  8.  Operation requires start up of instance "test12cs" on database "test12cs" 
  9.  Starting instance "test12cs"... 
  10.  for RDBMS instance 
  11.  ORACLE instance started. 
  12.  Database mounted. 
  13.  Database opened. 
  14.  Connected to "test12cs" 
  15.  Switchover succeeded, new primary is "test12css" 
  16.  DGMGRL>  

在客戶端反復(fù)測試連接的情況如下:

  1. SQL> select count(*) from cat; 
  2.   COUNT(*) 
  3.  ---------- 
  4.         153 
  5.  SQL> / 
  6.   COUNT(*) 
  7.  ---------- 
  8.         153 
  9.  SQL> / 
  10.  select count(*) from cat 
  11.  * 
  12.  ERROR at line 1: 
  13.  ORA-03113: end-of-file on communication channel 
  14.  Process ID: 94489 
  15.  Session ID: 419 Serial number: 62932 

可以看到在切換的過程中,連接被中斷了,而接下來就會徹底斷開連接。

  1. SQL> / 
  2.  ERROR: 
  3.  ORA-03114: not connected to ORACLE 

這里就需要說一下這個特性的情況,其實還涉及到一個參數(shù)standby_db_preserve_states,默認是NONE

  1. SQL> show parameter standby_db_preserve_states 
  2.  NAME                                TYPE                  VALUE 
  3.  ------------------------------------ ---------------------- ------ 
  4.  standby_db_preserve_states          string                NONE 

我們設(shè)置為ALL,這個修改需要重啟備庫,我們設(shè)置好之后,再來做switchover

步驟和上面的類似,我們直接來看看效果,始終在這一個會話內(nèi)查看數(shù)據(jù)查詢的情況,整個過程相對平滑,在切換過程中會有一個大約兩秒的停頓,但是連接始終是保持的。

  1. COUNT(*) 
  2. ---------- 
  3.        153 
  4. SQL> / 
  5.  COUNT(*) 
  6. ---------- 
  7.        153 
  8. SQL> / 
  9.  COUNT(*) 
  10. ---------- 
  11.        153       
  12. SQL> / 
  13.  
  14.  COUNT(*) 
  15. ---------- 
  16.        153 
  17. SQL> / 
  18.  COUNT(*) 
  19. ---------- 
  20.        153 

整體來看這個特性確實達到了預(yù)期的效果,還是蠻不錯的。

責(zé)任編輯:武曉燕 來源: Linux社區(qū)
相關(guān)推薦

2016-09-21 20:08:12

oracle數(shù)據(jù)庫甲骨文

2023-10-11 08:59:05

2013-06-28 14:38:02

2010-01-13 16:08:09

Oracle 11g 數(shù)據(jù)衛(wèi)士

2016-09-05 13:32:29

甲骨文數(shù)據(jù)庫Oracle

2009-09-02 15:35:57

Oracle 11g

2014-08-26 10:03:45

Oracle 12c新

2015-10-21 13:54:00

Oracle 12c標(biāo) Oracle許可政策

2016-10-19 09:36:04

Oracle12c R分片分布式

2010-04-30 13:35:28

Oracle 11g

2010-03-31 10:52:09

Oracle11g r

2014-05-08 10:00:04

Windows SerWSUS

2016-07-21 09:33:23

甲骨文

2015-10-21 14:01:44

Oracle許可 Oracle 12c

2016-10-08 14:43:30

Oracle 12c 云計算Oracle云

2009-03-05 11:02:12

NTP列式壓縮云計算

2010-01-25 10:11:32

Oracle 11g

2013-06-07 10:49:57

微軟Windows Ser特性

2013-06-28 14:30:09

Oracle 12c

2010-01-19 10:17:41

Oracle 11g
點贊
收藏

51CTO技術(shù)棧公眾號