If the recyclebin is enabled, the Oracle GoldenGate DDL trigger session receives implicitrecycle bin DDL operations that cause the trigger to fail.
Oracle 11g:
SQL> alter system set recyclebin=offscope=spfile;
System altered.
如果数据库是10g,需要关闭recyclebin并重启;或者手工purge recyclebin。
(3)创建存放DDL 信息的user并赋权
SQL> create user ggtest identified by oracle default tablespace users temporary tablespace temp;
User created.
SQL> grant connect,resource to ggtest;
Grant succeeded.
SQL> grant execute on utl_file to ggtest;
Grant succeeded.
退出所有使用Oracle 的session,然后使用SYSDBA权限的用户执行如下脚本:
gg1:/u01/ggate> echo $ggate
/u01/ggate
--进入GG的目录,然后调用脚本:
gg1:/home/oracle> cd $ggate
gg1:/u01/ggate> sqlplus / as sysdba;
SQL*Plus: Release 11.2.0.3.0 Production onTue Nov 8 19:41:58 2011
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Miningand Real Application Testing options
--脚本1:
SQL> @marker_setup.sql;
Marker setup script
You will be prompted for the name of aschema for the GoldenGate database objects.
NOTE: The schema must be created prior torunning this script.
NOTE: Stop all DDL replication beforestarting this installation.
--输入我们之前创建的用户名:
Enter GoldenGate schema name:ggtest
Marker setup table script complete, runningverification script...
Please enter the name of a schema for theGoldenGate database objects:
Setting schema name to ggtest
MARKER TABLE
-------------------------------
OK
MARKER SEQUENCE
-------------------------------
OK
Script complete.
--脚本2:
SQL> @ddl_setup.sql;
GoldenGate DDL Replication setup script
Verifying that current user has privilegesto install DDL Replication...
You will be prompted for the name of aschema for the GoldenGate database objects.
NOTE: For an Oracle 10g source, the systemrecycle bin must be disabled. For Oracle 11g and later, it can be enabled.
--注意这里提示我们在10g里,必须关闭recycle bin,在11g以后的版本,可以不用关闭。
NOTE: The schema must be created prior torunning this script.
NOTE: Stop all DDL replication beforestarting this installation.
--提示输入GG的用户:
Enter GoldenGate schema name:ggtest
You will be prompted for the mode ofinstallation.
To install or reinstall DDL replication,enter INITIALSETUP
To upgrade DDL replication, enter NORMAL
--这里让我们选择安装模式: install 和 reinstall 选择INITIALSETUP
Enter mode of installation:INITIALSETUP
Working, please wait ...
Spooling to file ddl_setup_spool.txt
Checking for sessions that are holdinglocks on Oracle Golden Gate metadata tables ...
Check complete.
Using ggtest 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 theGoldenGate database objects:
Setting schema name to ggtest
DDLORA_GETTABLESPACESIZE STATUS:
……
STATUS OF DDL REPLICATION
-------------------------------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replicationsoftware components
Script complete.
--脚本3:
SQL> @role_setup.sql;
GGS Role setup script
This script will drop and recreate the roleGGS_GGSUSER_ROLE