Oracle Golden Gate 安裝指南

Jujay發表於2011-10-11
作業系統版本:
[gdcul3308 /desf04/esf/gguser]$ uname -a
Linux gdcul3308 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
資料庫版本: 單節點
SYS@O02ESF1>select * from v$version where rownum<2;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
在開始安裝前,要確保作業系統中已存在gguser這個id。
1. 下載GG軟體包
到 http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html 下載相應作業系統的GG軟體包,對應Linux系統的軟體包如下:
ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar [Linux]
2. 解壓GG軟體包
把下載的軟體包放在$GG_HOME目錄下,然後:
[gdcul3308 /desf04/esf/gguser]$ setenv $GG_HOME /desf04/esf/gguser
[gdcul3308 /desf04/esf/gguser]$ cd $GG_HOME
[gdcul3308 /desf04/esf/gguser]$ pbrun -u gguser tar -xvof  ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
3. 設定GG的環境變數
setenv ORACLE_HOME /desf02/esf/oracle/rdbms/dbh_11202_00
setenv ORACLE_SID O02ESF1
setenv ORACLE_BASE /desf02/esf/oracle
setenv PATH /desf02/esf/oracle/rdbms/dbh_11202_00/bin:$PATH
setenv TNS_ADMIN $ORACLE_HOME/network/admin
setenv LD_LIBRARY_PATH /desf04/esf/gguser/:$ORACLE_HOME/lib
setenv USERLIB $LD_LIBRARY_PATH
4. 建立GG檔案目錄
[gdcul3308 /desf04/esf/gguser]$ cd $GG_HOME
[gdcul3308 /desf04/esf/gguser]$ pbrun -u gguser ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.0.0 Build 078
Linux, x64, 64bit (optimized), Oracle 11 on Jul 28 2010 13:13:42

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

GGSCI (gdcul3308) 2> create subdirs

Creating subdirectories under current directory /desf04/esf/gguser

Parameter files                /desf04/esf/gguser/dirprm: created
Report files                   /desf04/esf/gguser/dirrpt: created
Checkpoint files               /desf04/esf/gguser/dirchk: created
Process status files           /desf04/esf/gguser/dirpcs: created
SQL script. files               /desf04/esf/gguser/dirsql: created
Database definitions files     /desf04/esf/gguser/dirdef: created
Extract data files             /desf04/esf/gguser/dirdat: created
Temporary files                /desf04/esf/gguser/dirtmp: created
Veridata files                 /desf04/esf/gguser/dirver: created
Veridata Lock files            /desf04/esf/gguser/dirver/lock: created
Veridata Out-Of-Sync files     /desf04/esf/gguser/dirver/oos: created
Veridata Out-Of-Sync XML files /desf04/esf/gguser/dirver/oosxml: created
Veridata Parameter files       /desf04/esf/gguser/dirver/params: created
Veridata Report files          /desf04/esf/gguser/dirver/report: created
Veridata Status files          /desf04/esf/gguser/dirver/status: created
Veridata Trace files           /desf04/esf/gguser/dirver/trace: created
Stdout files                   /desf04/esf/gguser/dirout: created
5. 建立gguser schema
以sysdba登陸資料庫,首先建立tablespace GG_TBS,用於存放gguser使用者資料:
CREATE TABLESPACE "GG_TBS"
DATAFILE '/desf02/esf/o02esf1starter/gg_tbs.O02ESF1' SIZE 200M
LOGGING ONLINE PERMANENT BLOCKSIZE 8K
EXTENT MANAGEMENT LOCAL UNIFORM. SIZE 128K DEFAULT NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO;
接著建立gguser使用者,密碼為gguser1:
CREATE USER GGUSER IDENTIFIED BY gguser1
DEFAULT TABLESPACE GG_TBS
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
QUOTA UNLIMITED ON GG_TBS;
最後把相應許可權賦給gguser:
GRANT EXECUTE ON UTL_FILE TO GGUSER;
GRANT DBA, CONNECT, RESOURCE to GGUSER;
6. 建立密碼加密檔案
cd $GG_HOME
pbrun –u gguser ./ggsci ENCRYPT PASSWORD gguser1
得到加密後的密碼gguser1為 AACAAAAAAAAAAAHAJIBENEGDMADEQGTH
7. 建立引數檔案auth_include.prm 用於將來的extract和replicat登陸資料庫
cd $GG_HOME
cd dirprm
pbrun -u gguser vi auth_include.prm
userid gguser, PASSWORD AACAAAAAAAAAAAHAJIBENEGDMADEQGTH, ENCRYPTKEY DEFAULT
8. 禁用recycle bin
對於11g: 需要重啟才能生效
ALTER SYSTEM SET recyclebin = OFF scope=spfile;
對於10g:
Alter system set recyclebin=off;
9. 編輯GLOBALS檔案
cd $GG_HOME
pbrun -u gguser vi GLOBALS
GGSCHEMA gguser
10.執行marker_setup指令碼
GGUSER@O02ESF1>@marker_setup.sql

Marker setup script

You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:gguser


Marker setup table script. complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGUSER

MARKER TABLE
-------------------------------
OK

MARKER SEQUENCE
-------------------------------
OK

Script. complete.
11. 執行ddl_setup指令碼
SYS@O02ESF1>@ddl_setup

GoldenGate DDL Replication setup script

Verifying that current user has privileges to install DDL Replication...
Checking user sessions...

Check complete.



You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:gguser

You will be prompted for the mode of installation.
To install or reinstall DDL replication, enter INITIALSETUP
To upgrade DDL replication, enter NORMAL
Enter mode of installation:INITIALSETUP

Working, please wait ...
Spooling to file ddl_setup_spool.txt


Using GGUSER as a GoldenGate schema name, INITIALSETUP as a mode of installation.

Working, please wait ...

DDL replication setup script. complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGUSER

DDLORA_GETTABLESPACESIZE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

CLEAR_TRACE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

CREATE_TRACE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

TRACE_PUT_LINE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

INITIAL_SETUP STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

DDLVERSIONSPECIFIC PACKAGE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

DDLREPLICATION PACKAGE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

DDLREPLICATION PACKAGE BODY STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

DDL HISTORY TABLE
-----------------------------------
OK

DDL HISTORY TABLE(1)
-----------------------------------
OK

DDL DUMP TABLES
-----------------------------------
OK

DDL DUMP COLUMNS
-----------------------------------
OK

DDL DUMP LOG GROUPS
-----------------------------------
OK

DDL DUMP PARTITIONS
-----------------------------------
OK

DDL DUMP PRIMARY KEYS
-----------------------------------
OK

DDL SEQUENCE
-----------------------------------
OK

GGS_TEMP_COLS
-----------------------------------
OK

GGS_TEMP_UK
-----------------------------------
OK

DDL TRIGGER CODE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
No errors                                No errors

DDL TRIGGER INSTALL STATUS
-----------------------------------
OK

DDL TRIGGER RUNNING STATUS
------------------------------------------------------------------------------------------------------------------------
ENABLED

STAYMETADATA IN TRIGGER
------------------------------------------------------------------------------------------------------------------------
OFF

DDL TRIGGER SQL TRACING
------------------------------------------------------------------------------------------------------------------------
0

DDL TRIGGER TRACE LEVEL
------------------------------------------------------------------------------------------------------------------------
0

LOCATION OF DDL TRACE FILE
------------------------------------------------------------------------------------------------------------------------
/desf02/esf/oracle/diag/rdbms/o02esf1/O02ESF1/trace/ggs_ddl_trace.log

Analyzing installation status...


STATUS OF DDL REPLICATION
------------------------------------------------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components

Script. complete.
12. 執行role_setup指令碼
SYS@O02ESF1>@role_setup

GGS Role setup script

This script. will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script. and then edit the params.sql script. to change the gg_role parameter to the preferred name. (Do not run the script.)

You will be prompted for the name of a schema for the GoldenGate database object
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:gguser
SP2-0606: Cannot create SPOOL file "role_setup_spool.txt"
SP2-0606: Cannot create STORE file "role_setup_set.txt"

PL/SQL procedure successfully completed.


Role setup script. complete

Grant this role to each user assigned to the Extract, GGSCI, and Manager process

GRANT GGS_GGSUSER_ROLE TO

where is the user assigned to the GoldenGate processes.
13. 執行ddl_enable指令碼
SYS@O02ESF1>@ddl_enable

Trigger altered.

14. 執行ddl_pin指令碼
SYS@O02ESF1>@ddl_pin.sql gguser

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

15. 修改資料庫引數
SYS@O02ESF1>alter database force logging;

Database altered.

SYS@O02ESF1>ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

Database altered.

SYS@O02ESF1>archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /desf02/esf/o02esf1dump/arch
Oldest online log sequence     9
Next log sequence to archive   11
Current log sequence           11
16. 配置manager
cd $GG_HOME/dirprm
pbrun -u gguser vi mgr.prm

--port that manager runs on
port 7909

--Forces manager to restart extract, datapump and replicat if they shut down
AUTORESTART ER *, RETRIES 12, WAITMINUTES 5, RESETMINUTES 60

--Manages trail files to conserve space
PURGEOLDEXTRACTS ./dirdat/O02ESF1/*, USECHECKPOINTS, MINKEEPFILES 10, FREQUENCYMINUTES 15

--Specifies to log the lag time as a warning in the event log
LAGCRITICALMINUTES 5

--Specifies how often to report lag info to the event log
LAGREPORTMINUTES 60
LAGINFOMINUTES 0
17.啟動manager
GGSCI (gdcul3308) 1> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     STOPPED


GGSCI (gdcul3308) 2> start manager

Manager started.

GGSCI (gdcul3308) 5> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING





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

相關文章