1. 清除Streams复制环境
当不需要复制并要清除 Stream配置信息时,需要先执行停止Stream相关进程然后再清除配置。
以strmadmin身份,登录源数据库。
SQL>connect strmadmin/strmadmin
SQL>exec dbms_capture_adm.stop_capture("capture_streams");
SQL>exec dbms_propagation_adm.stop_propagation("orcl_to_orclbak");
SQL>exec DBMS_STREAMS_ADM.remove_streams_configuration();
以strmadmin身份,登录从数据库。
SQL>connect strmadmin/strmadmin
SQL>exec dbms_apply_adm.stop_apply("apply_streams");
SQL>exec DBMS_STREAMS_ADM.remove_streams_configuration();
2. 查询捕获进程状态信息
SQL>select capture_name,status from dba_capture;
SQL>exec dbms_capture_adm.stop_capture("capture_streams"); #停止捕获进程
SQL>exec dbms_capture_adm.drop_capture("capture_streams"); #移除生成的捕获进程
3. 查询应用进程状态信息
SQL>select apply_name,status from dba_apply;
4. 查询应用进程错误信息
SQL>select error_message from DBA_APPLY_ERROR;
5. 查询生成的应用进程名及相关信息
SQL>select apply_name,queue_name,status from dba_apply;
SQL>exec dbms_apply_adm.stop_apply("apply_streams"); #停止应用进程
SQL>exec dbms_apply_adm.drop_apply("apply_streams"); #移除生成的应用进程
6. 查询生成的传播进程名及相关信息
SQL>select PROPAGATION_NAME,STATUS from dba_propagation;
SQL>exec dbms_propagation_adm.stop_propagation("orcl_to_orclbak"); #停止传播进程
SQL>exec dbms_propagation_adm.drop_propagation("orcl_to_orclbak"); #移除生成的传播进程
7. 查询/移除生成的队列名
SQL>select owner,queue_table,name from dba_queues where owner='STRMADMIN'; #查询生成的队列名
SQL>exec
dbms_streams_adm.remove_queue(queue_name => 'ORCLBAK_QUEUE',cascade
=> true,drop_unused_queue_table => true); #移除生成的队列,不需要的时候执行
8. 修改global_name
SQL>select * from global_name; #查看global_name
SQL>update props$ set value$ = 'orcl.jss.cn' where name = 'GLOBAL_DB_NAME'; #修改global_name
或
SQL> alter database rename global_name to 'orcl.jss.cn';
9. DB Link查看与删除
SQL>SELECT * FROM DBA_DB_LINKS ; #查看所有links
SQL>DROP database link link_name ; #删除
10. Streams配置和管理相关package
dbms_steams_adm
dbms_capture_adm
dbms_propagation_adm
dbms_apply_adm
dbms_rule_ad
11. Streams主要相关数据字典
dba_streams_administrator
dba_capture
dba_capture_parameters
dba_propagation
dba_registered_archived_log
dba_apply
dba_apply_confict_columns
dba_apply_dml_handlers
dba_apply_enqueue
dba_apply_error
dba_apply_execute
dba_apply_parameters
dba_apply_progress
dba_rules
dba_rule_sets
dba_rule_set_rules
V$STREAMS_CAPTURE
V$STREAMS_POOL_ADVICE
V$STREAMS_TRANSACTION
V$PROPAGATION_RECEIVER
V$PROPAGATION_SENDER
V$STREAMS_APPLY_COORDINATOR
V$STREAMS_APPLY_READER
V$STREAMS_APPLY_SERVER
12. 相关错误字典
a). 相关错误字典
DBA_RECOVERABLE_SCRIPT:配置脚本概要信息
DBA_RECOVERABLE_SCRIPT_PARAMS:配置脚本参数
DBA_RECOVERABLE_SCRIPT_ERRORS:执行过程中的错误信息
DBA_RECOVERABLE_SCRIPT_BLOCKS:配置脚本的详细步骤
b).重新执行/回滚/清除Streams脚本
begin
dbms_streams_adm.recover_operation(
script_id => 'D74179203F11445D8F3F3F77C0749A1D',
operation_mode => 'FORWARD'); #重新执行:FORWARD 回滚:ROLLBACK 清除:PURGE
end;
/