Page 1 of 2

Shelll Script for row count

Posted: Mon Aug 25, 2008 9:39 pm
by Nagaraj
Is there any script which does a count on the dimension table and the source table.?
you know like how many INSERTS, how many UPDATES and how many DELETES in the target table.
Could you please send me some template so that i get an idea on how to get the record couns based on I,U and D, UI , UD etc

Thanks
-Raj

Posted: Mon Aug 25, 2008 10:03 pm
by ray.wurlod
Download ETLStats from Kim Duke's website - note, however, that the row counts from DataStage are simply the rows that are sent to the database - not necessarily the same as the number that were successfully inserted/updated/deleted.

Posted: Mon Aug 25, 2008 10:10 pm
by Nagaraj
Thanks :) :)

Posted: Mon Aug 25, 2008 10:10 pm
by Nagaraj
This says me to maintain some tables in oracle which i dont want to do .

Posted: Mon Aug 25, 2008 10:37 pm
by ray.wurlod
You don't have to save them to Oracle - you can adapt the application and save wherever you wish.

Row Count

Posted: Tue Aug 26, 2008 8:02 am
by Nagaraj
Could you please let me know in brief how to do this?
Thanks for the information.

Posted: Tue Aug 26, 2008 8:04 am
by chulett
Just... change them. :?

What is your target database?

Posted: Tue Aug 26, 2008 8:15 am
by Nagaraj
Its Oracle.

Posted: Tue Aug 26, 2008 8:31 am
by dspxlearn
Nagraj,

You can incorporate 'dsjob' commands with combination of unix commands in your shell which you use to run your datastage job.
Steps:
Standardize all the link names from where you want to count the no. of records processed.
List all your grep you into a file using -lstages using dsjob command.
Then write a loop to get the information of the stages by 'grep'ing your standardized link names. Use -stageinfo option to get the link count of each stage.

Posted: Tue Aug 26, 2008 8:43 am
by chulett
Wait... you don't want to save things in Oracle or you do? :?

If not, where or in what format do you want to store things?

Posted: Tue Aug 26, 2008 9:00 am
by Nagaraj
I want to get the count of my Target table which is a database and it is maintaining history, and i shd make sure the counts are correct both from the source side and as well from target side,

for example

1 Insert is 1 Insert in Target
1 Update is 1 Insert plus 1 Update in target i.e 2.

How do i get this in the script.

Posted: Tue Aug 26, 2008 9:17 am
by Nagaraj
Also for

1 delete there will be one Delete as Update.

Posted: Tue Aug 26, 2008 9:21 am
by Nagaraj
I imported all the jobs in my Project,

The folders i get is
ETL_Job_Params
ETL_Metadata
ETL_QA_Jobs
ETL_Reports
ETL_Row_Counts
Metadata
Misc
Can you Tell me in which folder what i have to change and go ahead and get the rowcounts for all the jobs which i have in my sequences.?

Posted: Tue Aug 26, 2008 10:04 am
by Nagaraj
Could you please let me know how to use the job,

EtlGetRowCountsFromLog in the ETL stats folder

Posted: Tue Aug 26, 2008 10:10 am
by Nagaraj
I can store in Sequential File.