7. OpenLane Maintenance

Rebuilding Oracle Database Indexes

As records are added to and deleted from the database, indexes may become fragmented and index trees may increase in height, slowing access to the database.

The ol_rbldidx.sql script rebuilds indexes to maintain performance.

Indexes should be rebuilt weekly, or, if less frequently, as often as practicable.

Procedure

To rebuild the indexes of the database named OpenLane every Sunday morning starting at 12:15 am on a Solaris system:

1.Move /opt/pdn/OpenLane/data/sql/scripts/Oracle/ Maintenance/ol_rbldidx.sql to the $ORACLE_HOME directory.

2.Create a shell script:

ORACLE_HOME=/opt/oracle; export ORACLE_HOME;

ORACLE_SID=OLDB; export ORACLE_SID; /opt/oracle/product/8.1.6/bin/sqlplus

my_username/my_password @ol_rbldidx

For this example, presume the script is saved as:

/OL_Scripts/rebuild_ix

3.Create or a modify a crontab file with the entry:

15 0 * * sunday “/OL_Scripts/rebuild_ix“

For this example, presume the script is saved as:

/OL_Scripts/my_cronfile

4.Submit the crontab file to cron:

crontab /OL_Scripts/my_cronfile

7-8

January 2002

7800-A2-GB32-00

Page 60
Image 60
Paradyne SLM 5.5 manual Rebuilding Oracle Database Indexes