zhangsharp20
作者zhangsharp20·2015-04-09 19:03
数据库运维工程师·外管

OGG-01387 【goldengate】表列数超过33个

字数 2730阅读 2357评论 0赞 0

近期在给一客户配置GoldenGate,在个表添加supplemental log时,即执行add trandata时,有大量的表报如下错误:

  1. GGSCI (racdb1) 148> add trandata ▇▇▇▇▇▇▇▇▇▇  
  2.   
  3. 2013-07-10 10:24:55  WARNING OGG-00869  No unique key is defined for table ▇▇▇▇▇▇▇▇▇▇'.   
  4. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.  
  5.   
  6. 2013-07-10 10:24:55  WARNING OGG-01387  Table ▇▇▇▇▇▇▇▇▇▇ has no valid key columns,   
  7. added unconditional supplemental log group for all table columns.  
  8.   
  9. Logging of supplemental redo log data is already enabled for table ▇▇▇▇▇▇▇▇▇▇.  


OGG-00869 是由于表不存在primary key或unique index所致,倒不会有太大影响。但OGG-01387错误引起了我的注意,不清楚其究竟,所以不敢忽略它,因此查询MOS得知,是因为该类的表的列的数量均超过了33列。

 

如果一张表,其列的数量超过33列(含),且没有primary key的话,则在执行add trandata命令时,会报OGG-01387错误,看提示说supplemental redo log data已经被启用,其实你查询 dba_log_group_columns可以得到验证。

 

实际情况是,这样的表存在200多个,确实挺恐怖的,有的表的列数高达200余个(不清楚这样的设计是不是存在缺陷?),于是我通过生成sql脚本的方式,给这些特殊的表启用supplemental redo log data。

 

举一个例子,如表 SCOTT.EMP存在超过33个列,且没有主键的话,那么手动添加supplemental redo log data的方法是:

  1. alter table scott.emp add supplemental log group ggs_emp_1(col1,col2,...,col33) always;  
  2.   
  3. add table scott.emp add supplemental log  group ggs_emp_2(col34,col35....) always;  


额外提供一个验证表supplemental log添加是否成功的语句:

  1. select owner,table_name  
  2.      from all_tables  
  3.     where owner in ('SCOTT')  
  4.       and table_name not in (select distinct table_name  
  5.                                from dba_log_group_columns  
  6.                               where owner in ('SCOTT'));  

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广