Bo's Oracle Station

查看: 1750|回复: 0

第80次:2014-12-29

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2014-12-30 10:48:40 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2014-12-30 12:47 编辑
  1. select  * from dba_services;

  2. select * from dba_scheduler_job_classes c  where c.job_class_name='JOBCLASS2' ;

  3. grant execute on jobclass2 to hr;

  4. select  * from dba_scheduler_running_jobs;

  5. select  * from gv$session where username='HR';

  6. select *  from gv$process where addr='50FF2D78';

  7. select * from dba_services;

  8. begin
  9.    dbms_service.delete_service('xexample');
  10. end;




  11. begin
  12.    dbms_service.modify_service(
  13.    
  14.    service_name => 'xexample',
  15.    goal => dbms_service.goal_service_time,dtp => false,aq_ha_notifications => true,failover_method => 'BASIC',
  16.            failover_type => 'SELECT',failover_retries => 180,failover_delay=> 1,clb_goal => dbms_service.clb_goal_short);
  17.            
  18.           end;
  19.    

  20. begin
  21.    dbms_scheduler.run_job(job_name => 'HR.JOB_I');
  22.   end;

  23. ---


  24. create table t05317_lw( a  number ) ;

  25. alter table t05317_lw  modify ( a date ) ;

  26. create or replace procedure  proc05317_lw
  27. is
  28. begin
  29.    insert into  t05317_lw values(sysdate);
  30.    commit;
  31. end;

  32. begin
  33.    dbms_scheduler.create_program(program_name => 'PROGLW',program_type => 'STORED_PROCEDURE',program_action => 'proc05317_lw');
  34.   end;
  35.   

  36.   
  37. select  * from   t05317_lw;

  38. begin
  39.    dbms_scheduler.create_job(
  40.    job_name => 'lwjob',
  41.    program_name=>'proglw',
  42.    schedule_name=>'schedulelw',
  43.    job_style=>'LIGHTWEIGHT');
  44. end;

  45. select  * from dba_scheduler_jobs j where j.JOB_STYLE <> 'REGULAR';


  46. ----

  47. DECLARE
  48.     newjob sys.job;
  49.      newjobarr sys.job_array;
  50. BEGIN
  51. -- Create an array of JOB object types
  52.      newjobarr := sys.job_array();
  53. -- Allocate sufficient space in the array
  54.       newjobarr.extend(1000);
  55. -- Add definitions for jobs
  56.      FOR i IN 1..1000 LOOP
  57.    -- Create a JOB object type
  58.      newjob := sys.job(job_name => 'LWTJK' || to_char(i),
  59.                      job_style => 'LIGHTWEIGHT',
  60.                      job_template => 'proglw',
  61.                          enabled => TRUE );
  62. -- Add job to the array
  63.          newjobarr(i) := newjob;
  64. END LOOP;
  65. -- Call CREATE_JOBS to create jobs in one transaction
  66. DBMS_SCHEDULER.CREATE_JOBS(newjobarr, 'TRANSACTIONAL');
  67. END;





复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-25 11:17 , Processed in 0.040314 second(s), 24 queries .

快速回复 返回顶部 返回列表