ITPub博客

首页 > 数据库 > Oracle > GoldenGate For Oracle10.2 .0.4  RAC and ASM (一) single

GoldenGate For Oracle10.2 .0.4  RAC and ASM (一) single

Oracle 作者:mysfxylh 时间:2014-01-25 20:26:55 0 删除 编辑

一、安装环境:

源数据库

192.168.0.46/192.168.0.47(RAC)ASM文件系统

AIX 6100-06

Oracle 10.2.0.4

目标数据库

AIX 6100-07

192.168.0.45

Oracle 10.2.0.1

二、安装(安装之前的准备工作):

(一)源端配置:

# lspv

hdisk0          00f6d4cd7f5995e2                    rootvg          active

hdisk1          00f631903f95d6bb                    rootvg          active

hdisk2          00f6d4cdd451e3e1                    orasoftvg       active

hdisk3          00f6d4cdd4522c8b                    orasoftvg       active

hdisk13         none                                None            

hdisk14         none                                None            

hdisk15         none                                None            

hdisk16         none                                None            

hdisk17         none                                None            

hdisk18         none                                None            

hdisk19         none                                None            

# lsvg orasoftvg

VOLUME GROUP:       orasoftvg                VG IDENTIFIER:  00f6d4cd00004c00000001360f8aa8c2

VG STATE:           active                   PP SIZE:        256 megabyte(s)

VG PERMISSION:      read/write               TOTAL PPs:      1092 (279552 megabytes)

MAX LVs:            256                      FREE PPs:       1011 (258816 megabytes)

LVs:                2                        USED PPs:       81 (20736 megabytes)

OPEN LVs:           2                        QUORUM:         2 (Enabled)

TOTAL PVs:          2                        VG DESCRIPTORS: 3

STALE PVs:          0                        STALE PPs:      0

ACTIVE PVs:         2                        AUTO ON:        yes

MAX PPs per VG:     32768                    MAX PVs:        1024

LTG size (Dynamic): 1024 kilobyte(s)         AUTO SYNC:      no

HOT SPARE:          no                       BB POLICY:      relocatable 

PV RESTRICTION:     none                                      

# df -g              

Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on

/dev/hd4           8.00      7.78    3%    11066     1% /

/dev/hd2          16.00     13.72   15%    49589     2% /usr

/dev/hd9var       16.00      4.08   75%    21422     3% /var

/dev/hd3           8.00      5.92   26%    26539     2% /tmp

/dev/hd1           8.00      7.26   10%      341     1% /home

/dev/hd11admin      0.25      0.25    1%        5     1% /admin

/proc                 -         -    -         -     -  /proc

/dev/hd10opt       8.00      7.32    9%    11711     1% /opt

/dev/livedump      0.25      0.25    1%        4     1% /var/adm/ras/livedump

/dev/orasoftlv     20.00      3.99   81%    42951     5% /database

# lspv

hdisk0          00f6d4cd7f5995e2                    rootvg          active

hdisk1          00f631903f95d6bb                    rootvg          active

hdisk2          00f6d4cdd451e3e1                    orasoftvg       active

hdisk3          00f6d4cdd4522c8b                    orasoftvg       active

hdisk13         none                                None            

hdisk14         none                                None            

hdisk15         none                                None            

hdisk16         none                                None            

hdisk17         none                                None            

hdisk18         none                                None            

hdisk19         none                                None            

# lsdev -Cc disk

hdisk0  Available 00-08-00 SAS Disk Drive

hdisk1  Available 00-08-00 SAS Disk Drive

hdisk2  Available 00-08-00 SAS Disk Drive

hdisk3  Available 00-08-00 SAS Disk Drive

hdisk4  Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk5  Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk6  Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk7  Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk8  Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk9  Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk10 Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk11 Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk12 Defined   06-00-01 MPIO Other FC SCSI Disk Drive

hdisk13 Available 05-00-01 MPIO Other FC SCSI Disk Drive

hdisk14 Available 05-00-01 MPIO Other FC SCSI Disk Drive

hdisk15 Available 05-00-01 MPIO Other FC SCSI Disk Drive

hdisk16 Available 05-00-01 MPIO Other FC SCSI Disk Drive

hdisk17 Available 05-00-01 MPIO Other FC SCSI Disk Drive

hdisk18 Available 05-00-01 MPIO Other FC SCSI Disk Drive

hdisk19 Available 05-00-01 MPIO Other FC SCSI Disk Drive

扩展本地文件系统:

# chfs -a size=200G /database

0516-787 extendlv: Maximum allocation for logical volume orasoftlv

        is 512.

Smitty chlv

                           Change a Logical Volume


Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[TOP]                                                   [Entry Fields]

* Logical volume NAME                                 orasoftlv

  Logical volume TYPE                                [jfs2]                  +

  POSITION on physical volume                         middle                 +

  RANGE of physical volumes                           minimum                +

  MAXIMUM NUMBER of PHYSICAL VOLUMES                 [1024]                   #

    to use for allocation

  Allocate each logical partition copy                yes                    +

    on a SEPARATE physical volume?

  RELOCATE the logical volume during                  yes                    +

    reorganization?

  Logical volume LABEL                               [/database]

  MAXIMUM NUMBER of LOGICAL PARTITIONS               [512]                    #

  SCHEDULING POLICY for writing/reading               parallel               +

[MORE...9]

更改为1024

# chfs -a size=200G /database

Filesystem size changed to 419430400

# su – oracle

在安装GG之前,必须确保满足以下几个条件:

在配置GoldenGate之前,还需要对数据库进行一些特殊的设置,以下一一说明。 

Ø调整归档模式 

GoldenGate的原理是基于对日志变化的捕获(CDC)。所以Oracle的redo对于GoldenGate至关重要。为了保证GoldenGate能读取到完整的事务日志,必须打开归档。 

在数据库负载较大的情况下,redo会频繁切换日志组,我们知道,Redo日志组在Oracle中有限且会被重复利用的。如果打开归档,被切换过的redo log就会被归档为archive log,这样即使一个事务过长,等到提交的时候,部分可能已经归档,这时GoldenGate就会到archive log中查找对应的记录,从而保证了信息的完整性。 

Oracle打开归档较简单:首先,在使用sysdba用户登录在

SQLPLUS下执行以下命令,确认归档是否已经开启: 

SQL>archive log list;                                      

查看Database log mode字段的值,如果是No Archive Mode,则表示没有开归档。这时如果要开启归档,则需要先关闭数据库,然后启动到startup mount状态,再打开归档: 

SQL>shutdown immediate;                                  

SQL>startup mount;                                       

SQL>alter database archivelog;    

ØEnabling FORCELOGGING

Perform the following steps to put the database in forced logging mode. This mode 

overrides all tablespace and segment settings, ensuring that all transactions and loads re logged so that no source data in the Extract configuration gets missed.

1. Log in to SQL*Plus as a user with ALTER SYSTEM privilege, and then issue the following command to determine whether the database is in forced logging mode. 

If the result is YES, forced logging is enabled and meets the Oracle GoldenGate  requirement. If the result is NO, continue with these steps to enable forced logging.

SELECT force_logging FROM v$database;

2. Enable forced logging.

ALTER DATABASE FORCE LOGGING;

3. Verify that forced logging is enabled.

SELECT force_logging FROM v$database;

The output must be YES. This statement can take a considerable time for completion, because it waits for all unlogged direct writes to complete. After the command completes, go to the next step to switch log files. 

4. Switch the log files.

ALTER SYSTEM SWITCH LOGFILE;

Ø 打开数据库级别的补充日志(supplemental log)      

当数据库启用了Supplemental Logging之后,对于修改操作,Oracle就会同时附加一些能够唯一标识修改记录的列到redo log中,如果这个表是有主键或唯一键的表,只需要附加主键或唯一键的信息即可,这样生成的redo日志量是最少的,如果某些表可能无法创建主键或者唯一键,抑或数据表本来不存在主键/唯一键,这种情况下Oracle会将所有列都做为附加信息记录到redo中,那么redo就可能增长很快,同时对性能产生较大的负面影响。 所以Oracle 建议所有需要复制的表都存在主键或者唯一键。 

Supplemental Logging可以在数据库级设置,也可以精确到表级设置,对于数据库级有两种类型:minimal logging和identification key logging,其主要区别就在于写入redolog中的数据详尽程度不同。 

从上述分析可以得出:GoldenGate要准确的知道源端的数据修改了哪些列,就需要更为详细的日志信息,所以需要数据库开启supplemental log。 可以按照下列方式打开数据库级别的supplemental log。 首先确认数据库是否开启了supplemental log, 如果没有则开启, 操作如下:  

注意:对于操作 

SELECT supplemental_log_data_min FROM v$database; 

如果结果返回YES或IMPLICIT则说明已开启最小补全日志,另外如果使用ALL,PRIMARY,UNIQUE 或FOREIGN补全日志时,最小补全日志会默认开启(即检查结果为IMPLICIT)。 

1、 创建GoldenGate系统用户,根据官方文档中的描述最好直接使用oracle用户进行安装配置。

2、 在数据库中创建GoldenGate数据库用户,至少包含connect,resource,select any dictionary,select any table权限。

如果在Oracle 10g ASM处于运行状态,在ASM实例中你必须使用sys用户以sysdba的身份进行访问,Because GG不支持使用操作系统用户访问ASM实例。

4.创建GOLDENGATE用户

源端:

SQL> create tablespace goldengate datafile '+ASMDATA/orcl/datafile/ogg01.dbf' size 500m;

Tablespace created.

SQL> create user goldengate identified by goldengate default tablespace goldengate;

User created.

SQL> grant dba to goldengate;

Grant succeeded.

3、数据库处于归档模式。

4、强制日志

SQL> select force_logging from v$database;

FOR

---

NO

SQL> alter database force logging;

Database altered.

SQL> select force_logging from v$database;

FOR

---

YES

5、检查源端数据库是否打开附加日志。

SQL> select SUPPLEMENTAL_LOG_DATA_MIN from v$database;

SUPPLEME

--------

NO

SQL> alter database add supplemental log data;

Database altered.

SQL>  select SUPPLEMENTAL_LOG_DATA_MIN from v$database;

SUPPLEME

--------

YES

SQL> alter system archive log current;

System altered.

Ø 关闭recyclebin 

在GoldenGate10中如果要使用DDL复制,则必须先关闭回收站。本实验不需要DDL支持,不需要配置。另外recyclebin在10.1和10.2中关闭的方式稍微有所不同。 Recyclebin 在10.1中是隐含参数,本实验中用到的数据库是10.1版本的,

所以关掉recyclebin的命令为: 

SQL>ALTER SYSTEM SET “_recyclebin” = false; 

如果数据库的版本为10.2,则只执行的命令是: 

SQL>ALTER SYSTEM SET recyclebin=OFF; 

另外在最新的GoldenGate11g中即使使用其DDL复制的功能不需要关闭recyclebin了。 

8. 源库关闭回收站。

SQL> show parameter recyclebin

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

recyclebin                           string      on

SQL> alter system set recyclebin=off;

System altered.

SQL> show parameter recyclebin

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

recyclebin                           string      OFF

9.  保证字符集一致。

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')

----------------------------------------------------

AMERICAN_CHINA.ZHS16GBK

SQL> select * from nls_database_parameters;

PARAMETER                      VALUE

------------------------------ --------------------------------------------------

NLS_LANGUAGE                   AMERICAN

NLS_TERRITORY                  AMERICA

NLS_CURRENCY                   $

NLS_ISO_CURRENCY               AMERICA

NLS_NUMERIC_CHARACTERS         .,

NLS_CHARACTERSET               ZHS16GBK

NLS_CALENDAR                   GREGORIAN

NLS_DATE_FORMAT                DD-MON-RR

NLS_DATE_LANGUAGE              AMERICAN

NLS_SORT                       BINARY

NLS_TIME_FORMAT                HH.MI.SSXFF AM

PARAMETER                      VALUE

------------------------------ --------------------------------------------------

NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM

NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR

NLS_DUAL_CURRENCY              $

NLS_COMP                       BINARY

NLS_LENGTH_SEMANTICS           BYTE

NLS_NCHAR_CONV_EXCP            FALSE

NLS_NCHAR_CHARACTERSET         UTF8

NLS_RDBMS_VERSION              10.2.0.4.0

20 rows selected.

10. UNDO设置

SQL> alter system set undo_retention=86400;

6、如果数据文件是存放在ASM中,则还必须将ASM实例静态注册到监听器中,否则,在后续实验过程中会失败的。Listern.ora和tnsname.ora文件内容如下:

listen.ora内容如下:

SID_LIST_LISTENER_ORCL_NODE2 =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PLSExtProc)

      (ORACLE_HOME = /database/product/10.2.0/db_1)

      (PROGRAM = extproc)

     )

     (SID_DESC =

      (GLOBAL_NAME = ASM)

      (ORACLE_HOME = /database/product/10.2.0/db_1)

      (SID_NAME = +ASM2)

     )

 

tnsname.ora内容如下:

ASM1 =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))

      (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = ASM)

      (INSTANCE_NAME = +ASM1)

      (UR=A) ----允许远程调用,这个必须有,否则ASM实例不连接。

     )

  )

ASM2 =

   (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))

         (CONNECT_DATA =

         (SERVER = DEDICATED)

         (SERVICE_NAME = ASM)

         (INSTANCE_NAME = +ASM2)

         (UR=A)

      )

   )

EXTPROC_CONNECTION_DATA =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

    )

    (CONNECT_DATA =

      (SID = PLSExtProc)

      (PRESENTATION = RO)

    )

  )

测试配置:

$ export ORACLE_SID=+ASM2

$ sqlplus /nolog

SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jan 21 10:41:12 2014

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

SQL> conn sys@asm2 as sysdba

Enter password:

用oracle用户登录,创建/database/ogg文件夹,将ogg压缩包拷贝到此文件夹下并解压缩。

上传ggs_AIX_ppc_ora10.2_64bit.tar

7、设置GG用户的环境变量:

由于这里直接使用的是oracle用户,之前已经设置好了环境变量,检查下述变量是否正确配置:

8、设置library paths for dynamic builds:

操作系统的不同,共享库的名称也不同,详见下图:

9、设置环境变量

export ORACLE_BASE=/database

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export CRS_HOME=$ORACLE_BASE/product/10.2.0/crs

export ORACLE_SID=orcl2

export PATH=$PATH:$ORACLE_HOME/bin:.:/usr/local/bin:$CRS_HOME/bin:/database/ogg:$PATH

export LIBPATH=$ORACLE_HOME/lib:/database/ogg:$LIBPATH

$cd /database/ogg

$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230

AIX 5L, ppc, 64bit (optimized), Oracle 10.2 on Apr 23 2012 07:27:46

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

GGSCI (node2) 1> 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, REGISTER, SEND, START, STATS, STATUS, STOP 

                 UNREGISTER 

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 

SCHEMATRANDATA   ADD, DELETE, INFO 

CHECKPOINTTABLE  ADD, DELETE, CLEANUP, INFO 

Commands without an object: 

(Database)       DBLOGIN, LIST TABLES, ENCRYPT PASSWORD, FLUSH SEQUENCE 

                 MININGDBLOGIN 

(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 .

Example: HELP ADD REPLICAT

GGSCI (node2) 2> create subdirs

Creating subdirectories under current directory /database/ogg

Parameter files                /database/ogg/dirprm: already exists

Report files                   /database/ogg/dirrpt: created

Checkpoint files               /database/ogg/dirchk: created

Process status files           /database/ogg/dirpcs: created

SQL script files               /database/ogg/dirsql: created

Database definitions files     /database/ogg/dirdef: created

Extract data files             /database/ogg/dirdat: created

Temporary files                /database/ogg/dirtmp: created

Stdout files                   /database/ogg/dirout: created

GGSCI (node2) 3> quit

$ ls -l |grep dir

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirchk

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirdat

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirdef

drwxr-x---    2 oracle   oinstall       4096 Apr 23 2012  dirjar

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirout

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirpcs

drwxr-x---    2 oracle   oinstall        256 Apr 23 2012  dirprm

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirrpt

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirsql

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 10:06 dirtmp

$ mkdir trails

介绍其中一些比较重要的目录: 

1、dirchk:用来存放检查点(Checkpoint)文件 

2、dirdat:用来存放Trail文件,以后详述; 

3、dirdef:用来存放通过DEFGEN工具生成的源或目标端数据定义文件; 

4、dirpcs:用来存放进程状态文件 

5、dirprm:用来存放配置参数文件 

6、dirrpt:用来存放进程报告文件 

7、dirsql:用来存放SQL脚本文件 

8、dirtmp:当事务所需要的内存超过已分配内存时,缺省存储在这个目录。  

SQL> show parameter recyclebin

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

recyclebin                           string      on

SQL> alter system set recyclebin=off;

System altered.

SQL> show parameter recyclebin

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

recyclebin                           string      OFF

9.  保证字符集一致。

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')

----------------------------------------------------

AMERICAN_CHINA.ZHS16GBK

SQL> select * from nls_database_parameters;

PARAMETER                      VALUE

------------------------------ --------------------------------------------------

NLS_LANGUAGE                   AMERICAN

NLS_TERRITORY                  AMERICA

NLS_CURRENCY                   $

NLS_ISO_CURRENCY               AMERICA

NLS_NUMERIC_CHARACTERS         .,

NLS_CHARACTERSET               ZHS16GBK

NLS_CALENDAR                   GREGORIAN

NLS_DATE_FORMAT                DD-MON-RR

NLS_DATE_LANGUAGE              AMERICAN

NLS_SORT                       BINARY

NLS_TIME_FORMAT                HH.MI.SSXFF AM

PARAMETER                      VALUE

------------------------------ --------------------------------------------------

NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM

NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR

NLS_DUAL_CURRENCY              $

NLS_COMP                       BINARY

NLS_LENGTH_SEMANTICS           BYTE

NLS_NCHAR_CONV_EXCP            FALSE

NLS_NCHAR_CHARACTERSET         UTF8

NLS_RDBMS_VERSION              10.2.0.4.0

20 rows selected.

10. UNDO设置

SQL> alter system set undo_retention=86400;

Ø 创建GoldenGate 管理用户       

在源端和目标端创建GoldenGate 管理用户,并授予下列权限。 

SQL> create tablespace goldengate datafile '+ASMDATA/orcl/datafile/ogg01.dbf' size 500m;

Tablespace created.

SQL> create user goldengate identified by goldengate default tablespace goldengate;

User created.

SQL> grant dba to goldengate;

Grant succeeded.

11. 安装DDL_OBJETS

SQL> conn / as sysdba

Connected.

SQL> @marker_setup.sql

Marker setup script

You will be prompted for the name of a schema for the Oracle GoldenGate database objects.

NOTE: The schema must be created prior to running this script.

NOTE: Stop all DDL replication before starting this installation.

Enter Oracle GoldenGate schema name:GoldenGate

Marker setup table script complete, running verification script...

Please enter the name of a schema for the GoldenGate database objects:

Setting schema name to GOLDENGATE

MARKER TABLE

-------------------------------

OK

MARKER SEQUENCE

-------------------------------

OK

Script complete.

执行DDL_STEP

SQL> @ddl_setup

Oracle GoldenGate DDL Replication setup script

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

You will be prompted for the name of a schema for the Oracle 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 Oracle GoldenGate schema name:GoldenGate

Working, please wait ...

Spooling to file ddl_setup_spool.txt

Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...

Check complete.

Using GOLDENGATE as a Oracle GoldenGate schema name.

Working, please wait ...

RECYCLEBIN must be empty.

This installation will purge RECYCLEBIN for all users.

To proceed, enter yes. To stop installation, enter no.

Enter yes or no:yes

DDL replication setup script complete, running verification script...

Please enter the name of a schema for the GoldenGate database objects:

Setting schema name to GOLDENGATE

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 IGNORE TABLE

-----------------------------------

OK

DDL IGNORE LOG TABLE

-----------------------------------

OK

DDLAUX  PACKAGE STATUS:

Line/pos             Error

-------------------- -----------------------------------------------------------------

No errors            No errors

DDLAUX PACKAGE BODY STATUS:

Line/pos             Error

-------------------- -----------------------------------------------------------------

No errors            No errors

SYS.DDLCTXINFO  PACKAGE STATUS:

Line/pos             Error

-------------------- -----------------------------------------------------------------

No errors            No errors

SYS.DDLCTXINFO  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

------------------------------------------------------------------------------------------------------------------------

/database/admin/orcl/udump/ggs_ddl_trace.log

Analyzing installation status...

STATUS OF DDL REPLICATION

------------------------------------------------------------------------------------------------------------------------

SUCCESSFUL installation of DDL Replication software components

Script complete.

执行ROLE_SETUP

SQL> @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 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:GoldenGate

Wrote 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 processes, by using the following SQL command:

GRANT GGS_GGSUSER_ROLE TO

where is the user assigned to the GoldenGate processes.

将此角色给GOLDENGATE用户。

SQL> grant ggs_ggsuser_role to goldengate;

Grant succeeded.

开启DDL

SQL> @ddl_enable

Trigger altered.

安装性能优化包。

SQL> @?/rdbms/admin/dbmspool

Package created.

Grant succeeded.

View created.

Package body created.

ddl_pin将触发器用到的plsql包放进内存中

SQL> @ddl_pin goldengate

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

(二)目标端配置

配置多路径软件:

1、查看磁盘信息

# lspv

hdisk0          00f82d5deb858922                    rootvg          active              

hdisk1          00f82d5d06858c37                    rootvg          active              

hdisk2          00f82d5d0227b9ff                    None                                

hdisk3          00f82d5db55fd9bc                    None                                

hdisk4          none                                None                                

hdisk5          none                                None                                

hdisk6          none                                None                                

hdisk7          none                                None                                

hdisk8          none                                None                                

hdisk9          none                                None                                

hdisk10         none                                None                                

hdisk11         none                                None                                

hdisk12         none                                None                                

hdisk13         none                                None                                

hdisk14         none                                None                                

hdisk15         none                                None                                

# lspath

Enabled hdisk0 sas0

Enabled hdisk1 sas0

Enabled hdisk2 sas0

Enabled hdisk3 sas0

2、删除操作系统已经识别到的IFT/fcp磁盘

逐一删除:

# rmdev -dl hdisk4

hdisk4 deleted

# rmdev -dl hdisk5

hdisk5 deleted

# rmdev -dl hdisk6

hdisk6 deleted

# rmdev -dl hdisk7

hdisk7 deleted

# rmdev -dl hdisk8

hdisk8 deleted

# rmdev -dl hdisk9

hdisk9 deleted

# rmdev -dl hdisk10

hdisk10 deleted

# rmdev -dl hdisk11

hdisk11 deleted

# rmdev -dl hdisk12

hdisk12 deleted

# rmdev -dl hdisk13

hdisk13 deleted

# rmdev -dl hdisk14

hdisk14 deleted

# rmdev -dl hdisk15

hdisk15 deleted

# lspv

hdisk0          00f82d5deb858922                    rootvg          active              

hdisk1          00f82d5d06858c37                    rootvg          active              

hdisk2          00f82d5d0227b9ff                    None                                

hdisk3          00f82d5db55fd9bc                    None     

 3、修改fscsi参数

逐一修改fscsi参数:

# chdev -l fscsi0 -a dyntrk=yes -a fc_err_recov=fast_fail -P

fscsi0 changed

# chdev -l fscsi1 -a dyntrk=yes -a fc_err_recov=fast_fail -P

fscsi1 changed

4、安装IFT MPIO ODM support for aix (附件是mpio.support.for.ift.sh脚本)

# chmod 777 mpio.support.for.ift.sh

# ./mpio.support.for.ift.sh install

MPIO support for IFT has been installed successfully.

Please to run 'bosboot -a' and 'shutdown -Fr' to take the ODM modification effect.

# bosboot -a

bosboot: Boot image is 51228 512 byte blocks.

5. 重启系统

# shutdown -Fr

6. 修改MPIO磁盘参数

逐一修改:

# chdev -l hdisk4 -a reserve_policy=no_reserve

-a hcheck_interval=60

        -a hcheck_cmd=inquiry

        -a algorithm=round_robin

        -a queue_depth=16


hdisk4 changed

# chdev -l hdisk5 -a reserve_policy=no_reserve

-a hcheck_interval=60

        -a hcheck_cmd=inquiry

        -a algorithm=round_robin

        -a queue_depth=16


hdisk5 changed

# chdev -l hdisk6 -a reserve_policy=no_reserve

-a hcheck_interval=60

        -a hcheck_cmd=inquiry

        -a algorithm=round_robin

        -a queue_depth=16

hdisk6 changed

8、配置卷组

# lspv          

hdisk0          00f82d5deb858922                    rootvg          active              

hdisk1          00f82d5d06858c37                    rootvg          active              

hdisk2          00f82d5d0227b9ff                    None                                

hdisk3          00f82d5db55fd9bc                    None                                

hdisk4          none                                None                                

hdisk5          none                                None                                

hdisk6          none                                None                                

# chdev -l hdisk4 -a pv=yes

hdisk4 changed

# chdev -l hdisk5 -a pv=yes

hdisk5 changed

# chdev -l hdisk6 -a pv=yes

hdisk6 changed

# lspv

hdisk0          00f82d5deb858922                    rootvg          active              

hdisk1          00f82d5d06858c37                    rootvg          active              

hdisk2          00f82d5d0227b9ff                    None                                

hdisk3          00f82d5db55fd9bc                    None                                

hdisk4          00f82d5db85c25d6                    None                                

hdisk5          00f82d5db85c407a                    None                                

hdisk6          00f82d5db85c6ba0                    None                     

$smitty vg

新建 oravg、datavg、bakvg

Smitty fs

# df -g

Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on

/dev/hd4           1.00      0.69   31%    11185     7% /

/dev/hd2           6.00      0.22   97%   101575    65% /usr

/dev/hd9var        1.00      0.61   39%     8630     6% /var

/dev/hd3           2.00      1.68   16%     1209     1% /tmp

/dev/hd1          15.00     15.00    1%       13     1% /home

/dev/hd11admin      0.50      0.50    1%        5     1% /admin

/proc                 -         -    -         -     -  /proc

/dev/hd10opt       1.00      0.30   70%    13849    17% /opt

/dev/livedump      0.50      0.50    1%        4     1% /var/adm/ras/livedump

/dev/lv00          0.50      0.48    4%       18     1% /var/adm/csd

/dev/fslv00      500.00    499.92    1%        4     1% /oradata

/dev/fslv01      400.00    399.94    1%        4     1% /orabak

/dev/oraclelv     50.00     26.09   48%    22007     1% /oracle

/dev/fslv02      300.00    299.95    1%        4     1% /orasoft

# chown -R oracle:oinstall /orasoft

# chmod 755 /orasoft

# chown -R oracle:oinstall /orabak

# chmod 755 /orabak

# chown -R oracle:oinstall /oradata

# chmod 755 /oradata

#su – oracle

用oracle用户登录,创建/orasoft/ogg文件夹,将ogg压缩包拷贝到此文件夹下并解压缩。

上传ggs_AIX_ppc_ora10.2_64bit.tar

6、设置GG用户的环境变量:

  由于这里直接使用的是oracle用户,之前已经设置好了环境变量,检查下述变量是否正确配置:

2、设置library paths for dynamic builds:

操作系统的不同,共享库的名称也不同,详见下图:

7、设置环境变量

export ORACLE_BASE=/oracle

export ORACLE_HOME=$ORACLE_BASE/app/product/10.2.0

export ORACLE_SID=orcl

export ORACLE_TERM=xterm

export PATH=$ORACLE_HOME/bin:$PATH:/orasoft/ogg:$PATH:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/x11:/sbin:.:/usr/java5

_64/jre

export LIBPATH=$ORACLE_HOME/lib:/orasoft/ogg:$LIBPATH

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

8、安装

$ tar -xvf ggs_AIX_ppc_ora10.2_64bit.tar

$ cd /oracle/app/ogg

$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230

AIX 5L, ppc, 64bit (optimized), Oracle 10.2 on Apr 23 2012 07:27:46

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

GGSCI (node3) 1> 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, REGISTER, SEND, START, STATS, STATUS, STOP 

                 UNREGISTER 

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 

SCHEMATRANDATA   ADD, DELETE, INFO 

CHECKPOINTTABLE  ADD, DELETE, CLEANUP, INFO 

Commands without an object: 

(Database)       DBLOGIN, LIST TABLES, ENCRYPT PASSWORD, FLUSH SEQUENCE 

                 MININGDBLOGIN 

(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 .

Example: HELP ADD REPLICAT

GGSCI (node3) 2> create subdirs

Creating subdirectories under current directory /oracle/app/ogg

Parameter files                /oracle/app/ogg/dirprm: already exists

Report files                   /oracle/app/ogg/dirrpt: created

Checkpoint files               /oracle/app/ogg/dirchk: created

Process status files           /oracle/app/ogg/dirpcs: created

SQL script files               /oracle/app/ogg/dirsql: created

Database definitions files     /oracle/app/ogg/dirdef: created

Extract data files             /oracle/app/ogg/dirdat: created

Temporary files                /oracle/app/ogg/dirtmp: created

Stdout files                   /oracle/app/ogg/dirout: created

GGSCI (node3) 3> quit

$ ls -l |grep dir

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirchk

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirdat

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirdef

drwxr-x---    2 oracle   oinstall       4096 Apr 23 2012  dirjar

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirout

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirpcs

drwxr-x---    2 oracle   oinstall        256 Jan 20 13:39 dirprm

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirrpt

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirsql

drwxrwxr-x    2 oracle   oinstall        256 Jan 21 08:38 dirtmp

$ mkdir trails

Ø 创建GoldenGate 管理用户       

目标端创建GoldenGate 管理用户,并授予下列权限。 

SQL> create tablespace goldengate datafile '/oradata/orcl/ogg01.dbf' size 500m;

Tablespace created.

SQL> create user goldengate identified by goldengate default tablespace goldengate;

User created.

SQL> grant dba to goldengate;

Grant succeeded.

11. 安装DDL_OBJETS

SQL> conn / as sysdba

Connected.

SQL> @marker_setup.sql

Marker setup script

You will be prompted for the name of a schema for the Oracle GoldenGate database objects.

NOTE: The schema must be created prior to running this script.

NOTE: Stop all DDL replication before starting this installation.

Enter Oracle GoldenGate schema name:GoldenGate

Marker setup table script complete, running verification script...

Please enter the name of a schema for the GoldenGate database objects:

Setting schema name to GOLDENGATE

MARKER TABLE

-------------------------------

OK

MARKER SEQUENCE

-------------------------------

OK

Script complete.

执行DDL_STEP

SQL> @ddl_setup

Oracle GoldenGate DDL Replication setup script

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

You will be prompted for the name of a schema for the Oracle 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 Oracle GoldenGate schema name:GoldenGate

Working, please wait ...

Spooling to file ddl_setup_spool.txt

Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...

Check complete.

Using GOLDENGATE as a Oracle GoldenGate schema name.

Working, please wait ...

RECYCLEBIN must be empty.

This installation will purge RECYCLEBIN for all users.

To proceed, enter yes. To stop installation, enter no.

Enter yes or no:yes

DDL replication setup script complete, running verification script...

Please enter the name of a schema for the GoldenGate database objects:

Setting schema name to GOLDENGATE

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 IGNORE TABLE

-----------------------------------

OK

DDL IGNORE LOG TABLE

-----------------------------------

OK

DDLAUX  PACKAGE STATUS:

Line/pos             Error

-------------------- -----------------------------------------------------------------

No errors            No errors

DDLAUX PACKAGE BODY STATUS:

Line/pos             Error

-------------------- -----------------------------------------------------------------

No errors            No errors

SYS.DDLCTXINFO  PACKAGE STATUS:

Line/pos             Error

-------------------- -----------------------------------------------------------------

No errors            No errors

SYS.DDLCTXINFO  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

------------------------------------------------------------------------------------------------------------------------

/database/admin/orcl/udump/ggs_ddl_trace.log

Analyzing installation status...

STATUS OF DDL REPLICATION

------------------------------------------------------------------------------------------------------------------------

SUCCESSFUL installation of DDL Replication software components

Script complete.

执行ROLE_SETUP

SQL> @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 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:GoldenGate

Wrote 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 processes, by using the following SQL command:

GRANT GGS_GGSUSER_ROLE TO

where is the user assigned to the GoldenGate processes.

将此角色给GOLDENGATE用户。

SQL> grant ggs_ggsuser_role to goldengate;

Grant succeeded.

开启DDL

SQL> @ddl_enable

Trigger altered.

安装性能优化包。

SQL> @?/rdbms/admin/dbmspool

Package created.

Grant succeeded.

View created.

Package body created.

ddl_pin将触发器用到的plsql包放进内存中

SQL> @ddl_pin goldengate

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

<!-- 正文结束 -->

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22896996/viewspace-1115121/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2009-11-18