Bo's Oracle Station

查看: 2577|回复: 0

活动第47/48次(2018-08-11星期六上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-8-11 09:41:02 | 显示全部楼层 |阅读模式
作业组:
  1. DECLARE
  2.     versionnum VARCHAR2(30);
  3.     BEGIN
  4.     versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('station86');
  5.     DBMS_OUTPUT.PUT_LINE(versionnum);
  6.     END;
  7.    
  8.     select  * from dba_scheduler_external_dests;
  9.    

  10.    
  11.   BEGIN
  12.   DBMS_SCHEDULER.create_group(
  13.     group_name    => 'hr.group1',
  14.     group_type    => 'EXTERNAL_DEST',
  15.      member => 'sys.credential1@LOCAL,sys.credential1@sys.STATION86'
  16.     );
  17. END;

  18. select  * from dba_scheduler_groups g where g.group_name='GROUP1';
  19. select  * from dba_scheduler_group_members gm where gm.group_name='GROUP1';

  20. grant all on group1 to hr;
复制代码
界面点出来的代码:
  1. BEGIN
  2. sys.dbms_scheduler.create_job(
  3. job_name => '"HR"."JOB14"',
  4. job_type => 'EXECUTABLE',
  5. job_action => '/home/oracle/helloworld.sh',
  6. repeat_interval => 'FREQ=SECONDLY;INTERVAL=30',
  7. start_date => systimestamp at time zone 'Asia/Shanghai',
  8. end_date => to_timestamp_tz('2018-08-11 10:00:00 Asia/Shanghai', 'YYYY-MM-DD HH24:MI:SS TZR'),
  9. job_class => '"DEFAULT_JOB_CLASS"',
  10. comments => 'JOB14',
  11. auto_drop => FALSE,
  12. enabled => FALSE);
  13. DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB14"', attribute => 'destination', value => 'HR。GROUP1' );
  14. DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB14"', attribute => 'credential_name', value => '"SYS"."CREDENTIAL1"' );
  15. sys.dbms_scheduler.enable( '"HR"."JOB14"' );
  16. END;
复制代码
改成:
  1. BEGIN
  2. sys.dbms_scheduler.create_job(
  3. job_name => '"HR"."JOB14"',
  4. job_type => 'EXECUTABLE',
  5. job_action => '/home/oracle/helloworld.sh',
  6. start_date => systimestamp at time zone 'Asia/Shanghai',
  7. end_date => to_timestamp_tz('2018-08-11 10:00:00 Asia/Shanghai', 'YYYY-MM-DD HH24:MI:SS TZR'),
  8. job_class => '"DEFAULT_JOB_CLASS"',
  9. comments => 'JOB14',
  10. auto_drop => FALSE,
  11. credential_name =>'"SYS"."CREDENTIAL1"' ,destination_name =>'HR.GROUP1' ,
  12. enabled => true);
  13. END;
复制代码
1.png







回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-23 18:23 , Processed in 0.048753 second(s), 27 queries .

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