Main Note - Oracle GoldenGate - Supplemental Logging
来源:互联网 发布:抓取淘宝商品 编辑:程序博客网 时间:2024/06/07 14:19
The query below will tell you if Supplemental Logging is turned on at the database level:
select SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK,
SUPPLEMENTAL_LOG_DATA_UI, FORCE_LOGGING from v$database;
For a particular table, you can find if a Supplemental Log group has been created for a particular table with the query below. If it returns a row, Supplemental Logging is turned on. If it returns "no rows selected", then Supplemental Logging is not turned on.
select * from dba_log_groups
where OWNER='<schema_name_in_upper_case>' and
TABLE_NAME='<table_name_in_upper_case>';
For a particular table, you can find which columns are part of the Supplemental Log group with the query below:
select LOG_GROUP_NAME, COLUMN_NAME, POSITION from
dba_log_group_columns
where OWNER='<schema_name_in_upper_case>' and
TABLE_NAME='<table_name_in_upper_case>'
order by position;
For a particular table, you can find out if Supplemental Logging is turned on through GGSCI with the commands below:
GGSCI> dblogin userid <user>, password <pw>
GGSCI> info trandata <schema>.<table>
Question
Can I turn on the Oracle Supplemental Log at the DB Level only, without doing it at the Table Level?
Answer
GoldenGate requires adding Supplemental Logging at the Table Level, regardless of the Database Supplemental setting, due to issues with Multiple Unique Keys and/or lack of Keys.
It is highly recommended to use "ADD TRANDATA" under the GGSCI interface. If using the SQL command to add Supplemental Logging at the Table Level, ALL the keys should be included (ex. 2 separate Unique Keys are all required).
Question
Why does GoldenGate for Oracle require Supplemental Logging at the Database Level for Capture?
Answer
GoldenGate version 7.3.1 for Oracle 9i and above has enhanced the Log Based Capture. In the process, it became necessary to enable supplemental logging at the database level. By enabling this feature, Oracle adds in a few extra bytes of information into the redo logs for some DML operations.
How To Check The Supplemental Log Information In Oracle
There are two types of supplemental logging: database supplemental logging and table supplemental logging.
Database supplemental logging specifies supplemental logging for an entire database, while table supplemental logging enables you to specify log groups for supplemental logging for a particular table. If you use table supplemental logging, then you can choose between unconditional and conditional log groups.
Unconditional log groups log the before images of specified columns any time the table is updated, regardless of whether the update affected any of the specified columns. This is sometimes referred to as an ALWAYS log group. Conditional log groups log the before images of all specified columns only if at least one of the columns in the log group is updated.
Supplementing logging at the database level, unconditional log groups at the table level, and conditional log groups at the table level together determine which old values are logged in an update statement or piecewise LOB update.
To check whether one or more log groups are specified for the table at the source database, run the following query:
COLUMN LOG_GROUP_NAME HEADING 'Log Group' FORMAT A20
COLUMN TABLE_NAME HEADING 'Table' FORMAT A20
COLUMN ALWAYS HEADING 'Type of Log Group' FORMAT A30
SELECT
LOG_GROUP_NAME,
TABLE_NAME,
DECODE(ALWAYS,
'ALWAYS', 'Unconditional',
NULL, 'Conditional') ALWAYS
FROM DBA_LOG_GROUPS;
Your output looks similar to the following:
Log Group Table Type of Log Group
-------------------- -------------------- ------------------------------
LOG_GROUP_DEP_PK DEPARTMENTS Unconditional
LOG_GROUP_JOBS_CR JOBS Conditional
To list the columns in a particular log group, query the DBA_LOG_GROUP_COLUMNS data dictionary view. You can also query the V$DATABASE dynamic performance view to display supplemental logging specified at the database level.
The GoldenGate ADD TRANDATA command is equivelant to the following SQL statement,
alter table [TABLE_NAME] add supplemental log group [GROUP_NAME] ([COLUMN_LIST]) always;
The Group_name will usually be GGS_TABLENAME, the COLUMN_LIST is either the primary key columns or unique index columns, or if there is no primary key or unique index, it will be all columns.
The GoldenGate DELETE TRANDATA command is equivelant to the following SQL statement
alter table [TABLE_NAME] drop supplemental log group [GROUP_NAME]
To check the database level supplemental logging info
select supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui, force_logging from v$database;
GoldenGate needs at least "supplemental_log_data_min" to be YES to Extract chained row correctly from the Oracle redo log. See attached doc for the detail explain of what other options are.
Example:
SQL> SELECT LOG_GROUP_NAME,TABLE_NAME,DECODE(ALWAYS,'ALWAYS', 'Unconditional',NULL, 'Conditional') ALWAYS FROM DBA_LOG_GROUPS;
LOG_GROUP_NAME TABLE_NAME ALWAYS
------------------------------ ------------------------------ -------------
ENC$_LOG_GRP ENC$ Unconditional
GGS_TCUSTMER_74729 TCUSTMER Unconditional
SQL> select * from dba_log_group_columns where table_name='TCUSTMER';
OWNER LOG_GROUP_NAME
------------------------------ ------------------------------
TABLE_NAME
------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
POSITION LOGGIN
---------- ------
SYSTEM GGS_TCUSTMER_74729
TCUSTMER
CUST_CODE
1 LOG
SQL>
select SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK,
SUPPLEMENTAL_LOG_DATA_UI, FORCE_LOGGING from v$database;
For a particular table, you can find if a Supplemental Log group has been created for a particular table with the query below. If it returns a row, Supplemental Logging is turned on. If it returns "no rows selected", then Supplemental Logging is not turned on.
select * from dba_log_groups
where OWNER='<schema_name_in_upper_case>' and
TABLE_NAME='<table_name_in_upper_case>';
For a particular table, you can find which columns are part of the Supplemental Log group with the query below:
select LOG_GROUP_NAME, COLUMN_NAME, POSITION from
dba_log_group_columns
where OWNER='<schema_name_in_upper_case>' and
TABLE_NAME='<table_name_in_upper_case>'
order by position;
For a particular table, you can find out if Supplemental Logging is turned on through GGSCI with the commands below:
GGSCI> dblogin userid <user>, password <pw>
GGSCI> info trandata <schema>.<table>
Question
Can I turn on the Oracle Supplemental Log at the DB Level only, without doing it at the Table Level?
Answer
GoldenGate requires adding Supplemental Logging at the Table Level, regardless of the Database Supplemental setting, due to issues with Multiple Unique Keys and/or lack of Keys.
It is highly recommended to use "ADD TRANDATA" under the GGSCI interface. If using the SQL command to add Supplemental Logging at the Table Level, ALL the keys should be included (ex. 2 separate Unique Keys are all required).
Question
Why does GoldenGate for Oracle require Supplemental Logging at the Database Level for Capture?
Answer
GoldenGate version 7.3.1 for Oracle 9i and above has enhanced the Log Based Capture. In the process, it became necessary to enable supplemental logging at the database level. By enabling this feature, Oracle adds in a few extra bytes of information into the redo logs for some DML operations.
How To Check The Supplemental Log Information In Oracle
There are two types of supplemental logging: database supplemental logging and table supplemental logging.
Database supplemental logging specifies supplemental logging for an entire database, while table supplemental logging enables you to specify log groups for supplemental logging for a particular table. If you use table supplemental logging, then you can choose between unconditional and conditional log groups.
Unconditional log groups log the before images of specified columns any time the table is updated, regardless of whether the update affected any of the specified columns. This is sometimes referred to as an ALWAYS log group. Conditional log groups log the before images of all specified columns only if at least one of the columns in the log group is updated.
Supplementing logging at the database level, unconditional log groups at the table level, and conditional log groups at the table level together determine which old values are logged in an update statement or piecewise LOB update.
To check whether one or more log groups are specified for the table at the source database, run the following query:
COLUMN LOG_GROUP_NAME HEADING 'Log Group' FORMAT A20
COLUMN TABLE_NAME HEADING 'Table' FORMAT A20
COLUMN ALWAYS HEADING 'Type of Log Group' FORMAT A30
SELECT
LOG_GROUP_NAME,
TABLE_NAME,
DECODE(ALWAYS,
'ALWAYS', 'Unconditional',
NULL, 'Conditional') ALWAYS
FROM DBA_LOG_GROUPS;
Your output looks similar to the following:
Log Group Table Type of Log Group
-------------------- -------------------- ------------------------------
LOG_GROUP_DEP_PK DEPARTMENTS Unconditional
LOG_GROUP_JOBS_CR JOBS Conditional
To list the columns in a particular log group, query the DBA_LOG_GROUP_COLUMNS data dictionary view. You can also query the V$DATABASE dynamic performance view to display supplemental logging specified at the database level.
The GoldenGate ADD TRANDATA command is equivelant to the following SQL statement,
alter table [TABLE_NAME] add supplemental log group [GROUP_NAME] ([COLUMN_LIST]) always;
The Group_name will usually be GGS_TABLENAME, the COLUMN_LIST is either the primary key columns or unique index columns, or if there is no primary key or unique index, it will be all columns.
The GoldenGate DELETE TRANDATA command is equivelant to the following SQL statement
alter table [TABLE_NAME] drop supplemental log group [GROUP_NAME]
To check the database level supplemental logging info
select supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui, force_logging from v$database;
GoldenGate needs at least "supplemental_log_data_min" to be YES to Extract chained row correctly from the Oracle redo log. See attached doc for the detail explain of what other options are.
Example:
SQL> SELECT LOG_GROUP_NAME,TABLE_NAME,DECODE(ALWAYS,'ALWAYS', 'Unconditional',NULL, 'Conditional') ALWAYS FROM DBA_LOG_GROUPS;
LOG_GROUP_NAME TABLE_NAME ALWAYS
------------------------------ ------------------------------ -------------
ENC$_LOG_GRP ENC$ Unconditional
GGS_TCUSTMER_74729 TCUSTMER Unconditional
SQL> select * from dba_log_group_columns where table_name='TCUSTMER';
OWNER LOG_GROUP_NAME
------------------------------ ------------------------------
TABLE_NAME
------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
POSITION LOGGIN
---------- ------
SYSTEM GGS_TCUSTMER_74729
TCUSTMER
CUST_CODE
1 LOG
SQL>
0 0
- Main Note - Oracle GoldenGate - Supplemental Logging
- Inside Oracle supplemental logging
- oracle 开启supplemental logging
- 【翻译自mos文章】Main Note - ogg的 Supplemental Logging and TRANDATA
- 深入认识Oracle Supplemental logging
- 深入认识Oracle Supplemental logging
- 深入认识Oracle Supplemental logging
- 深入认识Oracle Supplemental logging
- Supplemental Logging
- Oracle 补充日志(Supplemental Logging)说明
- Supplemental Logging介绍
- Oracle supplemental log 作用
- oracle supplemental log 作用
- GoldenGate 是否需要 force logging:Oracle Force logging 和 Nologging 模式详解
- Oracle 附加日志(supplemental log)
- Oracle 附加日志(supplemental log)
- Oracle 附加日志(supplemental log)
- Oracle Goldengate
- 超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。
- 关于apache代理报错error reading status line from remote server
- CentOS7 Puppet安装脚本小结
- 在一个jsp页面引用另一个jsp页面的方式
- Patrick and Shopping
- Main Note - Oracle GoldenGate - Supplemental Logging
- 64位Win7下用VS2010编译OpenSSL
- iOS UITableView(十四) 设置TbleviewController的滚动范围
- 【网络流之最小割模型】poj3469 BZOJ3144 UVA1212
- Java WebSocket实现网络聊天室(群聊+私聊)
- unity初学(基本的方法)
- 详解 PHP 的引用
- NSUserDefaults -- 写读&配置
- 在拓胜培训Java,每天的点点滴滴。