Step by Step TimesTen --- DataStore的雙向複製( 一)
A機器上的fxtest_aa datastore 與 B機器上的fxtest_bb datastore 雙向複製
Step 1: Create DataStore
A機器:
1, 在sys.odbc.ini檔案中加入fxtest_aa datastore 的配置
########################################
## Data store attributes fxtest_aa
########################################
[fxtest_aa]
Driver=/ora/TimesTen/tt70/TimesTen/tt70/lib/libtten.so
DataStore=/ora/TimesTen/datastore/fxtest_aa
LogDir=/ora/TimesTen/datastore
DatabaseCharacterSet=AL32UTF8
Authenticate=0
# GroupRestrict=
Preallocate=1
Temporary=0
TypeMode=0
## First connection attributes
PermSize=380
TempSize=20
LogBuffSize=65536
LogFileSize=64
#LogFileSize=1
LogFlushMethod=1
LogAutoTruncate=0
Logging=1
LogPurge=1
CkptFrequency=600
CkptLogVolume=0
CkptRate=0
AutoCreate=1
Connections=100
ForceConnect=0
MemoryLock=4
Overwrite=0
RecoveryThreads=4
## General connection attributes
DurableCommits=0
ConnectionName=aa
Diagnostics=1
Isolation=1
LockLevel=0
LockWait=10
MatchLogOpts=0
PermWarnThreshold=75
PrivateCommands=0
SqlQueryTimeout=0
TempWarnThreshold=75
WaitForConnect=0
## NLS general connection attributes
ConnectionCharacterSet=AL32UTF8
NLS_NCHAR_CONV_EXCP=1
NLS_SORT=BINARY
2, 建立fxtest_aa datastore
$ ttisql fxtest_aa
Copyright (c) 1996-2007, Oracle. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
connect "DSN=fxtest_aa";
Connection successful: DSN=fxtest_aa;UID=times;DataStore=/ora/TimesTen/datastore/fxtest_aa;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;LogFileSize=64;WaitForConnect=0;Preallocate=1;DRIVER=/ora/TimesTen/tt70/TimesTen/tt70/lib/libtten.so;MemoryLock=4;LogBuffSize=65536;Authenticate=0;Isolation=1;LogDir=/ora/TimesTen/datastore;PermSize=380;TempSize=20;PermWarnThreshold=75;TempWarnThreshold=75;LockWait=10;SQLQueryTimeout=0;LogFlushMethod=1;Connections=100;LogAutoTruncate=0;CkptRate=0;CkptFrequency=600;CkptLogVolume=0;RecoveryThreads=4;TypeMode=0;
(Default setting AutoCommit=1)
Command>
3, 建立datastore 的物件
Command> create table reptable ( id number primary key, name varchar2(10));
B機器:
1,在sys.odbc.ini檔案中加入fxtest_bb datastore 的配置
##########################################
## Data store attributes fxtest_bb
#########################################
[fxtest_bb]
Driver=/export/home/times/TimesTen/tt70/lib/libtten.so
DataStore=/export/home/times/TimesTen/datastore/fxtest_bb
LogDir=/export/home/times/TimesTen/datastore
DatabaseCharacterSet=AL32UTF8
Authenticate=0
# GroupRestrict=
Preallocate=1
Temporary=0
TypeMode=0
## First connection attributes
PermSize=380
TempSize=20
LogBuffSize=65536
LogFileSize=64
LogFlushMethod=1
LogAutoTruncate=0
Logging=1
LogPurge=1
CkptFrequency=600
CkptLogVolume=0
CkptRate=0
AutoCreate=1
Connections=100
ForceConnect=0
MemoryLock=4
Overwrite=0
RecoveryThreads=4
## General connection attributes
DurableCommits=0
ConnectionName=fxtest_bb
Diagnostics=1
Isolation=1
LockLevel=0
LockWait=10
MatchLogOpts=0
PermWarnThreshold=75
PrivateCommands=0
SqlQueryTimeout=0
TempWarnThreshold=75
WaitForConnect=0
## NLS general connection attributes
ConnectionCharacterSet=AL32UTF8
NLS_NCHAR_CONV_EXCP=1
NLS_SORT=BINARY
2, 建立fxtest_bb datastore
bjinms221.bj.com> ttisql fxtest_bb
Copyright (c) 1996-2007, Oracle. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
connect "DSN=fxtest_bb";
Connection successful: DSN=fxtest_bb;UID=times;DataStore=/export/home/times/TimesTen/datastore/fxtest_bb;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;LogFileSize=64;WaitForConnect=0;Preallocate=1;DRIVER=/export/home/times/TimesTen/tt70/lib/libtten.so;MemoryLock=4;LogBuffSize=65536;Authenticate=0;Isolation=1;LogDir=/export/home/times/TimesTen/datastore;PermSize=380;TempSize=20;PermWarnThreshold=75;TempWarnThreshold=75;LockWait=10;SQLQueryTimeout=0;LogFlushMethod=1;Connections=100;LogAutoTruncate=0;CkptRate=0;CkptFrequency=600;CkptLogVolume=0;RecoveryThreads=4;NLS_NCHAR_CONV_EXCP=1;TypeMode=0;
(Default setting AutoCommit=1)
Command>
3, 建立datastore 的物件
Command> create table reptable ( id number primary key, name varchar2(10));
Step 2, 建立replication schema
1,在A與B機器上分別執行如下建立replication schema的指令碼
指令碼:
CREATE REPLICATION fxtest.reptest
ELEMENT element_rep_aa datastore
MASTER fxtest_aa ON "BJINMS216.BJ.COM" TRANSMIT NONDURABLE
SUBSCRIBER fxtest_bb ON "bjinms221.bj.com" RETURN RECEIPT
ROUTE MASTER fxtest_aa ON "BJINMS216.BJ.COM" SUBSCRIBER fxtest_bb ON "bjinms221.bj.com"
MASTERIP "10.194.22.16" priority 1 SUBSCRIBERIP "10.194.22.18" priority 1
ELEMENT element_rep_bb datastore
MASTER fxtest_bb ON "bjinms221.bj.com" TRANSMIT NONDURABLE
SUBSCRIBER fxtest_aa ON "BJINMS216.BJ.COM" RETURN RECEIPT
ROUTE MASTER fxtest_bb ON "bjinms221.bj.com" SUBSCRIBER fxtest_aa ON "BJINMS216.BJ.COM"
MASTERIP "10.194.22.18" priority 1 SUBSCRIBERIP "10.194.22.16" priority 1
STORE fxtest_aa ON "BJINMS216.BJ.COM" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
DISABLE RETURN SUBSCRIBER 50 DURABLE COMMIT OFF RETURN WAIT TIME 3
STORE fxtest_bb ON "bjinms221.bj.com" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
DISABLE RETURN SUBSCRIBER 50 DURABLE COMMIT OFF RETURN WAIT TIME 3;
2,A機器:
$ ttisql fxtest_aa
Copyright (c) 1996-2007, Oracle. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
connect "DSN=fxtest_aa";
Connection successful: DSN=fxtest_aa;UID=times;DataStore=/ora/TimesTen/datastore/fxtest_aa;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;LogFileSize=64;WaitForConnect=0;Preallocate=1;DRIVER=/ora/TimesTen/tt70/TimesTen/tt70/lib/libtten.so;MemoryLock=4;LogBuffSize=65536;Authenticate=0;Isolation=1;LogDir=/ora/TimesTen/datastore;PermSize=380;TempSize=20;PermWarnThreshold=75;TempWarnThreshold=75;LockWait=10;SQLQueryTimeout=0;LogFlushMethod=1;Connections=100;LogAutoTruncate=0;CkptRate=0;CkptFrequency=600;CkptLogVolume=0;RecoveryThreads=4;TypeMode=0;
(Default setting AutoCommit=1)
Command> CREATE REPLICATION fxtest.reptest
ELEMENT element_rep_aa datastore
> ELEMENT element_rep_aa datastore
MASTER fxtest_aa ON "BJINMS216.BJ.COM" TRANSMIT NONDURABLE >
MASTER fxtest_aa ON "BJINMS216.BJ.COM" TRANSMIT NONDURABLE
> SUBSCRIBER fxtest_bb ON "bjinms221.bj.com" RETURN RECEIPT
> ROUTE MASTER fxtest_aa ON "BJINMS216.BJ.COM" SUBSCRIBER fxtest_bb ON "bjinms221.bj.com"
> MASTERIP "10.194.22.16" priority 1 SUBSCRIBERIP "10.194.22.18" priority 1
>
> ELEMENT element_rep_bb datastore
> MASTER fxtest_bb ON "bjinms221.bj.com" TRANSMIT NONDURABLE
MASTERIP "10.194.22.18" priority 1 SUBSCRIBERIP "10.194.22.16" priority 1
> SUBSCRIBER fxtest_aa ON "BJINMS216.BJ.COM" RETURN RECEIPT
> ROUTE MASTER fxtest_bb ON "bjinms221.bj.com" SUBSCRIBER fxtest_aa ON "BJINMS216.BJ.COM"
STORE fxtest_bb ON "bjinms221.bj.com" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
> MASTERIP "10.194.22.18" priority 1 SUBSCRIBERIP "10.194.22.16" priority 1
>
> STORE fxtest_aa ON "BJINMS216.BJ.COM" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
> DISABLE RETURN SUBSCRIBER 50 DURABLE COMMIT OFF RETURN WAIT TIME 3
> STORE fxtest_bb ON "bjinms221.bj.com" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
> DISABLE RETURN SUBSCRIBER 50 DURABLE COMMIT OFF RETURN WAIT TIME 3;
Command>
3,B機器:
bjinms221.bj.com> ttisql fxtest_bb
Copyright (c) 1996-2007, Oracle. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
connect "DSN=fxtest_bb";
Connection successful: DSN=fxtest_bb;UID=times;DataStore=/export/home/times/TimesTen/datastore/fxtest_bb;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;LogFileSize=64;WaitForConnect=0;Preallocate=1;DRIVER=/export/home/times/TimesTen/tt70/lib/libtten.so;MemoryLock=4;LogBuffSize=65536;Authenticate=0;Isolation=1;LogDir=/export/home/times/TimesTen/datastore;PermSize=380;TempSize=20;PermWarnThreshold=75;TempWarnThreshold=75;LockWait=10;SQLQueryTimeout=0;LogFlushMethod=1;Connections=100;LogAutoTruncate=0;CkptRate=0;CkptFrequency=600;CkptLogVolume=0;RecoveryThreads=4;NLS_NCHAR_CONV_EXCP=1;TypeMode=0;
(Default setting AutoCommit=1)
Command> CREATE REPLICATION fxtest.reptest
ELEMENT element_rep_aa datastore
> ELEMENT element_rep_aa datastore
MASTER fxtest_aa ON "BJINMS216.BJ.COM" TRANSMIT NONDURABLE
> MASTER fxtest_aa ON "BJINMS216.BJ.COM" TRANSMIT NONDURABLE
> SUBSCRIBER fxtest_bb ON "bjinms221.bj.com" RETURN RECEIPT
> ROUTE MASTER fxtest_aa ON "BJINMS216.BJ.COM" SUBSCRIBER fxtest_bb ON "bjinms221.bj.com"
> MASTERIP "10.194.22.16" priority 1 SUBSCRIBERIP "10.194.22.18" priority 1
>
> ELEMENT element_rep_bb datastore
> MASTER fxtest_bb ON "bjinms221.bj.com" TRANSMIT NONDURABLE
MASTERIP "10.194.22.18" priority 1 SUBSCRIBERIP "10.194.22.16" priority 1
> SUBSCRIBER fxtest_aa ON "BJINMS216.BJ.COM" RETURN RECEIPT
> ROUTE MASTER fxtest_bb ON "bjinms221.bj.com" SUBSCRIBER fxtest_aa ON "BJINMS216.BJ.COM"
STORE fxtest_bb ON "bjinms221.bj.com" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
> MASTERIP "10.194.22.18" priority 1 SUBSCRIBERIP "10.194.22.16" priority 1
>
> STORE fxtest_aa ON "BJINMS216.BJ.COM" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
> DISABLE RETURN SUBSCRIBER 50 DURABLE COMMIT OFF RETURN WAIT TIME 3
> STORE fxtest_bb ON "bjinms221.bj.com" FAILTHRESHOLD 3 RETURN SERVICES OFF WHEN REPLICATION STOPPED
> DISABLE RETURN SUBSCRIBER 50 DURABLE COMMIT OFF RETURN WAIT TIME 3;
Command>
Step 3, 啟動replication Agent
1,A機器:
$ ttAdmin -repStart fxtest_aa
RAM Residence Policy : inUse
Replication Agent Policy : manual
Replication Manually Started : True
Cache Agent Policy : manual
Cache Agent Manually Started : False
2,B機器:
bjinms221.bj.com> ttAdmin -repStart fxtest_bb
RAM Residence Policy : inUse
Replication Agent Policy : manual
Replication Manually Started : True
Cache Agent Policy : manual
Cache Agent Manually Started : False
Step by Step TimesTen --- DataStore的雙向複製( 二)參見 http://space.itpub.net/81/viewspace-429796
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/81/viewspace-429795/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- React Step by StepReact
- Promise的實現(step by step)Promise
- Command 模式 Step by Step模式
- Shell Step by Step (4) —— Cron & Echo
- Step by Step 安裝 BizTalk Server 2009Server
- Step by Step Data Replication Using Oracle GoldenGateOracleGo
- TIDB DM資料同步step by stepTiDB
- 單步除錯 step into/step out/step over 區別詳解除錯
- Step-by-step,打造屬於自己的vue ssrVue
- 實時 Linux 抖動分析 Step by stepLinux
- ABP應用開發(Step by Step)-下篇
- ABP應用開發(Step by Step)-上篇
- Vue.js SSR Step by Step (2) – 一個簡單的同構DEMOVue.js
- Linkerd 2.10(Step by Step)—使用 Kustomize 自定義 Linkerd 的配置
- PostgreSQL雙向複製教程SQL
- Linkerd 2.10(Step by Step)—多叢集通訊
- Sql Server Linux(Redhat) Distributed Availability Group Setup — step by stepSQLServerLinuxRedhatAI
- 10GR2下建立物理standby STEP BY STEP
- Adaboost Algorithm StepGo
- 深度學習之step by step搭建神經網路深度學習神經網路
- Linkerd 2.10(Step by Step)—設定服務配置檔案
- Linkerd 2.10(Step by Step)—1. 將您的服務新增到 Linkerd
- 使用Eclipse 安裝 構建Maven專案 (step-by-step)EclipseMaven
- Linkerd 2.10(Step by Step)—4. 如何配置外部 Prometheus 例項Prometheus
- Linkerd 2.10(Step by Step)—2. 自動化的金絲雀釋出
- HTML step 屬性HTML
- 【Step-By-Step】高頻面試題深入解析 / 週刊06面試題
- 【Step-By-Step】高頻面試題深入解析 / 週刊07面試題
- 【Step-By-Step】高頻面試題深入解析 / 週刊04面試題
- 【Step-By-Step】高頻面試題深入解析 / 週刊05面試題
- 【Step-By-Step】高頻面試題深入解析 / 週刊03面試題
- 【Step-By-Step】高頻面試題深入解析 / 週刊01面試題
- 【Step-By-Step】高頻面試題深入解析 / 週刊02面試題
- 阿里雲數倉Dataworks資料匯出到檔案step by step阿里
- Linkerd 2.10(Step by Step)—將 GitOps 與 Linkerd 和 Argo CD 結合使用GitGo
- 2.4.8 Step 7: 建立spfile
- step1 補充
- [完結] Learn Vue 2: Step By Step [Laracasts 免費視訊中文語音]VueAST
- [完結] Learn Vue 2: Step By Step [Laracasts 免費影片中文語音]VueAST