Oracle goldgate常用命令

    公司使用Oracle 的goldgate已经半年了,总结一下goldgate的常用命令的如下:

 

1.查看帮助

 help, help add exttrail

2.显示当前的GoldenGate环境信息

 show

3.查看运行状态

  info all, info mgr, info extract einikk

 

4.启动和停止服务

  start mgr,stop mgr

  start extract einikk,stop extract einikk

  start replicat rinikk,stop replicat rinikk

   如果不能停止的话,

   killi extract einikk

5.历史命令

  history

6.使用OBEY(自动运行一个文件)

  1. Create and save a text file that contains the commands, one command per line. This is
your OBEY file. Name it what you want.
2. In GGSCI, call the OBEY file by using the following syntax.
OBEY <file name>


gdora@testdb11 ggs]$ cat /home/gdora/ggs/yzhq.txt
status manager
status mgr
[gdora@testdb11 ggs]$


GGSCI (testdb11.zhyhl.com) 1> obey yzhq.txt

GGSCI (testdb11.zhyhl.com) 2> status manager


Manager is running (IP port testdb11.zhyhl.com.7809).


GGSCI (testdb11.zhyhl.com) 3> status mgr


Manager is running (IP port testdb11.zhyhl.com.7809).


GGSCI (testdb11.zhyhl.com) 4>

  7.使用shell脚本
   Using UNIX batch and shell scripts
On a UNIX system, you can issue GoldenGate commands from a script such as a startup
script, shutdown script, or failover script by running GGSCI and calling an input file. Use
the following syntax:

ggsci < <input_file>


[gdora@testdb11 ggs]$ ggsci < yzhq.txt

GoldenGate Command Interpreter for Oracle
Version 10.4.0.12 Build 001
Linux, x86, 32bit (optimized), Oracle 10 on Aug 21 2009 14:34:04

Copyright (C) GoldenGate Software, Inc. 1995-2009.
The GoldenGate software may include other code written by third parties;
details regarding such third party code, including applicable copyright,
legal and licensing notices are available at http://support.goldengate.com.



GGSCI (testdb11.zhyhl.com) 1>
Manager is running (IP port testdb11.zhyhl.com.7809).


GGSCI (testdb11.zhyhl.com) 2>
Manager is running (IP port testdb11.zhyhl.com.7809).


GGSCI (testdb11.zhyhl.com) 3> [gdora@testdb11 ggs]$
[gdora@testdb11 ggs]$

8.修改参数文件

  edit params <group name>

9.参数文件存放的目录

  Storing parameter files<完整路径>

10.参数的使用规则和注释

   ---注释

11.参数文件内的语法

   <PARAMETER> <argument> [, <option>] [&]
 

12.查看参数文件的内容

  view params mgr

13.查看报告

  view report einikk

14.查看操作的统计信息

  STATS {EXTRACT | REPLICAT} <group>

  stats er*

15.info er*

 

16.查看GoldenGate的错误日志内容

  VIEW GGSEVT Contents

17. Deleting a process group

  delete einikk

 

 

<TBSDB1>$./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.0.19 Build 002
HP/UX, IA64, 64bit (optimized), Oracle 11 on Jan 20 2011 14:57:29

Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.



GGSCI (TBSDB1) 1> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     STOPPED	DPTBS       00:00:00      913:41:40   
EXTRACT     STOPPED        EXTTBS      00:00:00      913:41:40   


GGSCI (TBSDB1) 2> MGR start
ERROR: Invalid command.

GGSCI (TBSDB1) 3> start mgr
MGR is already running.


GGSCI (TBSDB1) 4> start dptbs

Sending START request to MANAGER ...
EXTRACT DPTBS starting


GGSCI (TBSDB1) 5> start exttbs

Sending START request to MANAGER ...
EXTRACT EXTTBS starting


GGSCI (TBSDB1) 6> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     DPTBS       00:00:00      913:42:13   
EXTRACT     RUNNING     EXTTBS      00:00:00      913:42:11   

GGSCI (TBSDB1) 8> HELP

GGSCI Command Summary:

Object:          Command:
SUBDIRS          CREATE
ER               INFO, KILL, LAG, SEND, STATUS, START, STATS, STOP
EXTRACT          ADD, ALTER, CLEANUP, DELETE, INFO, KILL,
                 LAG, SEND, START, STATS, STATUS, STOP
EXTTRAIL         ADD, ALTER, DELETE, INFO
GGSEVT           VIEW
MANAGER          INFO, SEND, START, STOP, STATUS
MARKER           INFO
PARAMS           EDIT, VIEW
REPLICAT         ADD, ALTER, CLEANUP, DELETE, INFO, KILL, LAG, SEND,
                 START, STATS, STATUS, STOP
REPORT           VIEW
RMTTRAIL         ADD, ALTER, DELETE, INFO
TRACETABLE       ADD, DELETE, INFO
TRANDATA         ADD, DELETE, INFO
CHECKPOINTTABLE  ADD, DELETE, CLEANUP, INFO

Commands without an object:
(Database)       DBLOGIN, LIST TABLES, ENCRYPT PASSWORD
(DDL)            DUMPDDL
(Miscellaneous)  FC, HELP, HISTORY, INFO ALL, OBEY, SET EDITOR, SHELL, 
                 SHOW, VERSIONS, ! (note: you must type the word
                 COMMAND after the ! to display the ! help topic.)
                 i.e.: GGSCI (sys1)> help ! command
              


For help on a specific command, type HELP <command> <object>.

Example: HELP ADD REPLICAT

GGSCI (TBSDB1) 14> HISTORY

GGSCI Command History

    5: start exttbs
    6: info all
    7: HLEP
    8: HELP
    9: status
   10: REPORT VIEW
   11: VIEW REPORT
   12: VIEW REPORT
   13: VIEW REPORT DBTBS
   14: HISTORY


GGSCI (TBSDB1) 2> HELP VIEW REPORT


VIEW REPORT

Use VIEW REPORT to view the process report that is generated by Extract
or Replicat. The report lists process parameters, run statistics, error
messages, and other diagnostic information.

The command displays only the current report. Reports are aged whenever
a process starts. Old reports are appended with a sequence number, for
example finance0.rpt, finance1.rpt, and so forth. To view old reports,
use the [<n>] option. 

Syntax:

VIEW REPORT {<group name>[<n>] | <file name>}


<group name>

The name of the group. The command assumes the report file named
<group>.rpt in the Oracle GoldenGate dirrpt sub-directory.


<n>

The number of an old report. Report files are numbered from 0 (the most
recent) to 9 (the oldest).


<file name>

A fully qualified file name, such as c:\ggs\dirrpt\orders.rpt.


Example 1:

The following displays an old report file (number 3) for the orders
group.

VIEW REPORT orders3


Example 2:

The following displays a specific report identified by file name.

VIEW REPORT c:\ggs\dirrpt\orders.rpt


GGSCI (TBSDB1) 3> VIEW REPORT /gdata/dirrpt/DPTBS.rpt


***********************************************************************
                 Oracle GoldenGate Capture for Oracle
                     Version 11.1.1.0.19 Build 002
   HP/UX, IA64, 64bit (optimized), Oracle 11 on Jan 20 2011 15:18:44
 
Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2011-10-28 17:12:59
***********************************************************************

Operating System Version:
HP-UX
Version U, Release B.11.31
Node: TBSDB1
Machine: ia64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :   4294967296   4294967296
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited

Process id: 25674

Description: 

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
EXTRACT dptbs
RMTHOST 198.120.1.19, MGRPORT 7839, compress
PASSTHRU
numfiles 5000
RMTTRAIL ./dirdat/rt
DYNAMICRESOLUTION

TABLE TBS.BA10_DAY_BALANCE_INFO;
TABLE TBS.BP10_ETICKET_PLAN;
TABLE TBS.BP10_RECEIPT_PLAN;
TABLE TBS.BP10_WINDOW_ETICKET;


CACHEMGR virtual memory values (may have been adjusted)
CACHEBUFFERSIZE:                         64K
CACHESIZE:                                8G
CACHEBUFFERSIZE (soft max):               4M
CACHEPAGEOUTSIZE (normal):                4M
PROCESS VM AVAIL FROM OS (min):          16G
CACHESIZEMAX (strict force to disk):  13.99G

2011-10-28 17:13:05  INFO    OGG-01226  Socket buffer size set to 27985 (flush size 27985).

Source Context :
  SourceModule            : [er.recovery]
  SourceID                : [/mnt/ecloud/workspace/Build_OpenSys_r11.1.1.0.19_002_[44502]/perforce/src/app/er/recovery.c]
  SourceFunction          : [RECOVERY_initialize]
  SourceLine              : [1712]

GGSCI (TBSDB1) 5> VIEW GGSEVT

2011-06-08 21:23:05  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): edit mgr.
2011-06-08 21:23:12  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): edit param
 mgr.
2011-06-08 21:38:20  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): edit param
 mgr.
2011-06-08 22:30:50  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): start mgr.
2011-06-08 22:30:50  WARNING OGG-00959  Oracle GoldenGate Manager for Oracle, mgr.prm:  PURGEOLDEXTRACTS ./dirdat/*,usecheckp
oints, minkeepdays 1 (MINKEEPFILES option not used.).
2011-06-08 22:30:50  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 7839).
2011-06-08 22:31:28  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): ADD EXTRAC
T exttbs  tranlog, begin now.
2011-06-08 22:31:37  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): ADD EXTTRA
IL ./dirdat/pt  EXTRACT exttbs,megabytes 500.

GGSCI (TBSDB1) 13> show

Parameter settings:

SET SUBDIRS    ON
SET DEBUG      OFF

Current directory: /gdata

Using subdirectories for all process files

Editor:  vi

Reports (.rpt)                 /gdata/dirrpt
Parameters (.prm)              /gdata/dirprm
Stdout (.out)                  /gdata/dirout
Replicat Checkpoints (.cpr)    /gdata/dirchk
Extract Checkpoints (.cpe)     /gdata/dirchk
Process Status (.pcs)          /gdata/dirpcs
SQL Scripts (.sql)             /gdata/dirsql
Database Definitions (.def)    /gdata/dirdef


GGSCI (TBSDB1) 14> versions
Operating System:
HP-UX
Version U, Release B.11.31
Node: TBSDB1
Machine: ia64

Database:
ERROR: Not logged into database, use DBLOGIN.

GGSCI (TBSDB1) 23> stop dptbs
EXTRACT DPTBS is already stopped.


GGSCI (TBSDB1) 24> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y

Sending STOP request to MANAGER ...
Request processed.
Manager stopped.


GGSCI (TBSDB1) 25> quit

 

你可能感兴趣的:(oracle)