Basic Scripts for Database Administration

From: exazonk <exazonk_at_gmail.com>
Date: Tue, 23 Jun 2009 22:48:38 -0700 (PDT)
Message-ID: <7fd60595-21c8-47ac-b13d-d945e7b22d70_at_h2g2000yqg.googlegroups.com>



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 Received on Wed Jun 24 2009 - 00:48:38 CDT

Original text of this message