ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 4、启动、停止和删除STREAM

4、启动、停止和删除STREAM

原创 Linux操作系统 作者:tcczxhj 时间:2009-03-06 16:52:20 0 删除 编辑

4、启动、停止和删除STREAM

4.1 启动

4.1.1 Tccz上启动 Apply Process

CONNECT strmadmin/strmadmin
BEGIN
DBMS_APPLY_ADM.SET_PARAMETER(
apply_name => 'apply_tccz',
parameter   => 'disable_on_error',
value       => 'n');
END;
/

BEGIN
DBMS_APPLY_ADM.START_APPLY(
apply_name => 'apply_tccz');
END;
/

 

[验证]

select apply_name,queue_name,status from dba_apply;

APPLY_NAME                   QUEUE_NAME               STATUS
------------------------------ --------------------------      --------
APPLY_TCCZ            STREAMS_QUEUE         ENABLED

 

----alert log中找到如下信息(非本人实验所得,借用高手资料)

Thu Jun 12 18:00:36 2008
Streams APPLY A001 started with pid=25, OS id=30819
Streams Apply Reader started P000 with pid=26 OS id=30821
Streams Apply Server started P001 with pid=27 OS id=30823

如果有问题,没有能启动就查dba_applyerror_messages

4.1.2 tczf上启动capture process:

sqlplus strmadmin/strmadmin
BEGIN
DBMS_CAPTURE_ADM.START_CAPTURE(
capture_name => 'capture_tczf');
END;
/

 

[验证]

select capture_name,status from dba_capture;

CAPTURE_NAME              STATUS
------------------------------    ------------
CAPTURE_TCZF       ENABLED

 

----alert log中找到信息,说明已经开始mining logfile.(非本人实验所得,借用高手资料)

Thu Jun 12 18:04:46 2008
Streams CAPTURE C001 started with pid=27, OS id=11884
Thu Jun 12 18:04:49 2008
LOGMINER: Parameters summary for session# = 1
LOGMINER: Number of processes = 3, Transaction Chunk Size = 1
LOGMINER: Memory Size = 10M, Checkpoint interval = 10M
LOGMINER: session# = 1, builder process P001 started with pid=32 OS id=11966
LOGMINER: session# = 1, reader process P000 started with pid=29 OS id=11964
LOGMINER: session# = 1, preparer process P002 started with pid=33 OS id=11968
Thu Jun 12 18:04:53 2008
LOGMINER: Begin mining logfile: /u01/oradata/tczf_arch/1_13_657197948.dbf
Thu Jun 12 18:06:40 2008
Thread 1 advanced to log sequence 15
Current log# 2 seq# 15 mem# 0: /u01/oradata/tczf/redo02.log
Thu Jun 12 18:06:53 2008
Thread 1 advanced to log sequence 16
Current log# 3 seq# 16 mem# 0: /u01/oradata/tczf/redo03.log
...
LOGMINER: Begin mining logfile: /u01/oradata/tczf_arch/1_13_657197948.dbf
Thu Jun 12 18:07:34 2008
LOGMINER: End mining logfile: /u01/oradata/tczf_arch/1_13_657197948.dbf
Thu Jun 12 18:07:34 2008
LOGMINER: Begin mining logfile: /u01/oradata/tczf_arch/1_14_657197948.dbf

 

#至此,整个配置完成。现在可以操作主库,再到从库上验证更改了。当然,数据同步的时间间隔跟性能及其它情况有关,包括: capture mining logfile的速度,propagation的间隔(默认3)及传输时间,apply log的速度。

 

4.2 停止 

#strmadmin身份,分别登录主从数据库。

connect strmadmin/strmadmin@tczf

Begin

dbms_capture_adm.stop_capture(capture_name => 'capture_tczf');

end;

/
connect strmadmin/strmadmin@tccz
begin
dbms_apply_adm.stop_apply(apply_name => 'apply_tccz');
end;
/

 

4.3 清除配置信息

  #要清除Stream配置信息,需要先执行4.2,停止Stream进程。主从库均执行:

connect strmadmin/strmadmin
exec DBMS_STREAMS_ADM.remove_streams_configuration();

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

上一篇: 3、设置STREAM
下一篇: 5、问题诊断
请登录后发表评论 登录
全部评论

注册时间:2009-03-06

  • 博文量
    47
  • 访问量
    100542