ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 几个查询streams环境下capture和apply状态的视图

几个查询streams环境下capture和apply状态的视图

原创 Linux操作系统 作者:lsq_008 时间:2011-08-22 15:20:31 0 删除 编辑

-----目标端apply情况

Set lines 132

col apply_name for a15

col source_database for a15

select apply_name,source_database,applied_message_number,oldest_message_number,apply_time from dba_apply_progress;

 

----源端capture情况

set lines 132

col session_name for a20

col capture_name for a15

col sid for 999

col logminer_id for 999

col state for a20

 

select * from  gv$logmnr_session order by session_name;

Select session_id,session_name,session_state,num_process,start_scn,spill_scn,processed_scn,low_mark_scn,consumed_scn from gv$logmnr_session;

 

select capture_name,queue_name,status,applied_scn,captured_scn,start_scn from dba_capture;

 

select sid,serial#,capture_name,logminer_id,state,CAPTURE_TIME ,CAPTURE_MESSAGE_NUMBER,ENQUEUE_MESSAGE_NUMBER from gv$streams_capture

 

 

---这个CAPTURE_MESSAGE_NUMBER是在不断增加的,基本上接近系统的scn号,而ENQUEUE_MESSAGE_NUMBER是只有在捕捉到变化时才会增加


SQL> select sid,serial#,capture_name,logminer_id,state,CAPTURE_TIME ,CAPTURE_MESSAGE_NUMBER,ENQUEUE_MESSAGE_NUMBER from gv$streams_capture;


 SID    SERIAL# CAPTURE_NAME    LOGMINER_ID STATE                CAPTURE_T CAPTURE_MESSAGE_NUMBER ENQUEUE_MESSAGE_NUMBER

---- ---------- --------------- ----------- -------------------- --------- ---------------------- ----------------------

  40          1 CAPTURE_XJNY             42 CAPTURING CHANGES    22-AUG-11                 383799                 383544


SQL> delete from scott.t2 where rownum=1;


1 row deleted.


SQL> commit;


Commit complete.


SQL> select sid,serial#,capture_name,logminer_id,state,CAPTURE_TIME ,CAPTURE_MESSAGE_NUMBER,ENQUEUE_MESSAGE_NUMBER from gv$streams_capture;


 SID    SERIAL# CAPTURE_NAME    LOGMINER_ID STATE                CAPTURE_T CAPTURE_MESSAGE_NUMBER ENQUEUE_MESSAGE_NUMBER

---- ---------- --------------- ----------- -------------------- --------- ---------------------- ----------------------

  40          1 CAPTURE_XJNY             42 CAPTURING CHANGES    22-AUG-11                 383830                 383830


SQL> /


 SID    SERIAL# CAPTURE_NAME    LOGMINER_ID STATE                CAPTURE_T CAPTURE_MESSAGE_NUMBER ENQUEUE_MESSAGE_NUMBER

---- ---------- --------------- ----------- -------------------- --------- ---------------------- ----------------------

  40          1 CAPTURE_XJNY             42 CAPTURING CHANGES    22-AUG-11                 383840                 383830


SQL> /


 SID    SERIAL# CAPTURE_NAME    LOGMINER_ID STATE                CAPTURE_T CAPTURE_MESSAGE_NUMBER ENQUEUE_MESSAGE_NUMBER

---- ---------- --------------- ----------- -------------------- --------- ---------------------- ----------------------

  40          1 CAPTURE_XJNY             42 CAPTURING CHANGES    22-AUG-11                 383992                 383855


SQL> /


 SID    SERIAL# CAPTURE_NAME    LOGMINER_ID STATE                CAPTURE_T CAPTURE_MESSAGE_NUMBER ENQUEUE_MESSAGE_NUMBER

---- ---------- --------------- ----------- -------------------- --------- ---------------------- ----------------------

  40          1 CAPTURE_XJNY             42 CAPTURING CHANGES    22-AUG-11                 383996                 383855


SQL> /


 SID    SERIAL# CAPTURE_NAME    LOGMINER_ID STATE                CAPTURE_T CAPTURE_MESSAGE_NUMBER ENQUEUE_MESSAGE_NUMBER

---- ---------- --------------- ----------- -------------------- --------- ---------------------- ----------------------

  40          1 CAPTURE_XJNY             42 CAPTURING CHANGES    22-AUG-11                 383996                 383855


SQL> /


 SID    SERIAL# CAPTURE_NAME    LOGMINER_ID STATE                CAPTURE_T CAPTURE_MESSAGE_NUMBER ENQUEUE_MESSAGE_NUMBER

---- ---------- --------------- ----------- -------------------- --------- ---------------------- ----------------------

  40          1 CAPTURE_XJNY             42 CAPTURING CHANGES    22-AUG-11                 383996                 383855


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

请登录后发表评论 登录
全部评论
十余年大型金融及电信系统数据库管理经验,曾服务于中国建设银行、中国移动。对oracle,mysql数据库有深入了解。 擅长python开发,独立开发了开源数据库自动化监控运维平台Power Monitor。

注册时间:2008-02-29

  • 博文量
    325
  • 访问量
    1255335