|
作业组:
- DECLARE
- versionnum VARCHAR2(30);
- BEGIN
- versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('station86');
- DBMS_OUTPUT.PUT_LINE(versionnum);
- END;
-
- select * from dba_scheduler_external_dests;
-
-
- BEGIN
- DBMS_SCHEDULER.create_group(
- group_name => 'hr.group1',
- group_type => 'EXTERNAL_DEST',
- member => 'sys.credential1@LOCAL,sys.credential1@sys.STATION86'
- );
- END;
- select * from dba_scheduler_groups g where g.group_name='GROUP1';
- select * from dba_scheduler_group_members gm where gm.group_name='GROUP1';
-
- grant all on group1 to hr;
-
复制代码 界面点出来的代码:
- BEGIN
- sys.dbms_scheduler.create_job(
- job_name => '"HR"."JOB14"',
- job_type => 'EXECUTABLE',
- job_action => '/home/oracle/helloworld.sh',
- repeat_interval => 'FREQ=SECONDLY;INTERVAL=30',
- start_date => systimestamp at time zone 'Asia/Shanghai',
- end_date => to_timestamp_tz('2018-08-11 10:00:00 Asia/Shanghai', 'YYYY-MM-DD HH24:MI:SS TZR'),
- job_class => '"DEFAULT_JOB_CLASS"',
- comments => 'JOB14',
- auto_drop => FALSE,
- enabled => FALSE);
- DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB14"', attribute => 'destination', value => 'HR。GROUP1' );
- DBMS_SCHEDULER.SET_ATTRIBUTE(name => '"HR"."JOB14"', attribute => 'credential_name', value => '"SYS"."CREDENTIAL1"' );
- sys.dbms_scheduler.enable( '"HR"."JOB14"' );
- END;
复制代码 改成:
- BEGIN
- sys.dbms_scheduler.create_job(
- job_name => '"HR"."JOB14"',
- job_type => 'EXECUTABLE',
- job_action => '/home/oracle/helloworld.sh',
- start_date => systimestamp at time zone 'Asia/Shanghai',
- end_date => to_timestamp_tz('2018-08-11 10:00:00 Asia/Shanghai', 'YYYY-MM-DD HH24:MI:SS TZR'),
- job_class => '"DEFAULT_JOB_CLASS"',
- comments => 'JOB14',
- auto_drop => FALSE,
- credential_name =>'"SYS"."CREDENTIAL1"' ,destination_name =>'HR.GROUP1' ,
- enabled => true);
- END;
复制代码
|
|