Help need with need with scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help need with need with scripts
# 1  
Old 02-04-2018
Help need with need with scripts

I have a main ksh script which takes several huge tables
and translate into individual csv files for processing
1. A run an sqlplus script that translates each oracle table into a csv file
2 next, python script verify/split the large csv file into smaller files for processing
2.Then. another shell scripts find split files and submits each line of the split file for processing by another script. I'm parallel processing with use of xargs -n -p (I need to find a way where some lines are not skipped)
3. this shell script processes each line as input to a restful service
4. The output json response is processed in a python script which translates it into an sql insert statements
5. i group the sql insert statements by id and then consolidate all ids under one main id in the main script
6. perform a bulk insert of the main id in sqlplus
i'm trying to process as many files as possible

its currently taking about 10 minutes to process 10k with submission of 100 split files with 75 lines for each files submitted to the service. I crashed the server with this amount of processes and some lines were skipped.

I trying to do it in as little time as possible.
gnu parallel is not available for us.
Any assistance would be greatly appreciated.
I have not coded any years and this is my first project
I have time constraints i need some serious help ASAP

Thanks for reading

Last edited by revisittocoding; 02-04-2018 at 08:33 PM.. Reason: more information
# 2  
Old 02-05-2018
Welcome to the forum.

Confused.
You're processing an incredible sequence of different programs to cast a set of DB tables into another (set of) DB tables?
Don't you think that could be done sort of directly DB to DB at tremendously increased speed? BTW, don't expect too much from "parallel processing" as parallel processes will compete for DB and system resources...
Please post more details of the problem, e.g. data structures, algorithms, scripts to get a (hopefully different) persective of the task.

ASAP, btw, is a term highly deprecated in these fora. We're all volunteers who try to help alongside a regular occupation.
# 3  
Old 02-05-2018
So, can you tell us the database versions at each end?

As RudiC suggests, it might be far better to get the database(s) to do the work for you. Can you consider a few options:-
  • Are the databases able to connect with ODBC to each other?
  • Can the servers that the databases are on communication with SSH?
  • Does the data actually get transformed or is it that there is simply some splitting going on? If so, what are the criteria?

You could help us by explaining the database versions for the source and the target and the Operating systems you're dealing with. We might be able to untangle the multi-step process you have. The fewer steps, then (usually) the better the performance. The best processing will likely be done on the source database to extract the data you want in a way that can be loaded directly, but we won't know unless you tell us what is needed.



Sorry about the questions, but I'm sure we can help if we have a better idea of what's going on.


Kind regards,
Robin
This User Gave Thanks to rbatte1 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

2. Shell Programming and Scripting

Calling scripts from with scripts

Hi all, I'm wondering if you could give me some advice. I am new to scripting and am getting rather frustrated that i can get my script to call another script if certain criteria is met, via command line, but I cannot get the same script to work thru the cron jobs. My first script monitors... (8 Replies)
Discussion started by: echoes
8 Replies

3. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

4. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

5. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

6. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

7. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

8. Shell Programming and Scripting

Calling expect scripts from other expect scripts

Hi, First, let me explain the issue I am trying to solve. We have a lot of expect scripts with the duplicated send/expect commands. So, I'd like to be able to extract the duplicated code into the common scripts that can be used by other scripts. Below is my test where I am trying to call... (0 Replies)
Discussion started by: seva
0 Replies

9. UNIX for Dummies Questions & Answers

Help with scripts

script that ask for "enter a file name" and removes that file and asks for confirmation before deletion if executed the output might look as enter the filename you intent to deleted remover file? Y file deleterd I knwo the comand I would use find . -name *.* -ok rm {}\; I guess... can... (1 Reply)
Discussion started by: LiTo
1 Replies
Login or Register to Ask a Question