1.开始配置OGG支持DDL复制(在source端操作)
1.1 赋予权限
SQL> conn /as sysdba
已连接。
SQL> grant execute on utl_file to ggs;
1.2 修改全局配置文件添加ggschema
GGSCI (WIN-GM5PVS1CILH) 18> edit param ./GLOBALS
GGSCI (WIN-GM5PVS1CILH) 19> view param ./GLOBALS
ggschema ggs
GGSCI (WIN-GM5PVS1CILH) 20>
1.3 运行相关sql脚本 及修改参数
C:\Users\Administrator>cd C:\ora11g\product\ogg_src
C:\ora11g\product\ogg_src>sqlplus /nolog
SQL> conn /as sysdba
已连接。
#第一个sql脚本
SQL> @marker_setup.sql
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:ggs
Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGS
MARKER TABLE
-------------------------------
OK
MARKER SEQUENCE
-------------------------------
OK
Script complete.
SQL>
#禁用 recyclebin 。官网的解释如下:If the recyclebin is enabled, the Oracle GoldenGate DDL trigger session receives implicitrecycle bin DDL operations that cause the trigger to fail.
SQL> show parameter recyclebin;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
recyclebin string on
SQL> alter system set recyclebin=off scope=spfile;
系统已更改。
SQL> show parameter recyclebin; #需重启实例后改参数才生效
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
recyclebin string off
SQL>
#第二个sql脚本 注意:此脚本要求ggs必须是独立表空间且是自动扩展的
SQL> @ddl_setup.sql
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 databaseobjects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Ora
cle 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:ggs
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.
WARNING: Tablespace TBS_GGS does not have AUTOEXTEND enabled.
Using GGS as a Oracle GoldenGate schema name.
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 GGS
CLEAR_TRACE STATUS:
Line/pos Error
-------------------- -----------------------------------------------------------
------
No errors No errors
.........
SUCCESSFUL installation of DDL Replication software components
Script complete.
SQL>
#第三个sql
SQL> @role_setup.sql
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 scri
pt 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:ggs
已写入 file role_setup_set.txt
PL/SQL 过程已成功完成。
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 1.开始配置OGG支持DDL复制(在source端操作)
1.1 赋