LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2010, 10:41 PM   #1
Maya_Pillai
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
Linux script to check the informatica log


Hi,

We are loading 100 + oracle tables using informatica. At the end of the run, we need to verify the informatica log to confirm the rows are loaded properly to target tables.

There are so many detials included in the etllog. But,the part of the informatica log, linux script needs to look into look like as below -(vary for different table names. here, CMN_1740 is the table name.)

MAPPING> TM_6252 Source Load Summary.
MAPPING> CMN_1740 Table: [SQ_W_CASE_FS] (Instance Name: [SQ_W_CASE_FS])
Output Rows [1], Affected Rows [1], Applied Rows [1], Rejected Rows [0]
MAPPING> TM_6253 Target Load Summary.
MAPPING> CMN_1740 Table: [W_CASE_F] (Instance Name: [W_CASE_F])
Output Rows [1], Affected Rows [1], Applied Rows [1], Rejected Rows [0]


--------------------

1. The details of source load summary (source table name and the details -Output Rows [1], Affected Rows [1], Applied Rows [1], Rejected Rows [0]) should be written to a log
3. We need to check whether the affected rows is 0 or rejected rows > 0 for source load summary. In that case , script should write that to a log and exit


2. The details of target load summary (target table name and the details -Output Rows [1], Affected Rows [1], Applied Rows [1], Rejected Rows [0]) should be written to a log


3. We need to check whether the affected rows is 0 or rejected rows > 0
for target load summary. In that case, script should write that to a log and exit.

4.The above steps should be repeated for all set of tables mentioned in the etllog.

Can somebody please help?
Thanks
Maya
 
Old 08-05-2010, 06:57 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
LQ helps people when the get stuck or are in doubt, it does not provide custom programming to order.

If you show what you have tried so far, what it does and how it does not meet your requirements then people will help you move forward.
 
Old 08-05-2010, 10:53 PM   #3
Maya_Pillai
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Here is my script. Can somebody suggest how can I fine tune the below script?



Code:
logfile=${ETLLOG}/etllogs.log
 	found=0
        echo >${POS_LOG}/dw_postodw_rowcount.log
        while read line
        do
                
                if [ found -eq 0 ]; then
                {
                        
                        checkline=`echo $line |grep "Source Load Summary" `
                        if [ $? = 0 ]; then
                        echo " Found source load summary .. Found is setting to 1\n"
                                found=1
                        fi
                }
                elif [ found -eq 1 ]
                then
                 {
			sourcetable=`echo $line | cut -f2 -d" " `
                        echo " Source Table: $sourcetable" >> ${POS_LOG}/dw_postodw_rowcount.log
                        found=2

                }
                elif [ found -eq 2 ]
                then
                {
                        echo " The source load summary $line " >>${POS_LOG}/dw_postodw_rowcount.log

                        affected=`echo ${line} |cut -f6 -d" " `

                        affectedcount=`echo ${affected} | grep 0 `

                        if [ $? = 0 ]
                        then
                                echo "Source load affected rows = 0 .. Issue found\n">>${POS_LOG}/dw_postodw_rowcount.log
                                exit 1
                        fi
                        
			rejected=`echo ${line} | cut -f12 -d" " `
                        rejectedcount=`echo ${rejected} | grep [1-9] `
                      	if [ $? = 0 ]
                        then
                                echo "Source load rejected rows >0 .. Issue foun\n">>${POS_LOG}/dw_postodw_rowcount.log
                                exit 1
                        fi

                        found=3

                }
                elif [ found -eq 3 ]
                then
                {
                        echo " Target Table: " >> ${POS_LOG}/dw_postodw_rowcount.log
                        found=4
                }
                elif [ found -eq 4 ]
                then
                {

			targettable=`echo ${line} | cut -f2 -d" " `
                        echo "$targettable \n " >> ${POS_LOG}/dw_postodw_rowcount.log
                        found=5
                }
                elif [ found -eq 5 ]
                then
                {
                        echo " The Target load summary $line " >>${POS_LOG}/dw_postodw_rowcount.log

                        affected=`echo ${line} |cut -f6 d" "`

                        affectedcount=` echo ${affected} | grep 0 `

                        if [ $? = 0 ]; then
                                echo "Target load affected rows =0 .. Issue found\n">>${POS_LOG}/dw_postodw_rowcount.log
                                exit 1
                        fi
                        rejected=` echo ${line} |cut -f12 -d" " `

                        rejectedcount=`echo ${rejected} | grep [1-9] `

                        if [ $? = 0 ]; then
                        echo "Target load rejected rows >0 .. Issue found \n">>${POS_LOG}/dw_postodw_rowcount.log
                                exit 1
                        fi
                        found=0
                }
                fi

        done<$logfile
I need to get an exact match for 0 .
Code:
affectedcount=`echo ${affected} | grep 0 `
This fetches all 10,20.. etc.

Thanks
Maya
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
informatica for linux linuxshrikant Linux - Software 7 08-16-2013 08:00 AM
(Bash) Redirect all output from script to all.log and copy of errors to err.log hmsdefender Programming 5 03-05-2010 01:52 PM
Need a script which does Health check for Linux and send mail notification? your_shadow03 Linux - Newbie 6 11-26-2009 06:20 PM
How do I check if smbfs is accessible from Win Clients using a linux script townlevel Linux - Server 4 09-28-2006 02:51 PM
LXer: Informatica Announces General Availability of PowerCenter 8 LXer Syndicated Linux News 0 05-07-2006 10:21 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration