ITPub博客

首页 > 数据库 > Oracle > Goldengate开启DDL操作

Goldengate开启DDL操作

原创 Oracle 作者:linfeng_oracle 时间:2014-06-10 16:01:57 0 删除 编辑

Goldengate开启DDL操作



以下操作在源端、目标端都要执行

安装DDL相关对象时,建议退出所有应用程序,并防止数据库有新的连接,否则可能导致操作失败。
安装支持DDL同步对象,可通过下述命令实现:
1. 赋予GoldenGate用户utl_file执行权限
grant execute on utl_file  to goldengate;


2. 最好断开所有数据库连接、停止监听


3. 以SYS用户执行DDL对象脚本
@marker_setup.sql
Enter GoldenGate schema name: goldengate
@ddl_setup.sql
Enter GoldenGate schema name: goldengate
declare
*
ERROR at line 1:
ORA-20783:
ORA-20783:
Oracle GoldenGate DDL Replication setup:
*** Please move GOLDENGATE to its own tablespace
ORA-06512: at line 34

必须为ogg用户单独指定表空间:
SQL> create tablespace ogg datafile '+DATA' size 5G autoextend off;
SQL> alter user goldengate default tablespace ogg;
SQL> grant connect,resource,unlimited tablespace to goldengate;
Analyzing installation status...


STATUS OF DDL REPLICATION
------------------------------------------------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components

@role_setup.sql

Enter GoldenGate schema name: goldengate


4. 授权GoldenGate用户
grant GGS_GGSUSER_ROLE to goldengate;


二、将DDL同步触发器置为enable
将DDL同步触发器置为enable,通过下述命令实现:
@ddl_enable.sql


三、将DDL相关对象pin到shared pool
实施此操作需要调用dbms_shared_pool包,需要事先确认此包是否已安装。
确认dbms_shared_pool包是否已安装,通过下述命令实现:
desc dbms_shared_pool

将DDL对象pin到shared pool,通过下述命令实现:
@ddl_pin GOLDENGATE


在源端加以下参数:

GGSCI (gd-pdb02) 5> view param mgr

PURGEDDLHISTORY MINKEEPDAYS 7, MAXKEEPDAYS 14, FREQUENCYHOURS 30
PURGEMARKERHISTORY MINKEEPDAYS 7, MAXKEEPDAYS 14, FREQUENCYHOURS 30


GGSCI (gd-pdb02) 2> view param ext


DDL INCLUDE MAPPED
DDLOPTIONS ADDTRANDATA RETRYOP RETRYDELAY 10 MAXRETRIES 10                     
DDLOPTIONS REPORT
REPORTROLLOVER AT 6:00
REPORTCOUNT EVERY 1 HOURS,RATE


在目标端加以下参数:

GGSCI (gd-pdb02) 2> view param rep


DDL INCLUDE MAPPED
DDLOPTIONS REPORT
DDLERROR 24344 IGNORE
DDLERROR 1435 IGNORE

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24996904/viewspace-1179743/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-09-14

  • 博文量
    76
  • 访问量
    415783