Re: Basic Scripts for Database Administration

From: Mark D Powell <>
Date: Wed, 24 Jun 2009 06:53:09 -0700 (PDT)
Message-ID: <>

On Jun 24, 1:48 am, exazonk <> wrote:
> Has anyone come across a few scripts that would make Oracle database
> administration easier?
> For example, the following command:
> execSql -d=DB_NAME -f=/ora/sql/chk_tspaces.sql -a=80 -e=on_output -
> g=DBA
> The above command would run the sql file (probably using sqlplus)
> using the argument, 80%, as a threshold to check to see if any
> tablespaces had exceeded this. If the script returned any output, then
> this would cause an email to be sent to the DBA group.
> Or to run statspack every day from crontab:
> execSql -d=DB_NAME -c "exec perfstat.statspack.snap;" -e on_error -
> g=DBA
> So the above command would be run and if it produced an error, it
> would email the DBA group.
> The execSql script could then be used to run an entire suite of sql
> files, or rman scripts, so that database administration was easier.
> The script, execSql, would probably be scripted in perl so that is was
> multi-platform.
> Thanks

You are probably better off to develop your own scripts in the long run.

You can find numerous administration scripts posted on various user web sites and blogs around the Internet. May I suggest you seek out the cooperative FAQ hosted on Jonathan Lewis's web site

Oracle support has a script library.,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,131704.1,1,1,1,helvetica

I would run statspack using dbms_scheduler or dbms_job packages and not via cron.

The IOUG (International Oracle User Group, membership required) has a script library or at least did before I allowed my membership to lapse.

As I said there are numerous blogs around on Oracle topics. You might seach on topics of interst.

Finally though this really should be the first place you look the official documentation is full of example queries that can be expanded upon or used as the base for administration scripts.

HTH -- Mark D Powell -- Received on Wed Jun 24 2009 - 08:53:09 CDT

Original text of this message