从开始配置、测试一直到部署stream,到现在快1个月了,期间遇到了很多问题,最终一一解决了,在此记录一些有用的排错、查询语句,以备后用:
---- 相关查询语句
select propagation_name as name,status,ERROR_MESSAGE from dba_propagation
union all
select CAPTURE_NAME,status,ERROR_MESSAGE from dba_capture
union all
SELECT apply_name,status,error_message from dba_apply;
select * from dba_apply_parameters;
select * from dba_capture_parameters;
select * from dba_propagation;
select * from dba_capture;
select * from v$streams_capture;
---- update冲突更新解决相关
select 'DECLARE
cols DBMS_UTILITY.NAME_ARRAY;
BEGIN
cols(1) := ''' || column_name || ''';
DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER(object_name => ''MYNET_APP.' ||
table_name ||
''', method_name => ''OVERWRITE'',resolution_column => ''' ||
column_name || ''',column_list => cols);
END;
/'
from all_tab_columns
where owner='MYDB_APP';
---- 忽略apply报错的相关语句
正式库上的某些应用、修改,可能会导致downstream数据库apply进程abort掉,无关紧要的错误,完全可以忽略掉:
select 'execute dbms_apply_adm.set_parameter('||''''||'APPLY$_YESMYDB_576'||''''||','||''''||'_ignore_transaction'||''''||','||''''||local_transaction_id||''''||');'
from dba_apply_error where error_message like 'ORA-%' ORDER BY error_creation_time desc;
---- 取消某些表的capture操作
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES (
table_name => 'MYNETDB.MK_TA_RESULT',
streams_type => 'capture',
streams_name => 'YESMYDB$CAP',
queue_name => 'STRMADMIN.YESMYDB$CAPQ',
include_dml => true,
include_ddl => true,
source_database => 'YESMYDB',
inclusion_rule => false ); --specifies the negative rule set
END;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25618347/viewspace-712080/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25618347/viewspace-712080/