Andy Duncan > Orac-alpha-1.2.6 > defrag.pl

Download:
Orac-alpha-1.2.6.tar.gz

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source  

NAME ^

defrag.pl -- Creates SQL*Plus command files to defragment a tablespace.

SYNOPSIS ^

[ ? | -? | -h | --help ]

--tablespace=TABLESPACE

[--alttablespace=TABLESPACE]

[--expdir=PATH]

[--logdir=PATH]

[--resize=STRING]

[--sqldir=PATH]

[--user=USERNAME]

[--password=PASSWORD]

[--prefix=PREFIX]

[--sid=SID]

[--resize=STRING]

Note: descriptions of each of these arguments are provided via 'help', which may be displayed by entering 'defrag.pl' without any arguments.

DESCRIPTION ^

Creates command files to defragment (reorganize) an entire Oracle Tablespace. Arguments are specified on the command line.

A "defrag" is usually performed to recapture the little fragments of unused (and unusable) space that tend to accumulate in Oracle tablespaces when objects are repeatedly created and dropped.. To fix this, data is first exported. Objects are then dropped and the tablespace is "coalesced" into one large extent of available space. The objects are then recreated using either the default sizing algorithm or a user supplied algorithm, and the data is imported. Space utilized is then contiguous, and the unused free space has been captured for use.

The steps in the process are:

    1.  Export all objects in the tablespace (tables, indexes, partitions).
    2.  Drop all objects.
    3.  Coalesce the tablespace.
    4.  Create all tables and partitions, resized appropriately.
    5.  Import the data into the new structures.
    6.  Recreate the indexes.
    7.  Restore all constraints.

TO DO ^

BUGS ^

FILES ^

The names and number of files output varies according to the Tablespace specified and the options selected. All .sql and .log files and shell scripts produced are displayed on STDOUT during the execution of the program.

Also, see 'README.defrag', which will be created when Help is displayed (by entering 'defrag.pl' without any arguments).

AUTHOR ^

 Richard V. Sutherland
 rvsutherland@yahoo.com

COPYRIGHT ^

Copyright (c) 2000, 2001 Richard V. Sutherland. All rights reserved. This script is free software. It may be used, redistributed, and/or modified under the same terms as Perl itself. See:

    http://www.perl.com/perl/misc/Artistic.html
syntax highlighting: