Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> FYI: script to resize datafiles before backup

FYI: script to resize datafiles before backup

From: Andre van Winssen \(andrew\) <andrew-no-spam-svp_at_info.nl>
Date: Wed, 13 Feb 2002 17:45:38 +0100
Message-ID: <3c6a9837$0$226$4d4ebb8e@news.nl.uu.net>

For the brave ones..

I wrote a script to resize all datafiles to minimal size. Could be run right before the backup starts, or to save disk space. Below is the script header. It's nothing special, but it works for me. Comments are welcome.

REM NAME
REM resize_db.sql
REM DESCRIPTION

REM      Generates/executes ALTER DATABASE DATAFILE '..' RESIZE commands to decrease filesizes
REM      so the backup timewindow becomes smaller, or just to save disk space
REM      
REM    USAGE
REM      By default, the script will not actually execute the ALTER statements generated
REM      If you want that just change value for boolean "ThisIsReal" to TRUE first
REM      All statement actually executed can be traced back in the alert.log file
REM      by searching for the comment "/* resize_DB */"
REM     
REM    NOTES
REM      This script assumes that all datafiles have the same standard block size, 
REM      it doesn't handle Oracle9i's nonstandard block size yet 
REM      
REM      Resize is done under following conditions:
REM        * datafile must be autoextensible so it can grow back to what is was before the resize
REM        * newsize must be smaller than original size
REM
REM DISCLAIMER
REM First try it on a test database..
-- 
Andre van Winssen
andrew01nospam_at_nospam-xs4all.nl

please remove nospam if you want to send me mail.




Received on Wed Feb 13 2002 - 10:45:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US