GoldenGate學習筆記(4)_程式配置與管理

gdutllf2006發表於2010-01-07

GoldenGate學習筆記程式配置

參考文件 <>P34

 

一個典型的GoldenGate配置需要:

Source端,配置一個管理程式, 新增一個Extract 程式,新增一個本地佇列路徑,定義一個遠端的接收佇列路徑

 

Target端,配置一個管理程式和新增一個Replicat程式,指定一個應用佇列,即抽取程式定義的遠端佇列

完整的例子參考<< GoldneGate學習筆記_配置例程之單向複製.doc>>

 

一 Configure the Manager Process

 

1 The Manager Process performs the following functions:

1) Start GoldenGate processes

2) Start dynamic processes

3) Perform. trail management

4) Issue event and threshold reports

5) Manitain error reporting

 

2 Configure Manager

Ensure that the Manager user has the proper system permissions to read, write, and purge GoldenGate files and directories to control processes.

 

1) From the GoldenGate directory, run the ggsci program. This is the GoldenGate Software Command Interface, commonly known as GGSCI.

oracle@Z813:/u01/ggs> ./ggsci

 

GoldenGate Command Interpreter for Oracle

Version 10.0.0.13 Build 001

Linux, x64, 64bit (optimized), Oracle 9 on Apr  8 2009 09:04:32

 

Copyright GoldenGate Software, Inc.  1995-2009.

This software includes code written by third parties, including

Blowfish encryption library (Copyright (C) 1997 by Paul Kocher)

and other code as specified at Additional

details regarding such third party code, including applicable copyright,

legal and licensing notices, are available at the above referenced URL.

 

 

2) In GGSCI, issue the following command.

EDIT PARAMS MGR(管理程式的引數檔案一定要這個名)

 

GGSCI (Z813) 9> edit params manager

port 7809

dirprm/manager.prm" [New] 1L, 10C written                                                                 

 

GGSCI (Z813) 10> start manager

ERROR: Parameter file /u01/ggs/dirprm/mgr.prm does not exis

 

3) The only required parameter for Manager is PORT, which defines the port number on which Manager runs on the local system. The default port is 7809. You must specify either the default port or another port. This must be to start processes. The Extract process uses the port to request Manager to start a remote Collector process or an initial-load Replicat process.

 

PORT

--指定埠

Note the port number also must be specified with the MGRPORT argument of the Extract parameter RMTHOST.(Extract (Data Pump)引數檔案中必須指定遠端的接收埠同樣為)

 

3 Recommended parameters

 

1) Dynamic port parameters

DYNAMICPORTLIST { | -} [ , ...]

--指定埠範圍

 

2) The amount of time that Manager waits to reuse a port after it has been used or after encountering an error is controlled by the Manager parameter

DYNAMICPORTREASSIGNDELAY.

DYNAMICPORTREASSIGNDELAY

--重用延遲

 

3) Autostart parameters

 

Use the AUTOSTART parameter to start specified extraction and replication processes as soon as Manager starts.

AUTORESTART {ER | EXTRACT | REPLICAT} {group name | wildcard}

[, RETRIES ]

[, WAITMINUTES ]

[, RESETMINUTES ]

 

 

4 Starting/Stopping Manager

 

1) To run Manager from the command line(OS command line start manager processes)

To run Manager from the command shell of the operating system, use the

following syntax.

mgr paramfile [reportfile ]

 

2) To run Manager from GGSCI

1. From the GoldenGate directory, run GGSCI.

2. In GGSCI, issue the following command.

START MANAGER

 

3) Stop Manager

STOP manager

 

 

Configure Extract and Replica Processes

 

Extract程式和Replicat程式必須手動新增,而不像Manager程式,定義一個引數檔案就可啟動.

 

ADD EXTRACT ext_test, TRANLOG, BEGIN NOW

ADD EXTTRAIL /u01/ggs/dirdat/t_, EXTRACT ext_test, MEGABYTES 20

 

ADD REPLICAT rep_test, EXTTRAIL /u01/ggs/dirdat/r_, nodbcheckpoint

 

 

Getting Started with GoldenGate

1 ./ggsci /tmp/ggsci.sql 指令碼化執行 Command

 

oracle@Z813:/u01/ggs> vi tmp.sql

 

info all

 

 

 

GoldenGate Command Interpreter for Oracle

Version 10.0.0.13 Build 001

Linux, x64, 64bit (optimized), Oracle 9 on Apr  8 2009 09:04:32

 

Copyright GoldenGate Software, Inc.  1995-2009.

This software includes code written by third parties, including

Blowfish encryption library (Copyright (C) 1997 by Paul Kocher)

and other code as specified at Additional

details regarding such third party code, including applicable copyright,

legal and licensing notices, are available at the above referenced URL.

 

 

GGSCI (Z813) 1> info all

 

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     RUNNING     DPEMYDB     00:00:00      00:00:00   

EXTRACT     RUNNING     EXTMYDB     00:00:00      00:00:01   

 

 

GGSCI (Z813) 2> oracle@Z813:/u01/ggs>

 

Note: To stop the Manager process from a batch file, make certain to add the ! argument to the end of the STOP MANAGER command. Otherwise, GGSCI issues a prompt that requires a response and cause the processing into a loop.

(Stop manager 後面可以加 )

STOP MANAGER ! Stops Manager without user confirmation

 

2 Using GoldenGate parameter files

 

2,1 GLOBALs file: The GLOBAL file stores parameters that relate to the GoldenGate instance as a whole.

EDIT params ./GLOBALS

(Global檔案不是必須的)

 

2.2 runtime parameters:

edit params mgr

edit params extcdz

edit params repcdz

 

2.3 Verifying a parameter file(在正式啟動程式之前先對引數檔案做個語法檢查。)

To verify parameter syntax

1) Include the CHECKPARAMS parameter in the parameter file.

2) Start the associated process by issuing the START EXTRACT or START REPLICAT command in GGSCI.

START {EXTRACT | REPLICAT}

 

GoldenGate audits the syntax and writes the results to the report file or the screen. Then the process stops.

在引數檔案中加CHECKPARAMS引數,則不管引數檔案是否存在語法的錯誤,程式都會退出.應透過檢視report檔案來檢視到底有沒有語法上的錯誤.如沒有,則去掉引數CHECKPARAMS,啟動程式.

 

2.4 Viewing a parameter file(檢視引數檔案)

view params

view params mgr

view paramx extcdz

 

2.5 changing a parameter file

Stop mgr

edit mgr

start mgr

 

2.6 Using OBEY

create a library of text files that contain frequently used parameter settings, and then you can call any of those files from the active parameter file by means of the OBEY panamer.

       OBEY

類似C語言中的Include,對頻繁執行的命令放到一個單獨的檔案中,在執行時,包括進來.

 

Monitor Processing

 

1 Using the error log

open the ggserr.log file in the GoldenGate directory or issue the VIEW GGSEVT command from GGSCI

       view ggsevt

       more ggserr.log | grep ERROR

 

2 GGSCI information commands

 

INFO {EXTRACT | REPLICAT}                   Shows general information.

INFO ALL                                Shows information about all GoldenGate processes on the system.

                           

STATS {EXTRACT|REPLICAT}               Shows processing statistics

 

STATUS {EXTRACT|REPLICAT}                   Shows the status of a process

 

LAG {EXTRACT|REPLICAT}                          Shows synchronization latency

 

INFO RMTTRAIL                                              Shows trail information. For use the full path name of the trail

 

STATUS MANAGER                                                            Shows the status of the Manager process.

 

SEND MANAGER                                                               Shows runtime statistics for the Manager process.

 

SEND {EXTRACT | REPLICAT} ,       

Communicates with a running process and provides options to view runtime information or send requests.

 

3 Get Help

HELP

Eg: HELP  ADD EXTRACT

更多的命令參考<手冊之GoldenGate常用命令>>

 

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

相關文章