Need Suggestion : Please share your ideas


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need Suggestion : Please share your ideas
# 1  
Old 08-01-2012
Data Need Suggestion : Please share your ideas

Hi Friends,

I have a requirement where i need to compare the 2 tables ( Let assume SOURCE table and TARGET Table )in teradata . before this requirement we used to do a MINUS query and did the work. But now we came to situation where we need to get the expected output as below :

Code:
No of Mismatches :
 
Mismatches Report :
 
KEYFILED(UNIQUE Filed) | SORCE FIELD(ORIGINAL VALUE)| TARGET FIELD(CHANGED VALUE)

I did the following to get the output in unix .

Quote:
1) Dumped 2 tables data in to files
2) Delimit the columns by "|"
3) sort the file
4) Compare line by line and field by field (using loops)
The output for the 1000 rows in both tables is taking 1 min, where i tried with 50,000 rows it is taking almost 1hr which is an performance issue.

Please let me know any of you have come across the same issue. if so, what you have done? did you use any tools for the comparision ? or any menthod to compare two tables?

Please give me some suggestions.

Thanks in advance.

Last edited by Scrutinizer; 08-01-2012 at 05:41 AM.. Reason: quote tags -> code tags
# 2  
Old 08-01-2012
More details please. I guess this should be doable in your DB with an (maybe complex?) SQL - statement.
# 3  
Old 08-01-2012
Please post what Operating System and version your are running, what Database Engine and version this is, what Shell you use, and the contents of your script. Please also give us a feel for the power and scale of your computer.
You may find that inserting date commands in your script will show where the slow statements reside.

As @RudiC suggests, why not do the whole process in SQL? Is the sort key field not indexed in the database?
# 4  
Old 08-01-2012
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help me get some ideas

Hello, I have been given a scripting project, but have not learned any scripting. I need to get some ideas on how to start. Attached is part of the project: I have no idea how to parse the arguments. What I had in mind was to get the arguments ($1, $2, ... ) and have if statements for different... (1 Reply)
Discussion started by: facepalm
1 Replies

2. Shell Programming and Scripting

Ideas for while loop

idealy, i'd like to do something like this: while read line do echo $line done < $(egrep error /var/log/syslog) but when i do, i get an unexpected response. i.e. cat test: #!/bin/sh while read line do echo $line done < $(egrep error /var/log/syslog) (12 Replies)
Discussion started by: SkySmart
12 Replies

3. UNIX and Linux Applications

Need ideas for graduation project based on unix or linux Need ideas for graduation project based on

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

4. Shell Programming and Scripting

Help with data reformat if share share content

Input data: read1_data1 read1_data1 read2_data1 read3_data1 read4_data1 read4_data1 read4_data1 read5_data1 . . Desired output result: read1_data1 read1_data2 read2_data1 read3_data1 read4_data1 (3 Replies)
Discussion started by: perl_beginner
3 Replies

5. UNIX for Advanced & Expert Users

Sendmail - Any Ideas?

I have solaris 9 and am using sendmail to pickup requests and forward them to a bulk mail server on a different port. Now for the fun...In sendmail, I need to find a way to place a default address in the Mail From: and Rcpt To: or remove them as required - These will be picked up by the bulk mail... (3 Replies)
Discussion started by: mikey2003ma
3 Replies

6. Shell Programming and Scripting

Scripting ideas?

Hi All, How can I script the following logic? Step 1: Check if the file xyz.txt exists under direcotry test and if the size of the file xyz.txt is greater than 32MB. Step 2: If the above conditions are true(file exists and size >32 MB), then step 3, otherwise step 4 (file does not exist or... (2 Replies)
Discussion started by: Sueyoung88
2 Replies

7. Shell Programming and Scripting

any ideas?

i need to compare to dates/times given in the format MMDDhhmmYY. That is month, day, hour, minute, year. It is a 24 hour clock. I need to compare two dates to check that they are, say, less than 900 seconds apart. I have got to a point where it checks the time, turns the values into seconds and... (5 Replies)
Discussion started by: fwabbly
5 Replies

8. Cybersecurity

Any Ideas !!!!!!!!!!

Hi, I installed sybase server on a LINUX server. I assigen port 2025 whilst installation for sybase , later i uninstalled sybase and when i try to reinstall sybase and use port 2025 it throw up error saying that it is already in use, use other port number. How can I re-use the same port number... (2 Replies)
Discussion started by: suda
2 Replies

9. Shell Programming and Scripting

Any Ideas?

I have several staging directories on my UNIX server. /usr2/data1 /usr2/data2 /usr2/data3 /usr2/data4 /usr2/data5 /usr2/data6 In these directories a file is transferred from different PC's connected to the network via TCP/IP. The File name is constant for all directories. Transfers... (1 Reply)
Discussion started by: Docboyeee
1 Replies
Login or Register to Ask a Question