Timesten學習3(高可用性)
1 高可用性
配置高可用性的TT,同時實現cache以及和後臺oracle rac叢集這種模式應該是最有價值的,兩臺TT同時對外提供服務,TT直接透過複製實現資料同步, 同時每個TT都透過cache agent把變化的資料傳遞到後臺的ORACLE,這種架構應該是我們最關心的,也是最有用的。
現在配置環境
192.168.100.105
server1
192.168.100.106
server2
192.168.10.105 server1-priv
192.168.10.106 server2-priv
192.168.100.215
server1-vip
192.168.100.216
server2-vip
在server1,server2安裝timesten軟體,軟體目錄安裝在/timesten/Timesten下,data store放在DataStore=/timesten/Timesten/peyton/rac,檔案以rac開頭,DSN=rac_tt70
資料庫為一RAC,分別裝在server1和server2,SID分別為orcl1和orcl2
1.1 在oracle上面建立需要同步的表
create user tt identified
by tt default tablespace users;
SQL> create
user tt identified by tt default tablespace users;
SQL> grant
connect,resource to tt;
SQL> grant
select any dictionary to tt;
SQL> connect
tt/tt@orcl1
SQL> create
table t1(id number(2) primary key);
1.2 配置tnsnames.ora
1.2.1 節點一server1
ORCL1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.100.215)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORCL1)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.100.216)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORCL2)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
server1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =
server2-vip)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
LISTENER_SERVER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
server1-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.100.105)(PORT = 1521)(IP = FIRST))
)
)
LISTENERS_ORCL =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
server1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =
server2-vip)(PORT = 1521))
)
1.2.2 節點二server2
ORCL1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.100.215)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORCL1)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.100.216)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORCL2)
)
)
ORCL=
(DESCRIPTION=
(LOAD_BALANCE=OFF)
(FAILOVER=ON)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=server2-vip)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=server1-vip)(PORT=1521))
)
(CONNECT_DATA=
(SERVICE_NAME=ORCL)
(SERVER=DEDICATED)
(FAILOVER_MODE=
(TYPE=SELECT)
(METHOD=BASIC)
(RETRIES=180)
(DELAY=5)
)
)
)
LISTENER_SERVER2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
server2-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.100.106)(PORT = 1521)(IP = FIRST))
)
)
LISTENERS_ORCL =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
server1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =
server2-vip)(PORT = 1521))
)
1.3 配置rac_tt70
[rac_tt70]
Driver=/timesten/TimesTen/tt70/lib/libtten.so
DataStore=/timesten/Timesten/peyton/rac
DatabaseCharacterSet=ZHS16GBK
ConnectionCharacterSet=ZHS16GBK
Authenticate=0
PermSize=64
TempSize=16
UID=tt
OracleId=orcl
OraclePwd=tt
1.4 配置cache group
在兩個節點上建立oracle的cache
[tt@server1 bin]$
ttIsql rac_tt70
Copyright (c)
1996-2008, Oracle. All rights reserved.
Type ? or
"help" for help, type "exit" to quit ttIsql.
All commands must
end with a semicolon character.
connect
"DSN=rac_tt70";
Connection
successful:
DSN=rac_tt70;UID=tt;DataStore=/timesten/Timesten/peyton/rac;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=ZHS16GBK;DRIVER=/timesten/TimesTen/tt70/lib/libtten.so;OracleId=orcl1;Authenticate=0;PermSize=64;TempSize=16;TypeMode=0;
(Default setting
AutoCommit=1)
Command> call
ttCacheUidPwdSet('tt','tt');
Command> call
ttCacheStart;
Command>
CREATE USERMANAGED
CACHE GROUP update_anywhere_t1
AUTOREFRESH State off MODE INCREMENTAL INTERVAL 5 SECONDS FROM t1(id number(2) primary key,PROPAGATE);
You can
enable and disable AUTOREFRESH by setting its STATE to either ON or OFF through
a CREATE CACHE GROUP or an ALTER CACHE GROUP statement. (ON is the default.)
AUTOREFRESH
is scheduled by TimesTen when the transaction that sets its STATE to ON is committed
When the STATE is set to OFF, changes to the Oracle tables are not captured or recorded.
You can also use the ALTER CACHE GROUP statement to set the STATE to PAUSED.
When the cache group is PAUSED, changes to the Oracle tables are captured and
recorded on Oracle, but are not applied to the tables in the TimesTen cache
group
[tt@server2
bin]$ ttIsql rac_tt70
connect
"DSN=rac_tt70";
Connection
successful: DSN=rac_tt70;UID=tt;DataStore=/timesten/Timesten/peyton/rac;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=ZHS16GBK;DRIVER=/timesten/TimesTen/tt70/lib/libtten.so;OracleId=orcl1;Authenticate=0;PermSize=64;TempSize=16;TypeMode=0;
(Default
setting AutoCommit=1)
Command>
call ttCacheUidPwdSet('tt','tt');
Command>
call ttCacheStart;
Command>
CREATE
USERMANAGED CACHE GROUP update_anywhere_t1
AUTOREFRESH State off MODE INCREMENTAL
INTERVAL 5 SECONDS
FROM
t1(id number(2) primary key,PROPAGATE);
1.5 建立複製
在兩個節點上分別執行
Command> CREATE REPLICATION reptest
ELEMENT e_1 TABLE t1 MASTER rac on "server1" SUBSCRIBER rac on "server2"
ELEMENT e_2 TABLE t1 MASTER rac on "server2" SUBSCRIBER rac on "server1"
1.6 啟動replication agent
[tt@server1 ~]$ ttAdmin -repStart rac_tt70
RAM Residence Policy : inUse
Replication Agent Policy : manual
Replication Manually Started : True
Cache Agent Policy : manual
Cache Agent Manually Started : True
[tt@server2 ~]$ ttAdmin -repStart rac_tt70
RAM Residence Policy : inUse
Replication Agent Policy : manual
Replication Manually Started : True
Cache Agent Policy : manual
Cache Agent Manually Started : True
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/48010/viewspace-1017607/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 轉~timesten系列六:定義複製,實現timesten的高可用性
- Timesten學習1
- Timesten學習2
- TimesTen學習(三)遠端連線TimesTen資料庫資料庫
- TimesTen學習(四)Data Manager守護程式
- 轉~timesten系列七:配置高可用性的TT,同時實現和cache和後臺oracle整合Oracle
- 5、pgpool-II高可用性(一)資料庫的高可用性資料庫
- vue3 學習筆記 (四)——vue3 setup() 高階用法Vue筆記
- 理解HDFS高可用性架構架構
- TimesTen學習(二)連線建立第一個資料庫資料庫
- WebSphere 反向投資者: 高可用性(重申)與持續可用性Web
- 學習3
- 資料庫高可用性簡史資料庫
- 選擇高可用性解決方案
- MMM實現mysql高可用性薦MySql
- Unity3D學習筆記4——建立Mesh高階介面Unity3D筆記
- 《JavaScript高階程式設計第3版》-學習筆記-1JavaScript程式設計筆記
- redis學習——高階功能Redis
- HBase可用性分析與高可用實踐
- SQL Server中的高可用性概覽SQLServer
- MySQL資料庫的高可用性分析MySql資料庫
- GitHub 的 MySQL 高可用性實踐分享GithubMySql
- MySQL高可用性之MySQL+DRBD+HeartbeatMySql
- CGAL——學習3
- MyBatis 3 學習MyBatis
- PHP學習(3)PHP
- 學習perl(3)
- java學習3Java
- Java學習(3)Java
- 強化學習-學習筆記3 | 策略學習強化學習筆記
- TimesTen記憶體碎片(高水位)回收步驟詳解記憶體
- 4.1.7.2.3 快速應用程式通知高可用性事件事件
- MySQL 高可用性—keepalived+mysql雙主MySql
- 雲中SQL Server高可用性最佳實踐SQLServer
- Oracle11g RAC高可用性理論整理Oracle
- 用於高可用性的Event Sourced 架構架構
- MySQL Fabric使用介紹01——高可用性HAMySql
- RedHat AS 3.0下高可用性叢集配置(轉)Redhat