|
本帖最后由 botang 于 2014-12-30 12:47 编辑
- select * from dba_services;
- select * from dba_scheduler_job_classes c where c.job_class_name='JOBCLASS2' ;
- grant execute on jobclass2 to hr;
- select * from dba_scheduler_running_jobs;
- select * from gv$session where username='HR';
- select * from gv$process where addr='50FF2D78';
- select * from dba_services;
- begin
- dbms_service.delete_service('xexample');
- end;
-
- begin
- dbms_service.modify_service(
-
- service_name => 'xexample',
- goal => dbms_service.goal_service_time,dtp => false,aq_ha_notifications => true,failover_method => 'BASIC',
- failover_type => 'SELECT',failover_retries => 180,failover_delay=> 1,clb_goal => dbms_service.clb_goal_short);
-
- end;
-
- begin
- dbms_scheduler.run_job(job_name => 'HR.JOB_I');
- end;
- ---
- create table t05317_lw( a number ) ;
- alter table t05317_lw modify ( a date ) ;
- create or replace procedure proc05317_lw
- is
- begin
- insert into t05317_lw values(sysdate);
- commit;
- end;
- begin
- dbms_scheduler.create_program(program_name => 'PROGLW',program_type => 'STORED_PROCEDURE',program_action => 'proc05317_lw');
- end;
-
-
- select * from t05317_lw;
- begin
- dbms_scheduler.create_job(
- job_name => 'lwjob',
- program_name=>'proglw',
- schedule_name=>'schedulelw',
- job_style=>'LIGHTWEIGHT');
- end;
-
- select * from dba_scheduler_jobs j where j.JOB_STYLE <> 'REGULAR';
-
-
- ----
-
- DECLARE
- newjob sys.job;
- newjobarr sys.job_array;
- BEGIN
- -- Create an array of JOB object types
- newjobarr := sys.job_array();
- -- Allocate sufficient space in the array
- newjobarr.extend(1000);
- -- Add definitions for jobs
- FOR i IN 1..1000 LOOP
- -- Create a JOB object type
- newjob := sys.job(job_name => 'LWTJK' || to_char(i),
- job_style => 'LIGHTWEIGHT',
- job_template => 'proglw',
- enabled => TRUE );
- -- Add job to the array
- newjobarr(i) := newjob;
- END LOOP;
- -- Call CREATE_JOBS to create jobs in one transaction
- DBMS_SCHEDULER.CREATE_JOBS(newjobarr, 'TRANSACTIONAL');
- END;
-
-
-
复制代码
|
|