One thing to remember is b-tree indexes settle at 75% efficiency very
quickly and sit there.  You can never keep a b-tree index at 100%
efficiency.

But if your db is small enough to rebuild indexes nightly, well I guess you
can.

"Do not criticize someone until you walked a mile in their shoes, that way
when you criticize them, you are a mile a way and have their shoes."

Christopher R. Spence 
Oracle DBA
Phone: (978) 322-5744
Fax:    (707) 885-2275

Fuelspot
73 Princeton Street
North, Chelmsford 01863
 



-----Original Message-----
Sent: Thursday, September 06, 2001 3:25 PM
To: Multiple recipients of list ORACLE-L


First off, checking on a regular basis for indexes that need rebuilding is
fine, but don't rebuild all of them every night. Not only is it unnecessary,
it can cause lots of problems. Only rebuild the indexes you need to--the
ones who are significantly browned, have a significant percentage of
deletes, or whose height is significant.

Second, setting up a cron job is indeed a good idea. And David is right that
you want to make sure to explicitly set up your environment, but not for the
reason he suggests. The problem isn't that the job runs as root. If it were
the case that every cron job on a UNIX box ran as root, then that would be a
mighty big security hole. The issue is that when running a cron job, the
account under which it runs does not automatically get its environment
initialized by running .profile as it does when you log in. Thus, the
environment must be specifically laid out.

Hope this helps.

Jon Walthour


-----Original Message-----
Sent: Thursday, September 06, 2001 1:33 PM
To: Multiple recipients of list ORACLE-L



David -

Use cron.  Nightly might be excessive.  Kick off a shell script (remember
that cron executes as root, so you need to set your environment) and create
your own script dynamically (following code is use for backups also) in a
manner like:

rebuild_index.sh

#!/bin/ksh

export PATH=$PATH:/u001/app/oracle/product/8.1.7/bin
export ORACLE_SID=ifas
export PATH=$PATH:/$ORACLE_HOME/bin
export ORACLE_HOME=/u001/app/oracle/product/8.1.7
export ORACLE_BASE=/u001/app/oracle

sqlplus <<either use a password protection scheme or hardcode your access
here> <<username>/<password>>>  @/usr/local/bin/rebuild_index

exit

rebuild_index.sql

spool rebuild_index.sql
Select 'Alter index ' || index_name || ' rebuild;' from dba_indexes;     #
add selection caveats if desired
spool off
!chmod 777 /u014/oradata/ifastrn/rebuild_index.sql
@/u014/oradata/ifastrn/rebuild_index

exit

Lots of variations possible.




David A. Barbour
Oracle DBA, OCP
AISD
512-414-1002


 

                    Kimberly Smith

                    <[EMAIL PROTECTED]       To:     Multiple recipients
of list ORACLE-L <[EMAIL PROTECTED]>  
                    jitsu.com>                   cc:

                    Sent by:                     Subject:     RE: Scripts
for Rebuilding Indexes Nightly on Solaris   
                    [EMAIL PROTECTED]

 

 

                    09/06/2001 11:57 AM

                    Please respond to

                    ORACLE-L

 

 





Nightly?  That is a lot.  Are you really entering that much data on a daily
basis?
     -----Original Message-----
     From: David Wagoner [mailto:[EMAIL PROTECTED]]
     Sent: Thursday, September 06, 2001 8:57 AM
     To: Multiple recipients of list ORACLE-L
     Subject: Scripts for Rebuilding Indexes Nightly on Solaris

     Does anyone have any good scripts for rebuilding indexes nightly on
     Solaris UNIX that they'd be willing to share?  Also, in your
     experience is it better to run this through UNIX cron jobs than using
     the Oracle OEM job scheduler?  I suspect the cron job will be the
     favorable answer.


     Thanks in advance,


     David Wagoner
     Oracle DBA



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Walthour, Jon (GEAE, Compaq)
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Christopher Spence
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to