Golden Gate Maintenance: stop/start GoldenGate processes

From Robs_Wiki
Jump to: navigation, search

Introduction

Stop Sequence:

  • stop the extract process on the source
  • wait for the pump process to catch up
  • stop the pump process on the source
  • wait for the replicat process to catch up
  • stop the replicat process on the target
  • optionally (because it does not belong to a specific GoldenGate replication) stop the manager and jagent process on both source and target

Start Sequence:

  • optionally start the manager and the jagent process
  • start the replicat process on the target
  • start the pump process on the source
  • start the extract process on the source

Step 1: Log on to the Golden Gate Command Line Interface

As the oracle user, set the environment to the oracle database and to the golden gate environment. (Note that multiple golden gate environments exist on Exadata)

$ cd $GG_HOME
$ ./ggsci
GGSCI> dblogin useridalias alias_ggadmin

Step 2: Review all running processes

-- on the source database
GGSCI> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
EXTRACT RUNNING PHR 00:00:00 00:00:02
EXTRACT RUNNING XHR 00:00:06 00:00:01

-- on the target database
GGSCI> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT STOPPED
REPLICAT RUNNING RHR 00:00:00 00:01:11

Step 3 Stop the GoldenGate replication

Step 3.1 Stop the extract process (on the source)

GGSCI> stop extract XHR
Sending STOP request to EXTRACT XHR ...
STOP request pending. There are open, long-running transactions.
Before you stop Extract, make the archives containing data for those transactions available for when Extract restarts.
To force Extract to stop, use the SEND EXTRACT XHR, FORCESTOP command..
2017-08-01 10:50:50 WARNING OGG-01742 Command sent to EXTRACT XHR returned with an invalid response.

Remark: In most cases a normal stop will not work as there may be open transactions. In that case a force restart needs to be performed. (during Extract startup an Extract BR recovery will be performed automatically)

GGSCI> SEND EXTRACT XHR, FORCESTOP
Sending FORCESTOP request to EXTRACT XHR ...
Request processed.
GGSCI> info extract XHR
EXTRACT XHR Last Started 2017-08-01 10:52 Status STOPPED
Checkpoint Lag 00:00:11 (updated 00:03:29 ago)
Process ID 60358682
Log Read Checkpoint Oracle Integrated Redo Logs
2017-08-01 10:51:06
SCN 1564.4022432767 (6721351283711)

Remark: if you are not able to stop the extract you can kill the extract as follows:

GGSCI> kill extract xhr

Sending KILL request to MANAGER ...
Killed process (10093014) for EXTRACT XHR

Step 3.2 View if the pump process has caught up (on the source)

GGSCI>info extract prob
EXTRACT PROB Last Started 2017-07-21 09:12 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:09 ago)
Process ID 149498
Log Read Checkpoint File ./dirdat/rac01/xr000000031
2017-07-24 09:17:24.000000 RBA 7485693

Step 3.3 Stop the pump process (on the source)

GGSCI> stop extract prob
Sending STOP request to EXTRACT PHR ...
Request processed.

GGSCI> info extract phr
EXTRACT PHR Last Started 2017-07-21 09:12 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:07 ago)
Log Read Checkpoint File ./dirdat/rac01/xr000000031
2017-07-24 09:17:24.000000 RBA 7485693

Step 3.4 View if the replicat process has caught up (on the target)

GGSCI> info replicat rhr
REPLICAT RHR Last Started 2017-07-24 09:03 Status RUNNING
INTEGRATED
Checkpoint Lag 00:00:00 (updated 00:00:09 ago)
Process ID 32615
Log Read Checkpoint File ./dirdat/dggt01/xr000000000
2017-07-24 09:35:23.419099 RBA 0

Step 3.5 Stop the replicat process (on the target)

GGSCI > stop replicat rrob
Sending STOP request to REPLICAT RROB ...
Request processed.

Step 3.6 Optionally stop the manager and jagent process (on both the source and the target)

Perform this on both the source and the target:

GGSCI> stop jagent
JAgent process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
Sending STOP request to GGCMD JAGENT ...
Request processed.
JAgent stopped.
GGSCI> 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.

Step 4 Start the GoldenGate replication

Step 4.1 Start all the components on the target

Optionally start the manager and jagent processes if it was stopped before:

GGSCI> start mgr
Manager started.

GGSCI> start jagent
Sending START request to MANAGER ...
GGCMD JAGENT starting

GGSCI> start replicat rhr
Sending START request to MANAGER ...
REPLICAT RHR starting

GGSCI> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
REPLICAT RUNNING RHR 00:00:00 00:00:01

Step 4.2 Start all the components on the source

Optionally start the manager and jagent processes if they were stopped before:

GGSCI> start mgr
Manager started.

GGSCI> start jagent
Sending START request to MANAGER ...
GGCMD JAGENT starting

GGSCI> start extract phr
Sending START request to MANAGER ...
EXTRACT PHR starting

GGSCI> start extract xhr
Sending START request to MANAGER ...
EXTRACT XHR starting

GGSCI> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
EXTRACT RUNNING PHR 00:00:00 00:00:01
EXTRACT RUNNING XHR 00:00:03 00:10:12

Remark about starting an Extract

When you start an Extract, extract recovery takes place. You can see this in the Extract report file, but also in the database alertfile: Extract report file:

2017-08-01 10:51:32 INFO OGG-01639 BOUNDED RECOVERY: ACTIVE: for object pool 1: p60358680_extr.
2017-08-01 10:51:32 INFO OGG-01640 BOUNDED RECOVERY: recovery start XID: 1378.17.243501.
2017-08-01 10:51:32 INFO OGG-01641 BOUNDED RECOVERY: recovery start position: SeqNo: 454, RBA:
304697360, SCN: 1564.4022180645 (6721351031589), Timestamp: 2017-08-01 07:06:04.000000.
2017-08-01 10:51:32 INFO OGG-01642 BOUNDED RECOVERY: recovery end position: SeqNo: 454, RBA:
316864984, SCN: 1564.4022192468 (6721351043412), Timestamp: 2017-08-01 07:16:20.000000, Thread: 1.
2017-08-01 10:51:32 INFO OGG-01579 BOUNDED RECOVERY: VALID BCP: CP.XHR.000000004.
2017-08-01 10:51:32 INFO OGG-01629 BOUNDED RECOVERY: PERSISTED OBJECTS RECOVERED: 1.

Database alert file:
Tue Aug 01 11:09:29 2017
LOGMINER: session#=1 (OGG$CAP_XHR), reader MS00 pid=277 OS id=25297056 sid=1144 started
Tue Aug 01 11:09:29 2017
LOGMINER: session#=1 (OGG$CAP_XHR), builder MS01 pid=302 OS id=22217076 sid=758 started
Tue Aug 01 11:09:29 2017
LOGMINER: session#=1 (OGG$CAP_XHR), preparer MS02 pid=304 OS id=37355690 sid=854 started
Tue Aug 01 11:09:29 2017
LOGMINER: session#=1 (OGG$CAP_XHR), preparer MS03 pid=305 OS id=65667092 sid=891 started
Tue Aug 01 11:09:31 2017
OGG Capture client successfully attached to GoldenGate Capture OGG$CAP_XHR to receive uncommitted
changes with pid=94 OS id=25035072.
Tue Aug 01 11:09:31 2017
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 454,
/oracle/archive/PRD12C_454_1_950178022.arc
Tue Aug 01 11:09:37 2017
LOGMINER: End mining logfile for session 1 thread 1 sequence 454,
/oracle/archive/PRD12C_454_1_950178022.arc
Tue Aug 01 11:09:37 2017
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 455, /reshPRD12C/db05/redo5a.l