一、安装环境:
源数据库
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
hdisk1
hdisk2
hdisk3
hdisk13
hdisk14
hdisk15
hdisk16
hdisk17
hdisk18
hdisk19
# lsvg orasoftvg
VOLUME GROUP:
VG STATE:
VG PERMISSION:
MAX LVs:
LVs:
OPEN LVs:
TOTAL PVs:
STALE PVs:
ACTIVE PVs:
MAX PPs per VG:
LTG size (Dynamic): 1024 kilobyte(s)
HOT SPARE:
PV RESTRICTION:
# df -g
Filesystem
/dev/hd4
/dev/hd2
/dev/hd9var
/dev/hd3
/dev/hd1
/dev/hd11admin
/proc
/dev/hd10opt
/dev/livedump
/dev/orasoftlv
# lspv
hdisk0
hdisk1
hdisk2
hdisk3
hdisk13
hdisk14
hdisk15
hdisk16
hdisk17
hdisk18
hdisk19
# lsdev -Cc disk
hdisk0
hdisk1
hdisk2
hdisk3
hdisk4
hdisk5
hdisk6
hdisk7
hdisk8
hdisk9
hdisk10 Defined
hdisk11 Defined
hdisk12 Defined
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
Smitty chlv
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[TOP]
* Logical volume NAME
[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
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>
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
------------------------------------ ----------- ------------------------------
recyclebin
SQL> alter system set recyclebin=off;
System altered.
SQL> show parameter recyclebin
NAME
------------------------------------ ----------- ------------------------------
recyclebin
9.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_CHINA.ZHS16GBK
SQL> select * from nls_database_parameters;
PARAMETER
------------------------------ --------------------------------------------------
NLS_LANGUAGE
NLS_TERRITORY
NLS_CURRENCY
NLS_ISO_CURRENCY
NLS_NUMERIC_CHARACTERS
NLS_CHARACTERSET
NLS_CALENDAR
NLS_DATE_FORMAT
NLS_DATE_LANGUAGE
NLS_SORT
NLS_TIME_FORMAT
PARAMETER
------------------------------ --------------------------------------------------
NLS_TIMESTAMP_FORMAT
NLS_TIME_TZ_FORMAT
NLS_TIMESTAMP_TZ_FORMAT
NLS_DUAL_CURRENCY
NLS_COMP
NLS_LENGTH_SEMANTICS
NLS_NCHAR_CONV_EXCP
NLS_NCHAR_CHARACTERSET
NLS_RDBMS_VERSION
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 =
tnsname.ora内容如下:
ASM1 =
ASM2 =
EXTPROC_CONNECTION_DATA =
测试配置:
$ 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.
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:
SUBDIRS
ER
EXTRACT
EXTTRAIL
GGSEVT
MANAGER
MARKER
PARAMS
REPLICAT
REPORT
RMTTRAIL
TRACETABLE
TRANDATA
SCHEMATRANDATA
CHECKPOINTTABLE
Commands without an
object:
(Database)
(DDL)
(Miscellaneous)
Example: HELP ADD REPLICAT
GGSCI (node2) 2> create subdirs
Creating subdirectories under current directory /database/ogg
Parameter files
Report files
Checkpoint files
Process status files
SQL script files
Database definitions files
Extract data files
Temporary files
Stdout files
GGSCI (node2) 3> quit
$ ls -l |grep dir
drwxrwxr-x
drwxrwxr-x
drwxrwxr-x
drwxr-x---
drwxrwxr-x
drwxrwxr-x
drwxr-x---
drwxrwxr-x
drwxrwxr-x
drwxrwxr-x
$ 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
------------------------------------ ----------- ------------------------------
recyclebin
SQL> alter system set recyclebin=off;
System altered.
SQL> show parameter recyclebin
NAME
------------------------------------ ----------- ------------------------------
recyclebin
9.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_CHINA.ZHS16GBK
SQL> select * from nls_database_parameters;
PARAMETER
------------------------------ --------------------------------------------------
NLS_LANGUAGE
NLS_TERRITORY
NLS_CURRENCY
NLS_ISO_CURRENCY
NLS_NUMERIC_CHARACTERS
NLS_CHARACTERSET
NLS_CALENDAR
NLS_DATE_FORMAT
NLS_DATE_LANGUAGE
NLS_SORT
NLS_TIME_FORMAT
PARAMETER
------------------------------ --------------------------------------------------
NLS_TIMESTAMP_FORMAT
NLS_TIME_TZ_FORMAT
NLS_TIMESTAMP_TZ_FORMAT
NLS_DUAL_CURRENCY
NLS_COMP
NLS_LENGTH_SEMANTICS
NLS_NCHAR_CONV_EXCP
NLS_NCHAR_CHARACTERSET
NLS_RDBMS_VERSION
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
-------------------- -----------------------------------------------------------------
No errors
CREATE_TRACE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
TRACE_PUT_LINE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
INITIAL_SETUP STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLVERSIONSPECIFIC PACKAGE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLREPLICATION PACKAGE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLREPLICATION PACKAGE BODY STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDL IGNORE TABLE
-----------------------------------
OK
DDL IGNORE LOG TABLE
-----------------------------------
OK
DDLAUX
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLAUX PACKAGE BODY STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
SYS.DDLCTXINFO
Line/pos
-------------------- -----------------------------------------------------------------
No errors
SYS.DDLCTXINFO
Line/pos
-------------------- -----------------------------------------------------------------
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
-------------------- -----------------------------------------------------------------
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
hdisk1
hdisk2
hdisk3
hdisk4
hdisk5
hdisk6
hdisk7
hdisk8
hdisk9
hdisk10
hdisk11
hdisk12
hdisk13
hdisk14
hdisk15
# 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
hdisk1
hdisk2
hdisk3
逐一修改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
hdisk4 changed
# chdev -l hdisk5 -a reserve_policy=no_reserve
-a hcheck_interval=60
hdisk5 changed
# chdev -l hdisk6 -a reserve_policy=no_reserve
-a hcheck_interval=60
hdisk6 changed
8、配置卷组
# lspv
hdisk0
hdisk1
hdisk2
hdisk3
hdisk4
hdisk5
hdisk6
# 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
hdisk1
hdisk2
hdisk3
hdisk4
hdisk5
hdisk6
$smitty vg
新建 oravg、datavg、bakvg
Smitty fs
# df -g
Filesystem
/dev/hd4
/dev/hd2
/dev/hd9var
/dev/hd3
/dev/hd1
/dev/hd11admin
/proc
/dev/hd10opt
/dev/livedump
/dev/lv00
/dev/fslv00
/dev/fslv01
/dev/oraclelv
/dev/fslv02
# 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用户的环境变量:
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:
SUBDIRS
ER
EXTRACT
EXTTRAIL
GGSEVT
MANAGER
MARKER
PARAMS
REPLICAT
REPORT
RMTTRAIL
TRACETABLE
TRANDATA
SCHEMATRANDATA
CHECKPOINTTABLE
Commands without an
object:
(Database)
(DDL)
(Miscellaneous)
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
Report files
Checkpoint files
Process status files
SQL script files
Database definitions files
Extract data files
Temporary files
Stdout files
GGSCI (node3) 3> quit
$ ls -l |grep dir
drwxrwxr-x
drwxrwxr-x
drwxrwxr-x
drwxr-x---
drwxrwxr-x
drwxrwxr-x
drwxr-x---
drwxrwxr-x
drwxrwxr-x
drwxrwxr-x
$ 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
-------------------- -----------------------------------------------------------------
No errors
CREATE_TRACE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
TRACE_PUT_LINE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
INITIAL_SETUP STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLVERSIONSPECIFIC PACKAGE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLREPLICATION PACKAGE STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLREPLICATION PACKAGE BODY STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDL IGNORE TABLE
-----------------------------------
OK
DDL IGNORE LOG TABLE
-----------------------------------
OK
DDLAUX
Line/pos
-------------------- -----------------------------------------------------------------
No errors
DDLAUX PACKAGE BODY STATUS:
Line/pos
-------------------- -----------------------------------------------------------------
No errors
SYS.DDLCTXINFO
Line/pos
-------------------- -----------------------------------------------------------------
No errors
SYS.DDLCTXINFO
Line/pos
-------------------- -----------------------------------------------------------------
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
-------------------- -----------------------------------------------------------------
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博客 ” ,链接:https://blog.itpub.net/22896996/viewspace-1115121/ ,如需转载,请注明出处,否则将追究法律责任。