The DataSync utility is the easiest way to load data from relational or a file source into the Oracle Analytics Cloud (OAC). DataSync has a scheduling capability but often you will need to trigger a load process as soon as data becomes available from another system, instead of waiting for a scheduled process time. DataSync allows you to create this file trigger using an “on demand” polling file.
I am using DataSync version 2.3 for Linux, this can be download on Oracle’s website at: http://www.oracle.com/technetwork/middleware/bicloud/downloads/index.html
I have already built a sample project within DataSync called “Example-job1.” This job loads data from a “Test.csv” file to a table in the OAC database called “TEST_TABLE.”
To configure the polling process, you will need to edit a file called “on_demand_job.xml inside the \conf-shared directory of your DataSync installation.
Opening the file, you can see that almost everything is commented out. At the bottom of the page you will see two <OnDemandMonitors> tags, you will want to want to build your <TriggerFile> tags between them.
Here are the steps to build your trigger tag:
This is the frequency at which DataSync will look for the polling file. This setting is initially set to -1, meaning the process is inactive.
You will want to change this to a positive number to activate the process. Below I changed this to 10, meaning the DataSync will look for the polling file every 10 minutes.
Job – This the name of the job in DataSync that you would like to trigger.
File – This is the name of the file that DataSync should look for to kick of the load process. The file path must be included.
Here is the TriggerFile tag that I completed:
This is an optional tag that specifies the time window when you want the polling process to be active.
This only allows the polling mechanism to be active between the hours of 7pm and 8pm.
Putting all the above components together, here is the on_demand_job.xml:
Now the only thing that needs to be done is to create a file called /home/upload/myfile.txt. Once this file is created you should see your data job trigger. When DataSync kicks off the job, the myfile.txt will be deleted.
Questions? Comments? Eager to see OAC? Reach out to us at:
Kiel Briggs, email@example.com
Jon Harvey, firstname.lastname@example.org