Capture The Database activity

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
divine
Premium Member
Premium Member
Posts: 149
Joined: Fri Oct 15, 2004 12:13 am
Location: Toronto,divine_auro@yahoo.co.in
Contact:

Capture The Database activity

Post by divine »

HI
I am also facing the same problem what Niranjani Faced.That is how to capture the database activity(Whether database is available or not) in your job.As on this basis I can use the sendMail function to notify the user whther job runs succesfylly or not and acordingly the user can take further step.
:( Biswajit
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome aboard! :)

One thing you could have done was post this in the thread you mentioned rather than start a new one on the same subject. The other thing would have been to simply monitor the answers they received and see if they made any sense, perhaps adding questions of your own.

Check what I posted there as a possible solution and see if makes sense to you... then let us know! If it doesn't, seek clarification. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
mleroux
Participant
Posts: 81
Joined: Wed Jul 14, 2004 3:18 am
Location: Johannesburg, South Africa
Contact:

Post by mleroux »

Welcome aboard! :D

In a job sequence, you can validate a simple job that links to the database in question instead of running it. Then, use the results of the validate to send an e-mail or do whatever needs to be done.
Morney le Roux

There are only 10 kinds of people: Those who understand binary and those who don't.
divine
Premium Member
Premium Member
Posts: 149
Joined: Fri Oct 15, 2004 12:13 am
Location: Toronto,divine_auro@yahoo.co.in
Contact:

Post by divine »

hi
Thanks for the suggestion. I have schedule the job. So once you schedule it than how I am able to validate it. As my job runs everyday. So for the first time I validated it and it validated. Than I schedule it. Now some times my job fails for the unavaliabilty of Oracle. So I want to modify my job by capturing the database activity and send a mail.Than only mail will say how my jub performs and whether the oracle is available at that particular time or not as the oracle is present in some remote mechine.
Please give some suggestion
Thanks
Biswajit
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Post by ogmios »

If you write your scheduling job (the job that launches your other jobs) in BASIC you can try to connect to your database e.g. via BCI, check whether the database is accessible and react on that... either sending an unavailability mail or starting the real jobs.

Of course if the database drops out afterwards, your jobs will still fail on database unavailability.

Ogmios
In theory there's no difference between theory and practice. In practice there is.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Keep in mind, the BCI functions require licensed version of the ODBC drivers to work. For folks with UNIX servers, anywho. :wink:

As posted elsewhere, simply have the job in your Sequencer twice, once to validate it every run and then another to run it if the validate goes well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
divine
Premium Member
Premium Member
Posts: 149
Joined: Fri Oct 15, 2004 12:13 am
Location: Toronto,divine_auro@yahoo.co.in
Contact:

Post by divine »

HI.
Thanks to all for a good suggestion. But still I am little bit confused.As I want every time when I coneect to database (Any) first I should know is it available or not. So it is not the question that I should check for the first time.So can you please help me in this maater.
Thanks and Regards
Biswajit
With Regards
Biswajit
divine
Premium Member
Premium Member
Posts: 149
Joined: Fri Oct 15, 2004 12:13 am
Location: Toronto,divine_auro@yahoo.co.in
Contact:

Post by divine »

Hi
I am still awaiting for my answer i.e. how to know when database is avalaible for my job and it is not for the first time but every time when I connect to the database.If any one know pls help me.
With Regards
Biswajit
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Post by ogmios »

:cry: Try to connect to the database first. If that fails assume the database is down. If it works you can login in again and do your real work. Besides trying to connect there's no easy way in DataStage to detect "upness" of a database.

And this extra job should be run every time (in a schedule job e.g.) before you execute your actual job.

If you mean you want to check before every row you insert whether the database is up... forget it. Your job will abort not so gracefully when the database is shutdown in the middle of executing the DataStage job.

Ogmios
In theory there's no difference between theory and practice. In practice there is.
Post Reply