转载

OGG搭建(单实例-->单实例)


点击(此处)折叠或打开

  1. [oracle@Test11g ogg]$ ldd --version
  2. ldd (GNU libc) 2.5
  3. Copyright (C) 2006 Free Software Foundation, Inc.
  4. This is free software; see the source for copying conditions. There is NO
  5. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  6. Written by Roland McGrath and Ulrich Drepper.


点击(此处)折叠或打开

  1. [oracle@Test11g ogg]$ ldd ggsci
  2.     librt.so.1 => /lib64/librt.so.1 (0x000000317dc00000)
  3.     libdl.so.2 => /lib64/libdl.so.2 (0x000000317ac00000)
  4.     libgglog.so => /ogg/libgglog.so (0x00002ad522ebd000)
  5.     libggrepo.so => /ogg/libggrepo.so (0x00002ad52331f000)
  6.     libdb-6.1.so => /ogg/libdb-6.1.so (0x00002ad5235a1000)
  7.     libggperf.so => /ogg/libggperf.so (0x00002ad523985000)
  8.     libggparam.so => /ogg/libggparam.so (0x00002ad523bbb000)
  9.     libicui18n.so.48 => /ogg/libicui18n.so.48 (0x00002ad524d6d000)
  10.     libicuuc.so.48 => /ogg/libicuuc.so.48 (0x00002ad52515c000)
  11.     libicudata.so.48 => /ogg/libicudata.so.48 (0x00002ad5254de000)
  12.     libpthread.so.0 => /lib64/libpthread.so.0 (0x000000317b000000)
  13.     libxerces-c.so.28 => /ogg/libxerces-c.so.28 (0x00002ad526ca3000)
  14.     libantlr3c.so => /ogg/libantlr3c.so (0x00002ad52726a000)
  15.     libmysqlclient.so.18 => /ogg/libmysqlclient.so.18 (0x00002ad527483000)
  16.     libggnnzitp.so => /ogg/libggnnzitp.so (0x00002ad527bc0000)
  17.     libm.so.6 => /lib64/libm.so.6 (0x000000317a800000)
  18.     libc.so.6 => /lib64/libc.so.6 (0x000000317a400000)
  19.     /lib64/ld-linux-x86-64.so.2 (0x000000317a000000)
  20.     libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003180000000)
  21.     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000317fc00000)

在环境变量中添加变量,我的ogg安装目录是/ogg,没有说必须用oracle用户安装,但是我们默认这么搞。

点击(此处)折叠或打开

  1. export PATH=/ogg:$PATH
  2. export LD_LIBRARY_PATH=/ogg:$LD_LIBRARY_PATH
http://yunpan.cn/c3V9rbMguvHsV  访问密码 1f09
下载解压,进入Disk1执行runInstaller


OGG搭建(单实例-->单实例)


OGG搭建(单实例-->单实例)

OGG搭建(单实例-->单实例)

OGG搭建(单实例-->单实例)

source和target都要安装,target配置Replicate ,source配置extract


开启归档,强制日志,附加日志:通过附加日志获取更多的内容,比如说表的主键,rowid等。

点击(此处)折叠或打开

  1. 08:40:30 SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;

  2. LOG_MODE SUPPLEME FOR
  3. ------------ -------- ---
  4. ARCHIVELOG YES NO

  5. Elapsed: 00:00:00.02
  6. 08:40:36 SQL> alter database add supplemental log data;

  7. Database altered.

  8. Elapsed: 00:00:00.42

  9. 08:41:28 SQL> alter database force logging;

  10. Database altered.

  11. Elapsed: 00:00:00.41
  12. 08:41:47 SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;

  13. LOG_MODE SUPPLEME FOR
  14. ------------ -------- ---
  15. ARCHIVELOG YES YES

  16. Elapsed: 00:00:00.01
务必切换一次日志
08:43:29 SQL> alter system switch logfile;
System altered.
创建OGG所需要的表空间,12C必须创建,11g可以不用创建。

点击(此处)折叠或打开

  1. 08:43:37 SQL> create tablespace ggs datafile '/u01/app/oracle/oradata/test/ggs.dbf' size 10m autoextend on;

  2. Tablespace created.

  3. Elapsed: 00:00:00.97
  4. 08:49:15 SQL> create user ggs identified by ggs default tablespace ggs;

  5. User created.

  6. Elapsed: 00:00:00.67
  7. 08:49:45 SQL> grant connect,resource to ggs;

  8. Grant succeeded.

  9. Elapsed: 00:00:00.15
  10. 08:50:00 SQL> grant execute on utl_file to ggs;

  11. Grant succeeded.
执行脚本

点击(此处)折叠或打开

  1. 08:50:14 SQL> @/ogg/marker_setup.sql

  2. Marker setup script

  3. You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
  4. NOTE: The schema must be created prior to running this script.
  5. NOTE: Stop all DDL replication before starting this installation.

  6. Enter Oracle GoldenGate schema name:ggs

  7. Elapsed: 00:00:00.14
  8. Elapsed: 00:00:00.04

  9. Marker setup table script complete, running verification script...
  10. Please enter the name of a schema for the GoldenGate database objects:
  11. Setting schema name to GGS

  12. MARKER TABLE
  13. -------------------------------
  14. OK
  15. Elapsed: 00:00:00.14

  16. MARKER SEQUENCE
  17. -------------------------------
  18. OK
  19. Elapsed: 00:00:00.02

  20. Script complete.
  21. 08:55:15 SQL> @/ogg/ddl_setup.sql

  22. Oracle GoldenGate DDL Replication setup script

  23. Verifying that current user has privileges to install DDL Replication...
  24. Elapsed: 00:00:00.02
  25. Elapsed: 00:00:00.01

  26. You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
  27. NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
  28. NOTE: The schema must be created prior to running this script.
  29. NOTE: Stop all DDL replication before starting this installation.

  30. Enter Oracle GoldenGate schema name:ggs

  31. Working, please wait ...
  32. Spooling to file ddl_setup_spool.txt

  33. Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...

  34. Check complete.
  35. Elapsed: 00:00:00.01
  36. Elapsed: 00:00:00.24




  37. Elapsed: 00:00:00.00
  38. Elapsed: 00:00:00.20


  39. Elapsed: 00:00:00.00
  40. Elapsed: 00:00:00.05
  41. Elapsed: 00:00:00.04
  42. Elapsed: 00:00:00.02
  43. Elapsed: 00:00:00.04
  44. Elapsed: 00:00:00.03


  45. Elapsed: 00:00:00.00
  46. Elapsed: 00:00:00.05


  47. Elapsed: 00:00:00.01
  48. Elapsed: 00:00:00.04
  49. Elapsed: 00:00:00.04
  50. Elapsed: 00:00:00.01
  51. Elapsed: 00:00:00.04

  52. Using GGS as a Oracle GoldenGate schema name.

  53. Working, please wait ...
  54. Elapsed: 00:00:00.04

  55. DDL replication setup script complete, running verification script...
  56. Please enter the name of a schema for the GoldenGate database objects:
  57. Setting schema name to GGS

  58. CLEAR_TRACE STATUS:

  59. Line/pos     Error
  60. -------------------- -----------------------------------------------------------------
  61. No errors     No errors
  62. Elapsed: 00:00:00.03

  63. CREATE_TRACE STATUS:

  64. Line/pos     Error
  65. -------------------- -----------------------------------------------------------------
  66. No errors     No errors
  67. Elapsed: 00:00:00.06

  68. TRACE_PUT_LINE STATUS:

  69. Line/pos     Error
  70. -------------------- -----------------------------------------------------------------
  71. No errors     No errors
  72. Elapsed: 00:00:00.03

  73. INITIAL_SETUP STATUS:

  74. Line/pos     Error
  75. -------------------- -----------------------------------------------------------------
  76. No errors     No errors
  77. Elapsed: 00:00:00.05

  78. DDLVERSIONSPECIFIC PACKAGE STATUS:

  79. Line/pos     Error
  80. -------------------- -----------------------------------------------------------------
  81. No errors     No errors
  82. Elapsed: 00:00:00.04

  83. DDLREPLICATION PACKAGE STATUS:

  84. Line/pos     Error
  85. -------------------- -----------------------------------------------------------------
  86. No errors     No errors
  87. Elapsed: 00:00:00.04

  88. DDLREPLICATION PACKAGE BODY STATUS:

  89. Line/pos     Error
  90. -------------------- -----------------------------------------------------------------
  91. No errors     No errors
  92. Elapsed: 00:00:00.04

  93. DDL IGNORE TABLE
  94. -----------------------------------
  95. OK
  96. Elapsed: 00:00:00.04

  97. DDL IGNORE LOG TABLE
  98. -----------------------------------
  99. OK
  100. Elapsed: 00:00:00.05

  101. DDLAUX    PACKAGE STATUS:

  102. Line/pos     Error
  103. -------------------- -----------------------------------------------------------------
  104. No errors     No errors
  105. Elapsed: 00:00:00.04

  106. DDLAUX PACKAGE BODY STATUS:

  107. Line/pos     Error
  108. -------------------- -----------------------------------------------------------------
  109. No errors     No errors
  110. Elapsed: 00:00:00.05

  111. SYS.DDLCTXINFO    PACKAGE STATUS:

  112. Line/pos     Error
  113. -------------------- -----------------------------------------------------------------
  114. No errors     No errors
  115. Elapsed: 00:00:00.04

  116. SYS.DDLCTXINFO    PACKAGE BODY STATUS:

  117. Line/pos     Error
  118. -------------------- -----------------------------------------------------------------
  119. No errors     No errors
  120. Elapsed: 00:00:00.03

  121. DDL HISTORY TABLE
  122. -----------------------------------
  123. OK
  124. Elapsed: 00:00:00.05

  125. DDL HISTORY TABLE(1)
  126. -----------------------------------
  127. OK
  128. Elapsed: 00:00:00.04

  129. DDL DUMP TABLES
  130. -----------------------------------
  131. OK
  132. Elapsed: 00:00:00.05

  133. DDL DUMP COLUMNS
  134. -----------------------------------
  135. OK
  136. Elapsed: 00:00:00.06

  137. DDL DUMP LOG GROUPS
  138. -----------------------------------
  139. OK
  140. Elapsed: 00:00:00.04

  141. DDL DUMP PARTITIONS
  142. -----------------------------------
  143. OK
  144. Elapsed: 00:00:00.06

  145. DDL DUMP PRIMARY KEYS
  146. -----------------------------------
  147. OK
  148. Elapsed: 00:00:00.10

  149. DDL SEQUENCE
  150. -----------------------------------
  151. OK
  152. Elapsed: 00:00:00.01

  153. GGS_TEMP_COLS
  154. -----------------------------------
  155. OK
  156. Elapsed: 00:00:00.05

  157. GGS_TEMP_UK
  158. -----------------------------------
  159. OK
  160. Elapsed: 00:00:00.04

  161. DDL TRIGGER CODE STATUS:

  162. Line/pos     Error
  163. -------------------- -----------------------------------------------------------------
  164. No errors     No errors
  165. Elapsed: 00:00:00.04

  166. DDL TRIGGER INSTALL STATUS
  167. -----------------------------------
  168. OK
  169. Elapsed: 00:00:00.19

  170. DDL TRIGGER RUNNING STATUS
  171. ----------------------------------------------------------------------
  172. ENABLED
  173. Elapsed: 00:00:00.17

  174. STAYMETADATA IN TRIGGER
  175. ----------------------------------------------------------------------
  176. OFF
  177. Elapsed: 00:00:00.00

  178. DDL TRIGGER SQL TRACING
  179. ----------------------------------------------------------------------
  180. 0
  181. Elapsed: 00:00:00.01

  182. DDL TRIGGER TRACE LEVEL
  183. ----------------------------------------------------------------------
  184. NONE
  185. Elapsed: 00:00:00.01

  186. LOCATION OF DDL TRACE FILE
  187. ------------------------------------------------------------------------------------------------------------------------
  188. /u01/app/oracle/diag/rdbms/test/test/trace/ggs_ddl_trace.log
  189. Elapsed: 00:00:00.01

  190. Analyzing installation status...

  191. Elapsed: 00:00:01.15

  192. VERSION OF DDL REPLICATION
  193. ------------------------------------------------------------------------------------------------------------------------
  194. OGGCORE_12.2.0.1.0_PLATFORMS_151101.1925.2
  195. Elapsed: 00:00:00.06

  196. STATUS OF DDL REPLICATION
  197. ------------------------------------------------------------------------------------------------------------------------
  198. SUCCESSFUL installation of DDL Replication software components
  199. Elapsed: 00:00:00.00

  200. Script complete.
  201. 08:55:52 SQL> @/ogg/role_setup.sql

  202. GGS Role setup script

  203. This script will drop and recreate the role GGS_GGSUSER_ROLE
  204. 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.)

  205. You will be prompted for the name of a schema for the GoldenGate database objects.
  206. NOTE: The schema must be created prior to running this script.
  207. NOTE: Stop all DDL replication before starting this installation.

  208. Enter GoldenGate schema name:ggs
  209. Wrote file role_setup_set.txt

  210. PL/SQL procedure successfully completed.

  211. Elapsed: 00:00:00.01

  212. Role setup script complete

  213. Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:

  214. GRANT GGS_GGSUSER_ROLE TO <loggedUser>

  215. where <loggedUser> is the user assigned to the GoldenGate processes.

点击(此处)折叠或打开

  1. 08:58:19 SQL> grant GGS_GGSUSER_ROLE to ggs;

  2. Grant succeeded.

  3. Elapsed: 00:00:00.09
  4. 08:58:47 SQL> @/ogg/ddl_enable.sql

  5. Trigger altered.

  6. Elapsed: 00:00:00.01
  7. 08:58:59 SQL> @?/rdbms/admin/dbmspool


  8. Package created.

  9. Elapsed: 00:00:00.10

  10. Grant succeeded.

  11. Elapsed: 00:00:00.06
  12. 08:59:22 SQL> 08:59:22 SQL>
  13. 08:59:23 SQL> @/ogg/ddl_pin.sql
  14. Enter value for 1:
  15. BEGIN dbms_shared_pool.keep(' .DDLReplication', 'P'); END;

  16. *
  17. ERROR at line 1:
  18. ORA-00931: missing identifier
  19. ORA-06512: at "SYS.DBMS_UTILITY", line 156
  20. ORA-06512: at "SYS.DBMS_SHARED_POOL", line 72
  21. ORA-06512: at "SYS.DBMS_SHARED_POOL", line 84
  22. ORA-06512: at line 1


  23. Elapsed: 00:00:00.02
  24. Enter value for 1: 1
  25. BEGIN dbms_shared_pool.keep('1 .trace_put_line', 'P'); END;

  26. *
  27. ERROR at line 1:
  28. ORA-00931: missing identifier
  29. ORA-06512: at "SYS.DBMS_UTILITY", line 156
  30. ORA-06512: at "SYS.DBMS_SHARED_POOL", line 72
  31. ORA-06512: at "SYS.DBMS_SHARED_POOL", line 84
  32. ORA-06512: at line 1


  33. Elapsed: 00:00:00.01

  34. PL/SQL procedure successfully completed.

  35. Elapsed: 00:00:00.02






正文到此结束
Loading...