oracle11g在沒DNS情況下failover的配置方法
1.Oracle 11g引入scan ip ,可在沒有DNS的情況下,客戶端連線RAC配置failover時,很多情況還是使用oracle10g方式。即在客戶端tnsname.ora中配置failover:
1)當客戶端配置如下時,連線的例項關閉後,會話必須重新連才可連線到其他活動的例項上,不會自動重連:
ora112 =
(DESCRIPTION =
(ADDRESS_LIST =
(LOAD_BALANCE = yes)
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.113)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.114)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora112)
(FAILOVER = on)
)
)
或
ora112 =
(DESCRIPTION =
(ADDRESS_LIST =
(LOAD_BALANCE = yes)
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.113)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.114)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora112)
(FAILOVER = on)
(TYPE = select)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)
)
)
或(115為scan-ip)
ORA112 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.115)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora112)
(FAILOVER = on)
)
)
或
ORA112 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.115)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora112)
(FAILOVER = on)
(failover_mode=(TYPE=SELECT)
(METHOD=BASIC)
(RETRIES=1)
(DELAY=0)
)
)
)
或
ORA112 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.115)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora112)
)
)
2)當客戶端配置如下時,連線的例項關閉後,會話會自動連線到其他活動的例項上:
ora112 =
(DESCRIPTION =
(ADDRESS_LIST =
(LOAD_BALANCE = yes)
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.113)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.114)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora112)
(FAILOVER = on)
FAILOVER_MODE=(TYPE = select)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)
)
)
)
2.如果不採用oracle10g的方法,能不能只在客戶端配置scan ip,而在伺服器端配置以實現failover,具體如下:
(How To Configure Server Side Transparent Application Failover [ID 460982.1])
1)建立TAFService
[oracle@db1 bin]$ ./srvctl add service -d ora112 -s ora112_rac -r "ora1121,ora1122" -P BASIC
--這裡的ora112是database name,ora1121和ora1122 是instance name。
2)啟動s_test服務
[oracle@db1 bin]$ ./srvctl start service -d ora112 -s s_test
3)檢查service執行情況
[oracle@db1 bin]$ ./srvctl config service -d ora112
Service name: s_test
Service is enabled
Server pool: ora112_s_test
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: ora1121,ora1122
Available instances:
4)確認serviceID
SQL> select name,service_id from dba_services where name = 's_test';
NAME SERVICE_ID
--------------------------------------------------------------------------
s_test 3
5)為service新增引數
SQL> execute dbms_service.modify_service (service_name => 's_test' -
, aq_ha_notifications => true -
, failover_method => dbms_service.failover_method_basic -
, failover_type => dbms_service.failover_type_select -
, failover_retries => 180 -
, failover_delay => 5 -
, clb_goal => dbms_service.clb_goal_long);
6)確認引數新增情況
col name format a15
col failover_method format a11 heading 'METHOD'
col failover_type format a10 heading 'TYPE'
col failover_retries format 9999999 heading 'RETRIES'
col goal format a10
col clb_goal format a8
col AQ_HA_NOTIFICATIONS format a5 heading 'AQNOT'
SQL> select name, failover_method,failover_type, failover_retries,goal, clb_goal,aq_ha_notifications from dba_services where service_id = 3;
NAME METHOD TYPE RETRIES GOAL CLB_GOAL AQNOT
--------------- ----------- ------------------ ---------- -------- -----
s_test BASIC SELECT 180 NONE LONG YES
SQL>
7)檢查service註冊情況
[oracle@db1 bin]$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.3.0 -Production on 15-JUL-2012 13:26:43
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db1)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for thisservice...
Handler(s):
"DEDICATED" established:57 refused:0 state:ready
LOCAL SERVER
Service "ora112" has 1 instance(s).
Instance "ora1121", status READY, has 1 handler(s) for thisservice...
Handler(s):
"DEDICATED" established:11 refused:0 state:ready
LOCAL SERVER
Service "ora112XDB" has 1instance(s).
Instance "ora1121", status READY, has 1 handler(s) for thisservice...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=db1.tianlesoftware.com)(PORT=38731))
Service "s_test" has 1instance(s).
Instance "ora1121", status READY, has 1 handler(s) for thisservice...
Handler(s):
"DEDICATED" established:11 refused:0 state:ready
LOCAL SERVER
The command completed successfully
8)配置tnsnames.ora,連線後,關閉連線例項後,會話會自動切換到其他活動例項上(115為scan ip):
ORA112 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.87.115)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = s_test)
)
)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8484829/viewspace-2120688/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- JPA EntityManager 在沒有實體類的情況下返回Map
- 開始使用 Org 模式吧,在沒有 Emacs 的情況下模式Mac
- 不應該在沒有 sudo 的情況下執行 Docker 的原因Docker
- 在沒有curl和wget情況下傳送HTTP請求wgetHTTP
- 微服務上 AWS 雲, 在使用ALB 的情況下, Eurek 中如何配置微服務
- 四種AD安裝的情況以及配置方法
- Windows 98 在沒有註冊的情況下對系統進行更新(轉)Windows
- 沒有備份的情況下處理undo損壞
- 誤刪資料檔案在沒有歸檔的情況下恢復實驗
- 如何在沒有前端框架的情況下實現元件化前端框架元件化
- 測試在cursor_sharing為force情況下執行計劃的共享情況
- Nature回應:為什麼在沒有程式碼的情況下發布AlphaFold3?
- 在什麼情況下用index unique scansIndex
- 4.3.4.1 在不使用Oracle OMF的情況下建立CDBOracle
- 資料庫在沒有備份的情況下的資料檔案損壞的恢復資料庫
- SQL Server大分割槽表沒有空分割槽的情況下如何擴充套件分割槽的方法SQLServer套件
- CENTOS下配置DNSCentOSDNS
- 在什麼情況下Java比C++快?JavaC++
- 在不影響程式使用的情況下新增shellcode
- 在不安裝oracle客戶端的情況下,使用PLSQLOracle客戶端SQL
- 在大資料情況下MySQL的一種簡單分頁最佳化方法大資料MySql
- 沒有備份的情況下如何處理logical & physical corrupt blockBloC
- body在預設情況下是具有margin外邊距的
- 在什麼情況下,Java比C++慢很多?JavaC++
- Python核對遙感影像批次下載情況的方法Python
- 在沒有開啟審計的情況下定位Oracle錯誤的登入Oracle
- Invoca:85%的客戶互動在沒有人工的情況下得到處理
- 在沒有本地安裝的情況下在 Postman 上測試您的端點Postman
- 在沒有上傳伺服器端的情況下看到上傳圖片的效果圖window.createObjectURL伺服器Object
- docker容器無法啟動的情況下,如果修改配置檔案Docker
- 如何這沒有顯示器的情況下獲取樹莓派IP?樹莓派
- 沒有介面文件的情況下如何開展介面自動化測試?
- 在靜態庫下使用MFC和共享DLL下使用MFC 這兩種情況 opencv的配置,以及配置opencv配置中容易出現的問題OpenCV
- PG監控或判斷邏輯備份是否正常的方法,在pg_dump沒有引數記錄日誌資訊的情況下
- 在不需要知道密碼的情況下 Hacking MSSQL密碼SQL
- charles 在只支援 tls1.3 的 nginx 情況下如何抓包?TLSNginx
- iPhone 在使用 Charles 抓包情況下無法開啟 APPstore 解決方法iPhoneAPP
- 在不重灌Windows情況Ç(轉)Windows