The stored procedure that was first referenced in step 4 is now created. To keep the example concise, no primary keys, indexes etc have been defined.ĬREATE TABLE files_from_customers(file_name VARCHAR2(100), This step creates a table where the contents of the files will be inserted into, along with the file name. In order for the new stored procedure, sp_load_customer_files, to access attributes of event that started the File Watcher, a call to dbms_fine_metadata_argument is required.įor more information about this program unit please refer to the documentation. Program_action => 'sp_load_customer_files', The stored procedure, sp_load_customer_files, doesn’t yet exist and will be created in Step 6. In this step I have specified that the stored procedure that will be executed by the File Watcher, when the file arrives. Step 4 Specify the program unit that will be executed when the file watcher runs txt suffix I have set the file name parameter accordingly. In the following example I want the File Watcher to watch for files that appear in the Operating System directory C:etl_dir and as the names of the files could be all different but will have the. The call to create_file_watcher (unsurprisingly) creates the file watcher object and tells it where to “watch” for incoming files along with the name of the file that you are interested in. Password => 'your operating system password', Username => 'your operating system username', The following code creates a credential called “watch_credential” In order for the File Watcher to be able to access the file(s) on Windows, a Scheduler credential object is required. The following example changes the interval to one minute. If you want to change the interval, connect as sys user and run the set_attribute procedure of dbms_scheduler. Step 1 Alter the File Watcher Interval (Optional)įile watchers check for the arrival of files every ten minutes by default. The user running all the code is logged in with the DBA role.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |