Hi,
I have a file which has a list of 200 tables e.g: table.txt
I need to do a count for each table and store it in a file.
So I did something like this:
for TABLE in `cat table.txt`
do
T_CNT=$(sqlplus -s -l / as sysdba <<EOF
set echo off heading off feadback off
SELECT count(*)
FROM ${TABLE};
exit;
EOF)
echo "$T_CNT|$TABLE >> $AUDIT_FILE
done
The above script does the job, but it goes through each table one at a time.
Is there a way to make this process more parallel, so that I can query multiple tables at a time?
I was thinking of doing a split. Something like
split -l 20 table.txt
The above line would create 10 splits, so I could query 10 tables at a time.
But I'm not sure what my next step is so that 10 Select clauses are issued at smae time.
Please advise.