原創:goldengate從11.2升級到12.1.2

goldengate從11.2升級到12.1.2sql

1.中止抽取進程

GGSCI (001.oracle.drs.dc.com) 286> stop EXTSJ01數據庫

2. 中止投遞和複製進程

等待投遞進程傳輸完和複製進程加載完畢.當投遞進程的Write Checkpoint #1的Sequence和RBA和複製進程的 Current CHECKPOINT的Sequence和RBA相同時表示已同步完畢oracle

2.1檢查投遞進程:

GGSCI (001.oracle.drs.dc.com) 202> info PUPTDB2P,showchapp

 

EXTRACT    PUPTDB2P  Last Started 2016-05-04 20:32   Status STOPPEDide

Checkpoint Lag       00:00:00 (updated 01:12:12 ago)spa

Log Read Checkpoint  File ./dirdat/exttrdbk/ex000006rest

                     First Record  RBA 1151orm

 

 

Current Checkpoint Detail:blog

 

Read Checkpoint #1進程

 

  GGS Log Trail

 

  Startup Checkpoint (starting position in the data source):

    Sequence #: 6

    RBA: 1151

    Timestamp: 2016-04-29 14:40:29.589038

    Extract Trail: ./dirdat/exttrdbk/ex

 

  Current Checkpoint (position of last record read in the data source):

    Sequence #: 6

    RBA: 1151

    Timestamp: Not Available

    Extract Trail: ./dirdat/exttrdbk/ex

 

Write Checkpoint #1

 

  GGS Log Trail

 

  Current Checkpoint (current write position):

    Sequence #: 7

    RBA: 1183

    Timestamp: 2016-05-04 20:35:56.803177

    Extract Trail: /home/ggt/goldengate/dirdat/reptdb2p/re

    Trail Type: EXTTRAIL

 

   

2.2檢查複製進程  

GGSCI (001.oracle.drs.dc.com) 209> info reptdb2p,showch

 

REPLICAT   REPTDB2P  Last Started 2016-05-04 20:32   Status STOPPED

Checkpoint Lag       00:00:00 (updated 01:14:28 ago)

Log Read Checkpoint  File ./dirdat/reptdb2p/re000007

                     2016-05-04 20:32:43.741679  RBA 1183

 

 

Current Checkpoint Detail:

 

Read Checkpoint #1

 

  GGS Log Trail

 

  Startup Checkpoint (starting position in the data source):

    Sequence #: 6

    RBA: 1246

    Timestamp: 2016-04-29 14:40:29.589110

    Extract Trail: ./dirdat/reptdb2p/re

 

  Current Checkpoint (position of last record read in the data source):

    Sequence #: 7

    RBA: 1183

    Timestamp: 2016-05-04 20:32:43.741679

Extract Trail: ./dirdat/reptdb2p/re

 

2.3中止投遞進程和複製進程

GGSCI (001.oracle.drs.dc.com) 209> STOP puptdb2p

GGSCI (001.oracle.drs.dc.com) 210> STOP reptdb2p

 

3.中止管理進程

GGSCI (001.oracle.drs.dc.com) 210> STOP mgr

 

4.備份原來的goldengate

[ggt@001.oracle.drs.dc.com ~]$ mv goldengate goldengate11.2

 

5.安裝goldengate 12.1

[ggt@001 ~]$ unzip 121200_fbo_ggs_Linux_x64_shiphome.zip

[ggt@001 ~]$ cd fbo_ggs_Linux_x64_shiphome/Disk1

[ggt@001 ~]$ ./runInstaller

 

選擇數據庫版本,個人是oracle 11G

 

 

選擇安裝位置:指定到原始版本的位置;選擇是否自動啓動管理進程

 

 

 

 

6.檢查安裝有效性

[ggt@001.oracle.drs.dc.com goldengate]$ ./ggsci

 

Oracle GoldenGate Command Interpreter for Oracle

Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO

Linux, x64, 64bit (optimized), Oracle 11g on Sep 25 2013 00:31:13

Operating system character set identified as UTF-8.

 

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

 

7.把原版本的相關目錄複製到新版本下

[ggt@001 goldengate]$

cp -R /home/ggt/goldengate11.2/dirchk/ .

cp -R /home/ggt/goldengate11.2/dirdat/ .

cp -R /home/ggt/goldengate11.2/dirdef/ .

cp -R /home/ggt/goldengate11.2/dirpcs/ .

cp -R /home/ggt/goldengate11.2/dirprm/ .

cp -R /home/ggt/goldengate11.2/dirrpt/ .

cp -R /home/ggt/goldengate11.2/dirsql/ .

cp -R /home/ggt/goldengate11.2/dirtmp/ .

cp -R /home/ggt/goldengate11.2/BR/ .

 

8.升級複製進程的checkpointtable

GGSCI (001.oracle.drs.dc.com) 20> dblogin userid ggt@mpaysoa_kx, password  pwd

Successfully logged into database.

GGSCI (001.oracle.drs.dc.com) 22> upgrade checkpointtable chk_mpayb2p

 

Successfully upgraded checkpoint table chk_mpayb2p.

 

注意:這一步必須作,不然這報如下錯:

2016-05-05 16:31:56  ERROR   OGG-00868  OCI Error ORA-00904: "LOG_BSN": invalid identifier (status = 904). Updating checkpoint table chk_mpay

b2p, group REPMPB2P, key 169,822,320 (0x000000000a1f4870), SQL <UPDATE chk_mpayb2p SET last_update_ts = sysdate, seqno = :seqno, rba = :rba,

audit_ts = :audit_ts, log_bsn = :log_bsn, log_csn = :log_csn, log_xid = :log_xid, log_cmplt_csn = :log_cmplt_csn, log_cmplt_xids = :log_cmplt

_xids, version = :version WHERE group_name = :group_name AND group_key  = :key>.

 

9.啓動管理進程

GGSCI (001.oracle.drs.dc.com) 23>start mgr

 

10.啓動抽取進程

注意:啓動以前,要修改trail文件的格式或把trail的序號向前滾一個序號,不然會報如下錯:

ERROR   OGG-01416  File ./dirdat/lt000005, with format RELEASE 11.2, does not match current format specification of RELEASE 12.1. Modify the parameter file to specify format RELEASE 11.2 or issue ETROLLOVER prior to restart.

 

方法一:修改trail文件的格式方法:把開參數文件,在exttrail ./dirdat/sj01/ex後面加上FORMAT RELEASE 11.2

GGSCI (001.oracle.drs.dc.com) 23>edit params extsj01

修改exttrail ./dirdat/sj01/ex爲exttrail ./dirdat/sj01/ex, FORMAT RELEASE 11.2

 

方法二:trail的序號向前滾一個序號

GGSCI (001.oracle.drs.dc.com) 262> alter extsj01,etrollover

 

2016-05-05 10:14:51  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.

EXTRACT altered.

 

啓動抽取進程

GGSCI (001.oracle.drs.dc.com) 262>start extsj01

 

11.啓動投遞進程

若是在第10步用方法一的話,直接啓動投遞進程和複製進程就能夠了,若是用方法二必須執行如下操做

11.1 記錄投遞進程的讀寫檢查點

GGSCI (001.oracle.drs.dc.com) 258> info PUPMPBK2,showch

 

EXTRACT    PUPMPBK2  Last Started 2016-05-05 10:01   Status ABENDED

Checkpoint Lag       00:44:46 (updated 00:00:21 ago)

Log Read Checkpoint  File /home/ggt/goldengate/dirdat/sj01/ex194468

                     2016-05-05 09:16:27.000000  RBA 2244115

 

 

Current Checkpoint Detail:

 

Read Checkpoint #1

 

  GGS Log Trail

 

  Startup Checkpoint (starting position in the data source):

    Sequence #: 194468

    RBA: 2244115

    Timestamp: 2016-05-05 09:16:27.000000

    Extract Trail: /home/ggt/goldengate/dirdat/sj01/ex

 

  Current Checkpoint (position of last record read in the data source):

    Sequence #: 194468

    RBA: 2244115

    Timestamp: 2016-05-05 09:16:27.000000

    Extract Trail: /home/ggt/goldengate/dirdat/sj01/ex

 

Write Checkpoint #1

 

  GGS Log Trail

 

  Current Checkpoint (current write position):

    Sequence #: 6184

    RBA: 36936583

    Timestamp: 2016-05-05 09:16:30.784940

    Extract Trail: /home/ggt/goldengate/dirdat/repmpaybak/re

    Trail Type: RMTTRAIL

 

Header:

  Version = 2

  Record Source = A

  Type = 1

  # Input Checkpoints = 1

  # Output Checkpoints = 1

 

File Information:

  Block Size = 2048

  Max Blocks = 100

  Record Length = 2048

  Current Offset = 0

 

Configuration:

  Data Source = 0

  Transaction Integrity = 1

  Task Type = 0

 

Status:

  Start Time = 2016-05-05 10:01:08

  Last Update Time = 2016-05-05 10:01:13

  Stop Status = A

  Last Result = 0

 

11.2 修改Read Checkpoint和Write Checkpoint

GGSCI (001.oracle.drs.dc.com) 262> alter PUPMPBK2,etrollover

 

2016-05-05 10:14:51  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.

EXTRACT altered.

 

GGSCI (001.oracle.drs.dc.com) 262>   alter PUPMPBK2,extseqno 194469 extrba 0

注意:extseqno 194469是在Read Checkpoint的Sequence #: 194468加1,由於在抽取進程上用etrollover向前滾了一個序號

 

GGSCI (001.oracle.drs.dc.com) 262>start PUPMPBK2

11.3啓動投遞進程

GGSCI (001.oracle.drs.dc.com) 262>start PUPMPBK2

 

12. 啓動複製進程

12.1查看複製進程的加載位置

GGSCI (001.oracle.drs.dc.com) 21> info REPMPB2P,showch

 

REPLICAT   REPMPB2P  Last Started 2016-05-05 16:31   Status ABENDED

Checkpoint Lag       00:00:00 (updated 00:04:42 ago)

Log Read Checkpoint  File ./dirdat/repmpb2p/re000083

                     First Record  RBA 0

 

 

Current Checkpoint Detail:

 

Read Checkpoint #1

 

  GGS Log Trail

 

  Startup Checkpoint (starting position in the data source):

   Sequence #: 6184

    RBA: 36936583

    Timestamp: Not Available

    Extract Trail: ./dirdat/repmpb2p/re

 

  Current Checkpoint (position of last record read in the data source):

   Sequence #: 6184

    RBA: 36936583

    Timestamp: Not Available

    Extract Trail: ./dirdat/repmpb2p/re

12.2修改複製進程的Sequence #和RBA

GGSCI (001.oracle.drs.dc.com) 22>alter REPMPB2P extseqno 6185 extrba 0

注意:extseqno 6185是在Current Checkpoint的Sequence #: 6184加1,由於在投遞進程上用etrollover向前滾了一個序號

 

 

12.3 啓動複製進程

GGSCI (001.oracle.drs.dc.com) 22>start REPMPB2P

 

13 升級完成

恭喜你,至此你已成功完成goldengate的11g到12c的升級

相關文章
相關標籤/搜索