Shell Script to Analyze Schema

Write a shell script to analyze schema

#######################################################################
#
# analyze.sh

# Scripts to analyze schema/s , where schema name is passed as argument
#
#########################################################################
for i in `echo $*`
do
echo " "
echo " "
echo "---------- Analyzing schema  $i   -------------"
echo " "
echo " "

sqlplus -s /nolog <<EOF
conn / as sysdba
exec dbms_stats.gather_schema_stats('$i');
exit
EOF
done

Output : 
 

$ ./analyze.sh scott test

---------- Analyzing schema scott   -------------
 

PL/SQL procedure successfully completed.
 

---------- Analyzing schema  test   -------------
 

PL/SQL procedure successfully completed.

Linux Tips

See Also

Have a Linux Problem
Linux Forum - Do you have a Linux Question?

Linux Books
Linux Certification, System Administration, Programming, Networking Books

Home Index
Linux System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.