|
管理端:
- grant create job to hr;
- --grant create external job to hr;
- select * from dba_scheduler_credentials;
- begin
- dbms_scheduler.create_credential('credential13','HR','oracle_4U');
- end;
- /
- grant execute on credential13 to hr;
- select * from dba_scheduler_external_dests;
- set serveroutput on
- DECLARE
- versionnum VARCHAR2(30);
- BEGIN
- versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('CLASSROOM');
- DBMS_OUTPUT.PUT_LINE(versionnum);
- END;
- /
- begin
- dbms_scheduler.create_database_destination(
- destination_name => 'orcl2',
- agent => 'CLASSROOM',tns_name => 'orcl2');
- end;
- /
- select * from dba_scheduler_db_dests;
- grant all on orcl2 to hr;
- BEGIN
- sys.dbms_scheduler.create_job(
- job_name => '"HR"."JOB13"',
- program_name => '"HR"."PROGRAM13"',
- schedule_name => '"HR"."SCHEDULE13"',
- job_class => '"DEFAULT_JOB_CLASS"',
- auto_drop => FALSE,
- enabled => true,
- credential_name =>'SYS.CREDENTIAL13' ,
- destination_name =>'SYS.ORCL2'
- );
- END;
- /
复制代码
受控端:
- [oracle@classroom bin]$ ./schagent -stop
复制代码- [oracle@classroom bin]$ ./schagent -registerdatabase 192.168.0.254 8888
复制代码- [oracle@classroom bin]$ ./schagent -start
复制代码- [oracle@classroom bin]$ netstat -lntp | grep :1025
复制代码
|
|