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 ;