Guys,
I wrote a script to do the following -
- Read a file that is placed into a directory and depending upon the contents, load into one or multiple tables into Oracle.
- After the file is loaded into the table, depending upon the exit status of the process I will either delete the file or mark the record entry for that file as incomplete record in the table.
Initially, I was told that there would only be few files in a 15 minute time span and I cron-ed this script to run for every 5 mins and it was fast enough to load it in few minutes. Now, they are sending huge files and on couple occasions, the script ran longer than 10 minutes.
Now, Im running into an issue that I cant seem to grapple with on multiple levels.
- First, how do I find which records ran and which one did not ?
- How do I identify as to which records got completed and which are pending and which one did not even process ?
- how do I implement some checks and balances so that whatever is placed in the directory is loaded into the table.
I am sure a great many of you might have ran into this and want to learn as to what could be the best practice here. I am thinking of implementing a thread based approach but I never wrote thread programming in POSIX.
Please advise