Version details
-----------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
"CORE 11.2.0.3.0 Production"
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Below is the code which I have tried with file watcher. The job is not running after file arrival.
Please suggest me.
BEGIN
DBMS_SCHEDULER.create_file_watcher(
file_watcher_name => 'test_file_watcher',
directory_path => '/home/upncommon/workfile',
file_name => '*tempfl',
credential_name => 'UPNCOMMON_CREDENTIAL',
destination => NULL,
enabled => FALSE);
END;
/
BEGIN
DBMS_SCHEDULER.create_program(
program_name => 'file_watcher_test_prog',
program_type => 'stored_procedure',
program_action => 'INS_EMP',
number_of_arguments => 1,
enabled => FALSE);
END;
/
BEGIN
DBMS_SCHEDULER.define_metadata_argument(
program_name => 'file_watcher_test_prog',
metadata_attribute => 'event_message',
argument_position => 1);
END;
/
BEGIN
DBMS_SCHEDULER.create_job(
job_name => 'file_watcher_test_job',
program_name => 'file_watcher_test_prog',
event_condition => NULL,
queue_spec => 'test_file_watcher',
auto_drop => FALSE,
enabled => FALSE);
END;
/
BEGIN
DBMS_SCHEDULER.set_attribute('file_watcher_test_job','parallel_instances',TRUE);
END;
/
EXEC DBMS_SCHEDULER.enable('test_file_watcher');
EXEC DBMS_SCHEDULER.enable('file_watcher_test_prog');
EXEC DBMS_SCHEDULER.enable('file_watcher_test_job');