如何查看数据库中的job任务

在数据库的日常维护中会使用job来定期完成某些任务如何查看已经定义的job呢我们可以通过如下语句
SQL> col interval format a10
SQL> col log_user format a10
SQL> col segment_user format a10
SQL> col what format a40
SQL> select job,instance,interval,next_date,
  2  next_sec,failures,broken,log_user,priv_user,schema_user
  3  ,total_time,what
  4  from dba_jobs;
   JOB   INSTANCE INTERVAL   NEXT_DATE      NEXT_SEC           FAILURES B LOG_USER   PRIV_USER                      SCHEMA_USER                    TOTAL_TIME WHAT                                                                                                                                     
---------- ---------- ---------- -------------- ---------------- ---------- - ---------- ------------------------------ ------------------------------ ---------- ----------------------------------------
27   1 wk_job.nex 20-2月 -1101:00:00   N SYS  WKSYS WKSYS 0 wksys.wk_job.invoke(22,25);
                      t_time('DY0701')                 
26 1 wk_job.nex 16-2月 -11 14:00:00   0 N SYS WKSYS   WKSYS 123 wksys.wk_job.invoke(22,24);   
                      t_time('HH0001')                                               
4001 0 sysdate +  16-2月 -11 18:10:57  0 N SYS FLOWS_030000   FLOWS_030000  4 wwv_flow_cache.purge_sessions(p_purge_se8/24ss_older_then_hrs => 24);           
4002  0 sysdate +  16-2月 -11 13:51:19   0 N SYS  FLOWS_030000    FLOWS_030000  24 wwv_flow_mail.push_queue(wwv_flow_platfo10/1440 rm.get_preference('SMTP_HOST_ADDRESS'),wwv_flow_platform.get_preference('SMTP_HOST_PORT'));             
29   0 sysdate +  16-2月 -11 13:50:25  0 N SYSMAN     SYSMAN   SYSMAN 94 EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROC1/24 *S();                          
                      60)
 
SQL> desc dba_jobs
 名称                  描述
 -------------------- -------------------------------------------------------------------------------
 JOB                   job 的标识符                                                     
 LOG_USER             job 的拥有者                                             
 PRIV_USER            谁拥有默认权限来应用这个job                                            
 SCHEMA_USER                                                     
 LAST_DATE             job 上一次成功执行的时间                                                      
 LAST_SEC             job 上一次成功执行的那次job 开始执行的时间                                         
 THIS_DATE            job 这次现在开始执行的时间 如没有者为null          
 THIS_SEC             同上                                                    
 NEXT_DATE             job 下一次执行的时间                                      
 NEXT_SEC              同上
 TOTAL_TIME          进程运行的时间总量其值与系统中同时运行的进程数有关 单位 秒
 BROKEN               如果为y 表示终止job即使再次到达job的执行时间时job也执行。
 INTERVAL             一个时间函数
 FAILURES              job 失败的次数
 WHAT                  对job的描述
 NLS_ENV               alter session parameters describing the NLS environment of the job
 MISC_ENV              a versioned raw maintained by the kernel
 INSTANCE              Instance number restricted to run the job
SQL> select job,what from dba_jobs;
       JOB WHAT                                                                     
---------- ----------------------------------------                                    
        27 wksys.wk_job.invoke(22,25);                                               
        26 wksys.wk_job.invoke(22,24);                                               
      4001 wwv_flow_cache.purge_sessions(p_purge_sess_older_then_hrs => 24);
      4002 wwv_flow_mail.push_queue(wwv_flow_platform.get_preference('SMTP_HOST_ADDRESS'),                            wwv_flow_platform.get_preference('SMTP_HOST_PORT'));
        29 EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS();              
上一篇:快速排序Python实现


下一篇:收集最全的Joomla教材网站和joomla模板网站