Oracle runstats oneliner (ok, two liner)

Use this to generate a runstats script for your Oracle system. Only works for 6.1 . Also very ugly 🙂


#!/bin/bash
export PROFILE_PATH=/opt/WebSphere/wp_profile
cat ${PROFILE_PATH}/ConfigEngine/properties/wkplc_comp.properties | grep DbUser | grep -v source | grep -v '#' | grep -v DBA | awk -F = '{print "execute dbms_stats.gather_schema_stats(ownname=>'"'"'" $2 "'\'', cascade=> TRUE);"}' > reorg.sql

Now copy this file to your oracle system and run this:


sqlplus / as sysdba @reorg.sql

Pow! All done.

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *