- [oracle@Test11g ogg]$ ldd --version
- ldd (GNU libc) 2.5
- Copyright (C) 2006 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Written by Roland McGrath and Ulrich Drepper.
- [oracle@Test11g ogg]$ ldd ggsci
- librt.so.1 => /lib64/librt.so.1 (0x000000317dc00000)
- libdl.so.2 => /lib64/libdl.so.2 (0x000000317ac00000)
- libgglog.so => /ogg/libgglog.so (0x00002ad522ebd000)
- libggrepo.so => /ogg/libggrepo.so (0x00002ad52331f000)
- libdb-6.1.so => /ogg/libdb-6.1.so (0x00002ad5235a1000)
- libggperf.so => /ogg/libggperf.so (0x00002ad523985000)
- libggparam.so => /ogg/libggparam.so (0x00002ad523bbb000)
- libicui18n.so.48 => /ogg/libicui18n.so.48 (0x00002ad524d6d000)
- libicuuc.so.48 => /ogg/libicuuc.so.48 (0x00002ad52515c000)
- libicudata.so.48 => /ogg/libicudata.so.48 (0x00002ad5254de000)
- libpthread.so.0 => /lib64/libpthread.so.0 (0x000000317b000000)
- libxerces-c.so.28 => /ogg/libxerces-c.so.28 (0x00002ad526ca3000)
- libantlr3c.so => /ogg/libantlr3c.so (0x00002ad52726a000)
- libmysqlclient.so.18 => /ogg/libmysqlclient.so.18 (0x00002ad527483000)
- libggnnzitp.so => /ogg/libggnnzitp.so (0x00002ad527bc0000)
- libm.so.6 => /lib64/libm.so.6 (0x000000317a800000)
- libc.so.6 => /lib64/libc.so.6 (0x000000317a400000)
- /lib64/ld-linux-x86-64.so.2 (0x000000317a000000)
- libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003180000000)
- libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000317fc00000)
在环境变量中添加变量,我的ogg安装目录是/ogg,没有说必须用oracle用户安装,但是我们默认这么搞。 - export PATH=/ogg:$PATH
- export LD_LIBRARY_PATH=/ogg:$LD_LIBRARY_PATH
http://yunpan.cn/c3V9rbMguvHsV 访问密码 1f09
下载解压,进入Disk1执行runInstaller source和
target都要安装,target配置Replicate ,source配置extract
开启归档,强制日志,附加日志:通过附加日志获取更多的内容,比如说表的主键,rowid等。 - 08:40:30 SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;
-
- LOG_MODE SUPPLEME FOR
- ------------ -------- ---
- ARCHIVELOG YES NO
-
- Elapsed: 00:00:00.02
- 08:40:36 SQL> alter database add supplemental log data;
-
- Database altered.
-
- Elapsed: 00:00:00.42
-
- 08:41:28 SQL> alter database force logging;
-
- Database altered.
-
- Elapsed: 00:00:00.41
- 08:41:47 SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;
-
- LOG_MODE SUPPLEME FOR
- ------------ -------- ---
- ARCHIVELOG YES YES
-
- Elapsed: 00:00:00.01
务必切换一次日志 08:43:29 SQL> alter system switch logfile;
System altered.
创建OGG所需要的表空间,12C必须创建,11g可以不用创建。 - 08:43:37 SQL> create tablespace ggs datafile '/u01/app/oracle/oradata/test/ggs.dbf' size 10m autoextend on;
-
- Tablespace created.
-
- Elapsed: 00:00:00.97
- 08:49:15 SQL> create user ggs identified by ggs default tablespace ggs;
-
- User created.
-
- Elapsed: 00:00:00.67
- 08:49:45 SQL> grant connect,resource to ggs;
-
- Grant succeeded.
-
- Elapsed: 00:00:00.15
- 08:50:00 SQL> grant execute on utl_file to ggs;
-
- Grant succeeded.
执行脚本
- 08:50:14 SQL> @/ogg/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:ggs
-
- Elapsed: 00:00:00.14
- Elapsed: 00:00:00.04
-
- 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
- Elapsed: 00:00:00.14
-
- MARKER SEQUENCE
- -------------------------------
- OK
- Elapsed: 00:00:00.02
-
- Script complete.
- 08:55:15 SQL> @/ogg/ddl_setup.sql
-
- Oracle GoldenGate DDL Replication setup script
-
- Verifying that current user has privileges to install DDL Replication...
- Elapsed: 00:00:00.02
- Elapsed: 00:00:00.01
-
- 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: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.
- Elapsed: 00:00:00.01
- Elapsed: 00:00:00.24
-
-
-
-
- Elapsed: 00:00:00.00
- Elapsed: 00:00:00.20
-
-
- Elapsed: 00:00:00.00
- Elapsed: 00:00:00.05
- Elapsed: 00:00:00.04
- Elapsed: 00:00:00.02
- Elapsed: 00:00:00.04
- Elapsed: 00:00:00.03
-
-
- Elapsed: 00:00:00.00
- Elapsed: 00:00:00.05
-
-
- Elapsed: 00:00:00.01
- Elapsed: 00:00:00.04
- Elapsed: 00:00:00.04
- Elapsed: 00:00:00.01
- Elapsed: 00:00:00.04
-
- Using GGS as a Oracle GoldenGate schema name.
-
- Working, please wait ...
- Elapsed: 00:00:00.04
-
- 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
- Elapsed: 00:00:00.03
-
- CREATE_TRACE STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.06
-
- TRACE_PUT_LINE STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.03
-
- INITIAL_SETUP STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.05
-
- DDLVERSIONSPECIFIC PACKAGE STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.04
-
- DDLREPLICATION PACKAGE STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.04
-
- DDLREPLICATION PACKAGE BODY STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.04
-
- DDL IGNORE TABLE
- -----------------------------------
- OK
- Elapsed: 00:00:00.04
-
- DDL IGNORE LOG TABLE
- -----------------------------------
- OK
- Elapsed: 00:00:00.05
-
- DDLAUX PACKAGE STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.04
-
- DDLAUX PACKAGE BODY STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.05
-
- SYS.DDLCTXINFO PACKAGE STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.04
-
- SYS.DDLCTXINFO PACKAGE BODY STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.03
-
- DDL HISTORY TABLE
- -----------------------------------
- OK
- Elapsed: 00:00:00.05
-
- DDL HISTORY TABLE(1)
- -----------------------------------
- OK
- Elapsed: 00:00:00.04
-
- DDL DUMP TABLES
- -----------------------------------
- OK
- Elapsed: 00:00:00.05
-
- DDL DUMP COLUMNS
- -----------------------------------
- OK
- Elapsed: 00:00:00.06
-
- DDL DUMP LOG GROUPS
- -----------------------------------
- OK
- Elapsed: 00:00:00.04
-
- DDL DUMP PARTITIONS
- -----------------------------------
- OK
- Elapsed: 00:00:00.06
-
- DDL DUMP PRIMARY KEYS
- -----------------------------------
- OK
- Elapsed: 00:00:00.10
-
- DDL SEQUENCE
- -----------------------------------
- OK
- Elapsed: 00:00:00.01
-
- GGS_TEMP_COLS
- -----------------------------------
- OK
- Elapsed: 00:00:00.05
-
- GGS_TEMP_UK
- -----------------------------------
- OK
- Elapsed: 00:00:00.04
-
- DDL TRIGGER CODE STATUS:
-
- Line/pos Error
- -------------------- -----------------------------------------------------------------
- No errors No errors
- Elapsed: 00:00:00.04
-
- DDL TRIGGER INSTALL STATUS
- -----------------------------------
- OK
- Elapsed: 00:00:00.19
-
- DDL TRIGGER RUNNING STATUS
- ----------------------------------------------------------------------
- ENABLED
- Elapsed: 00:00:00.17
-
- STAYMETADATA IN TRIGGER
- ----------------------------------------------------------------------
- OFF
- Elapsed: 00:00:00.00
-
- DDL TRIGGER SQL TRACING
- ----------------------------------------------------------------------
- 0
- Elapsed: 00:00:00.01
-
- DDL TRIGGER TRACE LEVEL
- ----------------------------------------------------------------------
- NONE
- Elapsed: 00:00:00.01
-
- LOCATION OF DDL TRACE FILE
- ------------------------------------------------------------------------------------------------------------------------
- /u01/app/oracle/diag/rdbms/test/test/trace/ggs_ddl_trace.log
- Elapsed: 00:00:00.01
-
- Analyzing installation status...
-
- Elapsed: 00:00:01.15
-
- VERSION OF DDL REPLICATION
- ------------------------------------------------------------------------------------------------------------------------
- OGGCORE_12.2.0.1.0_PLATFORMS_151101.1925.2
- Elapsed: 00:00:00.06
-
- STATUS OF DDL REPLICATION
- ------------------------------------------------------------------------------------------------------------------------
- SUCCESSFUL installation of DDL Replication software components
- Elapsed: 00:00:00.00
-
- Script complete.
- 08:55:52 SQL> @/ogg/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 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:ggs
- Wrote file role_setup_set.txt
-
- PL/SQL procedure successfully completed.
-
- Elapsed: 00:00:00.01
-
- 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 <loggedUser>
-
- where <loggedUser> is the user assigned to the GoldenGate processes.
- 08:58:19 SQL> grant GGS_GGSUSER_ROLE to ggs;
-
- Grant succeeded.
-
- Elapsed: 00:00:00.09
- 08:58:47 SQL> @/ogg/ddl_enable.sql
-
- Trigger altered.
-
- Elapsed: 00:00:00.01
- 08:58:59 SQL> @?/rdbms/admin/dbmspool
-
-
- Package created.
-
- Elapsed: 00:00:00.10
-
- Grant succeeded.
-
- Elapsed: 00:00:00.06
- 08:59:22 SQL> 08:59:22 SQL>
- 08:59:23 SQL> @/ogg/ddl_pin.sql
- Enter value for 1:
- BEGIN dbms_shared_pool.keep(' .DDLReplication', 'P'); END;
-
- *
- ERROR at line 1:
- ORA-00931: missing identifier
- ORA-06512: at "SYS.DBMS_UTILITY", line 156
- ORA-06512: at "SYS.DBMS_SHARED_POOL", line 72
- ORA-06512: at "SYS.DBMS_SHARED_POOL", line 84
- ORA-06512: at line 1
-
-
- Elapsed: 00:00:00.02
- Enter value for 1: 1
- BEGIN dbms_shared_pool.keep('1 .trace_put_line', 'P'); END;
-
- *
- ERROR at line 1:
- ORA-00931: missing identifier
- ORA-06512: at "SYS.DBMS_UTILITY", line 156
- ORA-06512: at "SYS.DBMS_SHARED_POOL", line 72
- ORA-06512: at "SYS.DBMS_SHARED_POOL", line 84
- ORA-06512: at line 1
-
-
- Elapsed: 00:00:00.01
-
- PL/SQL procedure successfully completed.
-
- Elapsed: 00:00:00.02