|
本帖最后由 botang 于 2014-11-27 16:04 编辑
- select * from dba_scheduler_credentials;
- begin
- dbms_scheduler.create_credential(
- credential_name => 'credlocalfw',
- username => 'oracle',
- password => 'oracle');
- end;
- grant execute on credlocalfw to hr;
- begin
- dbms_scheduler.create_file_watcher(
- file_watcher_name => 'filewlocal',
- directory_path => '/home/oracle/dirfw',
- file_name => 'botang*.txt',
- credential_name => 'credlocalfw');
- end;
- ----------------------------------
- select * from dba_scheduler_file_watchers;
- grant execute on filewlocal to hr;
- grant execute on SYS.SCHEDULER_FILEWATCHER_RESULT to hr;
- grant create external job to hr;
- grant create job to hr;
- create table hr.tfilewlocal ( a varchar2(200) ) ;
- create or replace procedure hr.procfilewlocal ( p_1 SYS.SCHEDULER_FILEWATCHER_RESULT)
- is
- begin
- insert into tfilewlocal values ( to_char( p_1.file_timestamp,'YYYY-MM-DD:HH24:MI:SS') ||' '
- ||p_1.directory_path||' '
- ||p_1.actual_file_name||' '
- ||p_1.file_size ) ;
- commit;
- end;
- begin
- dbms_scheduler.create_program(
- program_name => 'HR.progfilewlocal',
- program_type => 'STORED_PROCEDURE',
- program_action => 'HR.procfilewlocal',
- number_of_arguments => 1,
- enabled => false);
- end;
- begin
- dbms_scheduler.define_metadata_argument(
- program_name => 'HR.progfilewlocal',
- metadata_attribute => 'event_message',argument_position => 1 ) ;
- end;
- begin
- dbms_scheduler.enable('HR.progfilewlocal');
- end;
- begin
- dbms_scheduler.set_attribute('hr.jobfilewlocal','parallel_instances',true);
- end;
- select * from hr.tfilewlocal ;
复制代码
- alter system set dispatchers='(PROTOCOL=TCP) (dispatchers=6)';
- select * from dba_users order by 1;
- BEGIN
- DBMS_XDB.SETHTTPPORT(8888);
- END;
- SQL> @?/rdbms/admin/prvtrsch.plb
- BEGIN
- DBMS_SCHEDULER.SET_AGENT_REGISTRATION_PASS('mypassword');
- END;
- SELECT DBMS_XDB.GETHTTPPORT() FROM DUAL;
- DECLARE
- versionnum VARCHAR2(30);
- BEGIN
- versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('192.168.0.199');
- DBMS_OUTPUT.PUT_LINE(versionnum);
- END;
- select * from dba_scheduler_db_dests;
- select * from dba_scheduler_external_dests;
复制代码
|
|