Oracle TAF(Transparent Application Failover)和 FCF(Fast Connection Failover)
1.Oracle TAF(Transparent Application Failover))
1.Oracle TAF(Transparent Application Failover))
TAF是一個早期Oracle 10g RAC裡面的名詞, 用意是為了能夠讓client在RAC的單一節點查詢的時候如果遭遇instance down,可以自動接續並查詢剩餘的節點,且該查詢連線是不會中斷的,支援語法為JDBC OCI driver (不支援JDBC thin driver)
SQL裡面僅支援select...from... , 可以支援pre-connection failover快速連線
---------------------------------------------------------
---------------------------------------------------------
--以下為tnsnames.ora範例(也適用於Oracle DataGuard環境) :
TAFTEST=
(DESCRIPTION=
(LOAD_BALANCE=ON)
(FAILOVER=ON)
(ADDRESS=
(PROTOCOL=tcp)(HOST=orcl)(PORT=1521))
(ADDRESS=
(PROTOCOL=tcp)(HOST=orclstdby)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=orcl)
(FAILOVER_MODE=
(TYPE=select)
(METHOD=basic)
)
)
)
2.Oracle FCF (Fast Connection Failover)
在Oracle 10g版本以後,Oracle RAC Clusterware有一個新的ONS服務(Oracle Notification Service),在Oracle服務異常的時候能夠
更快速且即時的通知AP進行切換,支援OCI/ODP.NET(Oracle Data Provider for .NET)、jdbc thin driver:
2.1 配置ONS(JDBC) : Configure a remote Oracle Notification Services (ONS) subscription on the JDBC clien
#default ONS port is 6200
#default ONS port is 6200
ods.setONSConfiguration("nodes=racnode1.example.com:4200,racnode2.example.com:4200");
2.2 啟動應用程式時,指定系统屬性
-Doracle.ons.oraclehome=<location-of-ORACLE_HOME>
2.3 啟用FCF
// declare datasource
ods.setUrl(
"jdbc:oracle:oci:@(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=cluster_alias)
(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service_name)))");
ods.setUser("scott");
ods.setConnectionCachingEnabled(true); //啟用 JDBC 隐式连接缓存和快速連接故障切換
ods.setFastConnectionFailoverEnabled(true): // 啟用快速連接故障切換
ctx.bind("myDS",ods);
ds=(OracleDataSource) ctx.lookup("MyDS");
try {
ds.getConnection(); // transparently creates and accesses cache
catch (SQLException SE {
}
}
參考連結:
http://www.oracle.com/technetwork/cn/articles/database-performance/oracle-rac-connection-mgmt-1650424-zhs.html
https://docs.oracle.com/cd/B28359_01/rac.111/b28252/configwlm.htm#TDPRC067
http://www.oracle.com/technetwork/database/application-development/12c-ha-concepts-2408080.pdf
https://goo.gl/eGe4i1
http://wallimn.iteye.com/blog/1345102
https://jaychu649.blogspot.tw/2011/12/tnsnamesora.html
https://jaychu649.blogspot.tw/2011/12/oracle-9i-10g-11g-load-balance.html
沒有留言:
張貼留言