Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

file watcher is not working in 11g R2

Nag AswadhatiSep 30 2013 — edited Oct 2 2013

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');

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 30 2013
Added on Sep 30 2013
5 comments
3,571 views