VMS Help  —  DEFRAGMENT  VOLUME  Examples
    The following examples show different ways to defragment a volume
    and illustrate how to use the common qualifiers.

    1.

    $ DEFRAGMENT VOLUME DISK$USER_1

    This command defragments DISK$USER_1 using default qualifiers.
    The defragmentation process executes once and does not repeat.
    In a VMScluster system, the defragment operation begins on a
    node selected at random from among those nodes in the scheduling
    database having fewer executing processes than the limit imposed
    by the SET PROCESS_LIMIT={value} subcommand. If all nodes are
    busy with a maximum number of defragment processes, the script
    does not execute until one of the outstanding defragmentation
    operations concludes.

    After the defragmentation process stops, the script is removed
    from the scheduling database.

    2.

    $ DEFRAGMENT VOLUME DISK$ONE/SCRIPT=MY_SCRIPT-
    $ _/IGNORE=(INDEXED,PLACED)/INTERVAL=2-00:00/FREQUENT=*.EXE-
    $ _/LOG=MYLOG.LOG/FULL/DORMANT=*.ARCHIVE/NODE=(N1, N2)

    This command does the following:

    o  Defragments DISK$ONE

    o  Names the script MY_SCRIPT

    o  Instructs the defragmentation process to ignore all RMS
       indexed files and files with explicit placement control
       information in their headers. (These files are added to the
       EXCLUDE list.)

    o  Instructs the scheduler to execute this script every two days

    o  Instructs the defragmentation process that all .EXE files on
       the entire volume should be considered frequently accessed
       when final file placement decisions are made

    o  Requests a log file, MYLOG.LOG, which is placed in the
       directory from which this command was entered

    o  Requests a /FULL log file

    o  Instructs the defragmentation process that all .ARCHIVE files
       on the entire volume should be considered dormant (rarely
       accessed) when final file placement decisions are made

    o  Limits the nodes available for the defragmentation process to
       nodes N1 and N2

    3.

    $ DEFRAGMENT VOLUME DISK$TWO/INHERIT=MY_SCRIPT
    $_/SCRIPT=FIRST_SCRIPT

    This command inherits the script definition made in example 2.
    Thus, it creates a new script that is the same as MY_SCRIPT,
    except for the following differences:

    o  The script name is FIRST_SCRIPT instead of MY_SCRIPT.

    o  The target volume is DISK$TWO instead of DISK$ONE.

    In this case, MYLOG.LOG is also inherited. Thus, one version of
    the log file contains data from MY_SCRIPT, and the other version
    contains data from FIRST_SCRIPT. To prevent log file inheritance,
    specify the /LOG qualifier.

    4.

    DFO> DEFRAGMENT VOLUME DISK$ONE /SCRIPT=SECOND_SCRIPT
    DFO>_ /PREDECESSOR=FIRST_SCRIPT

    This commands links SECOND_SCRIPT to FIRST_SCRIPT using
    the PREDECESSOR qualifier. SECOND_SCRIPT does not execute until
    FIRST_SCRIPT completes successfully. SECOND_SCRIPT uses default
    parameters. Note that this command supplies the DEFRAGMENT VOLUME
    options from within the Disk File Optimizer utility.
Close Help