小工具知识网

当前位置: 首页 > 行业知识 > dba

行业知识

dba

2026-11-13 02:39:26 来源:互联网转载

�index.php/tags-41973.html" >�                               

()

                                           

                                           

()

                                           

 

SQL>begin

dbms_scheduler.create_job (

job_name => 'test_job',

job_type => 'plsql_block',

job_action => 'null;',

enabled => true);

end;

/

SQL> -- wait a while

SQL>

select * from dba_scheduler_jobs where job_name='TEST_JOB';

select * from dba_scheduler_job_run_details where job_name='TEST_JOB';

select owner, job_name, job_style, job_creator,job_action, start_date, repeat_interval,last_start_date, last_run_duration, next_run_date,comments ,instance_id 

from DBA_SCHEDULER_JOBS  a  where job_name='TEST_JOB';

begin

dbms_scheduler.create_job(

        job_name        => 'TEST_JOB',

        job_type        => 'plsql_block',

        job_action      => 'null',

        start_date      => systimestamp,

        repeat_interval => 'freq=secondly; interval=5',

        end_date    => null,

        enabled         => true

      );

 END  ;

 

 

 

begin  dbms_scheduler.set_attribute(name     => 'TEST_JOB'

                                           ,attribute => 'INSTANCE_ID'

                                           ,VALUE    => '');------重置为NULL

end;

begin  dbms_scheduler.set_attribute(name     => 'TEST_JOB'

                                           ,attribute => 'INSTANCE_ID'

                                           ,VALUE    => '3');

end;

select owner, job_name, job_style, job_creator,job_action, start_date, repeat_interval,last_start_date, last_run_duration, next_run_date,comments ,instance_id 

from DBA_SCHEDULER_JOBS  a  where job_name='TEST_JOB';

 

 

begin

dbms_scheduler.run_job( 'TEST_JOB',FALSE); ---use another session

END  ;

begin

dbms_scheduler.drop_job( 'TEST_JOB' );

END  ;

上一篇:【MySQL】如何运行sql文件(以Navicat做演示)

下一篇:轻松学会魔盒下载秘籍,一键下载无障碍!