If you are talking shell scripts, then you could have this structure:-
An alternate might be to set step and have an if ... then ... fi round each chunk of code like this:-
They would sort of get over your request, but honestly this might just end up in a huge script trying to do too much in one go. You would be better to have a single script for each task you need to perform and keep it simple. Even better, write a utility script that takes an SQL deck as an argument and runs the appropriate code. You can then use a proper scheduler to set up dependencies, change the sequence of your code or whatever far more flexibly.
Of course, there is a cost to a proper scheduler and you would likely have to justify it. There are many out there on the market from those massively over-engineered but can run work on (just about) any platform to those that run on the local host only (although with a bit of ssh or rsh knowledge you can run processing elsewhere too)
At worst, I would at least suggest having a directory holding the scripts you want to run. At the start of the schedule, copy in each script, making sure each starts with a sequence number so that they naturally sort in the required order so, for example:-
This would allow you to insert an ad-hoc job if you need to, say 01_02_05_extra-bit_this_time
You then need a script to simply loop over the contents of the directory and (re)move files when the script completes error free. You would, of course have to document a recovery procedure if there was a failure and enable whomever to copy back an completed steps that needed to be re-run, say after a data restore and adjustment.
Your script to run the schedule could be pretty simple:-
That said, it is a poor substitute for a proper scheduler. How complex a batch schedule do you think this might grow to? There could really be many ways to do this, so you really need to be certain of your logic of how it would need to flow, allow for exceptions or ad-hoc processes, recovery steps, restart intervention, data corrections, etc. etc.
Overall, I'd really suggest a proper 3rd party scheduler. Search for schedulers from CA, BMC, UC4, Axway, or a myriad of other software companies out there. They generally all allow you to manipulate the batch, restart from a specific point, bypass steps, run tasks in parallel and various other things. There may even be a decent freeware one that I'm not aware of - perhaps sourceforge or similar have built something.
Some are pretty, some are text only and very basic, but it depends what you need and what you can justify.
Hi friends,
i am having a variable declared in .profile.i am changing its value in a shell script and then i am connecting to oracle and then from there i am calling a .sql called update.sql
STATUS is the variable declared in the .profile
===============================
if
sqlplus <<END... (3 Replies)
Hi,
Data file path (.txt)
Control file(.ctl)
I have delimited file(|).
Sample data:
1|name|50009|DS24|0|12
2|name|30009|DS24|0|13
3|name|20409|DS24|0|14
4|name|20009|DS24|0|15
5|name|10009|DS24|0|16
I want to load this data into a oracle table (update and insert)
Please help me... (1 Reply)
Hi all,
How to load variable value into Oracle table? I have created a file validation shell script. After the validation completes, i need to update a Oracle table with the variable value...
Can someone help me how to do it? I have searched, but not able to get answer.
i have 4... (1 Reply)
Hi all,
How to load variable value into Oracle table? I have created a file validation shell script. After the validation completes, i need to update a Oracle table with the variable value...
Can someone help me how to do it? I have searched, but not able to get answer.
i have 4 variables... (2 Replies)
Hi all,
I have a data like,
0,R001,2,D
this wants to be loaded into a oracle database table.
Pl let me know how this has to be done.
Thanks in advance (2 Replies)
Hi,
I have a case where i am connecting to the oracle DB and reading a column value....
Script is in production...it was running fine,,,but suddenly now some times its started giving pain....
Script runs dailly....but sometimes its reading data from Oracle DB and sometimes its not rading the... (2 Replies)
Hi
I need to execute a select statement in a solaris environment with oracle database. The select statement returns number of rows of data.
I need the data to be inserted into a CSV file with proper format. For that we normally use "You have to select all your columns as one big string,... (2 Replies)
Hi,
i need to send emails to the mail ids i receive using the sql query .
SELECT L.ALARM_DEF,L.CRITERIA,L.DISTANCE_METRE,L.EMAIL,L.LAC_ID,L.LAST_CHECK,L.RANGE,
L.RESOURCE_MSISDN,LM.ADDRESS,LM.NAME FROM LANDMARK_ALARM_CONF l, LANDMARK lm
WHERE L.LANDMARK_ID=LM.LANDMARK_ID AND... (0 Replies)
Hi,
I want to write a shell script which will export data from oracle table .
I don't want to save that data . I want the queries .
Right now i am right clicking on the table and clicking on export as to my desktop .
Please let me know if any one have any idea . (2 Replies)
Hi,
I am working on data stage 8.7 version and I want a script a to view the all log information of the data stage job from UNIX environment.
Can you please help me out by give the script.
Thanks in advance... (7 Replies)