GoldenGate单向DDL同步
GoldenGate单向DDL同步1. 源库和目标库ogguser用户都赋予dba角色和执行utl_file的权限:[oracle@dd1 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 16:15:18 2013Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> grant dba to ogguser;Grant succeeded.SQL> grant execute on utl_file to ogguser;Grant succeeded.2. 编辑源库全局参数文件[oracle@dd1 ogg11]$ cd $ORACLE_BASE/ogg11[oracle@dd1 ogg11]$ ggsciOracle GoldenGate Command Interpreter for OracleVersion 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100Linux, x64, 64bit (optimized), Oracle 11g on Oct 4 2011 23:49:46Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.GGSCI (dd1) 1> edit param ./GLOBALSggschema ogguser3. 启用DDL支持设置(只需在源库设置)[oracle@dd1 ogg11]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 16:21:35 2013Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options执行脚本marker_setup.sql:SQL> @marker_setup.sqlMarker setup scriptYou 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:ogguser ##输入ogguserMarker setup table script complete, running verification script...Please enter the name of a schema for the GoldenGate database objects:Setting schema name to OGGUSERMARKER TABLE-------------------------------OKMARKER SEQUENCE-------------------------------OKScript complete.关闭回收站:SQL> show parameter recyclebin;NAME TYPE VALUE------------------------------------ ----------- ------------------------------recyclebin string onSQL> alter system set recyclebin=off;alter system set recyclebin=off*ERROR at line 1:ORA-02096: specified initialization parameter is not modifiable with thisoptionSQL> alter system set recyclebin=off scope=spfile; ##如果是10g,需要重启数据库,这里是11g,无需重启System altered.数据库开始强制日志:SQL> alter database force logging;Database altered.确认源库已经处于归档模式,并启用附加日志和强制日志:SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;LOG_MODE SUPPLEME FOR------------ -------- ---ARCHIVELOG YES YES执行脚本ddl_setup.sql:SQL> @ddl_setup.sqlGoldenGate DDL Replication setup scriptVerifying that current user has privileges to install DDL Replication...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:ogguser ##输入ogguserYou will be prompted for the mode of installation.To install or reinstall DDL replication, enter INITIALSETUPTo upgrade DDL replication, enter NORMALEnter mode of installation:INITIALSETUPWorking, please wait ...Spooling to file ddl_setup_spool.txtChecking for sessions that are holding locks on Oracle Golden Gate metadata tables ...Check complete.Using OGGUSER 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 OGGUSERDDLORA_GETTABLESPACESIZE STATUS:Line/pos Error---------------------------------------- -----------------------------------------------------------------No errors No errorsCLEAR_TRACE STATUS:Line/pos Error--------------------上一个:Oracle中的所有权限
下一个:oracle虚拟索引的创建