DB2 SQL複製知識點

zchbaby2000發表於2015-12-16
密碼檔案的建立
asnpwd INIT ENCRYPT PASSWORD using "C:\mq\dprop\asnpwd.aut"
asnpwd ADD ALIAS SOURCE ID suserid PASSWORD suserpwd using "C:\mq\dprop\asnpwd.aut"
asnpwd ADD ALIAS TARGET ID tuserid PASSWORD tuserpwd using "C:\mq\dprop\asnpwd.aut"
asnpwd LIST using "C:\mq\dprop\asnpwd.aut"

capture和apply啟停
start capture
set db2codepage=1208
asncap CAPTURE_SERVER=GSDB CAPTURE_SCHEMA=ASN CAPTURE_PATH=C:\mq\dprop\cap startmode=COLD
Start Apply
asnapply CONTROL_SERVER=SAMPLE APPLY_QUAL=aq00 APPLY_PATH=C:\mq\dprop\app
Stop Capture
asnccmd CAPTURE_SERVER=GSDB CAPTURE_SCHEMA=ASN STOP
Stop Apply
asnacmd CONTROL_SERVER=SAMPLE APPLY_QUAL=aq00 STOP

比較兩個資料庫同一個表的資料
asntdiff db=SAMPLE where="target_table = 'CTMTCAP' and apply_qual = 'AQ00' and set_name = 'SET00'"
讓Target表的資料和Source表的資料一致
asntrep DB=SAMPLE SCHEMA=ASN where="target_table = 'CTMTCAP' and apply_qual = 'AQ00' and set_name = 'SET00'"
檢視複製狀態
asnacmd apply_qual=AQ00 control_server=SAMPLE status



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/725820/viewspace-1873449/,如需轉載,請註明出處,否則將追究法律責任。

相關文章