VMS Help
DEFRAGMENT, FILE

 *Conan The Librarian

    The DEFRAGMENT FILE command defragments the files specified
    on the command line according to the DEFRAGMENT command line
    qualifiers. Use this command to defragment a small number of
    files. To defragment a large number of files, use the DEFRAGMENT
    VOLUME command.

    Format

      DEFRAGMENT FILE  { file-spec[,...] } [ /QUALIFIERS ]

  1 - Parameters

 file-spec[,...]

    The file-spec parameter identifies the file or files to be
    defragmented. You may use wildcards for the file specification.

  2 - Restrictions

    o  A script that has the /CONTINUOUS qualifier may not be named
       as the predecessor of another script.

    o  If you specify the /INTERVAL qualifier, the /PREDECESSOR
       qualifier is not allowed.

    o  If /LEVEL=5 is selected, the /LOG qualifier is required.

    o  Do not use /BRIEF and /FULL concurrently.

  3 - Qualifiers

 3.1 - /AFTER

       /AFTER={time}
       /AFTER={current_time} (default)
       /NOAFTER

          The /AFTER qualifier keeps the script from executing
          until after the specified time.

          You can specify time as either an absolute time or
          as a combination of absolute and delta times. For
          complete information on specifying time values, see
          the OpenVMS User's Manual.

          The /AFTER qualifier has three states. It can be
          specified with a valid time, it can be omitted from
          the command line, or it can be negated (/NOAFTER). If
          /AFTER is specified with a valid time, the script is
          scheduled to execute after that time. If the /AFTER
          qualifier is omitted, the defragmentation software
          processes the command as if the /AFTER qualifier
          were specified with the current time. If /NOAFTER
          is specified, no starting time is associated with
          the script being defined. The /NOAFTER qualifier
          allows you to define a script without scheduling it
          to execute. To subsequently start the script, use the
          START subcommand.

 3.2 - /BRIEF

       /BRIEF (default)
       /NOBRIEF

          The /BRIEF qualifier is used only with the /LOG
          qualifier. The /BRIEF qualifier requests a brief log
          of all actions taken by the defragmentation process.
          This log includes beginning and ending file status
          information. The /BRIEF and /FULL qualifiers are
          mutually exclusive, and /NOBRIEF produces the same
          result as /FULL. The /BRIEF qualifier is the default.

 3.3 - /CONSOLIDATE_FREESPACE

       /CONSOLIDATE_FREESPACE
       /NOCONSOLIDATE_FREESPACE (default)

          The /CONSOLIDATE_FREESPACE qualifier tells the Disk
          File Optimizer to use its free space consolidation
          algorithm.

 3.4 - /DORMANT

       /DORMANT=(file-spec[,...])
       /NODORMANT (default)

          The /DORMANT qualifier indicates files to be
          considered dormant when final file placement
          decisions are made. In order for the file to be
          placed dormant, it must be the file specified in
          the command line. Dormant files are placed at the
          high end of the volume.

          If a file is indicated in both the DORMANT and
          FREQUENT lists, it is considered dormant. If a file
          is indicated in both the EXCLUDE and DORMANT lists,
          it is excluded.

                                      NOTE

             The amount of free space on the volume, the
             number of files currently being accessed, and
             other factors influence file placement. The
             Disk File Optimizer does not guarantee file
             placement, but makes every effort to place files
             as described.

 3.5 - /EPILOGUE

       /EPILOGUE={file-name}
       /NOEPILOGUE (default)

          The /EPILOGUE qualifier identifies a DCL command file
          which DFO executes upon completion of the DEFRAGMENT
          operation.

          Mounting or dismounting the disks cannot be done
          through the Command file specified.

 3.6 - /EXCLUDE

       /EXCLUDE=(file-spec[,...])
       /NOEXCLUDE (default)

          The /EXCLUDE qualifier specifies files to be excluded
          from processing. The defragmentation process ignores
          files matching the listed file specifications. Any
          file indicated in the EXCLUDE list and in either
          the FREQUENT or DORMANT lists is excluded from
          processing.

                                      NOTE

             The defragmentation process always excludes
             system files, open files, files excluded in an
             options file (/OPTIONS qualifier), and files
             excluded using the /IGNORE qualifier.

 3.7 - /FREQUENT

       /FREQUENT=(file-spec[,...])
       /NOFREQUENT (default)

          The /FREQUENT qualifier indicates files to be
          considered frequently accessed when final file
          placement decisions are made. In order for the file
          to be placed frequent, it must be the file specified
          in the command line. Frequent files are placed toward
          the center of the volume.

          If a file is indicated in both the FREQUENT and
          DORMANT lists, it is considered dormant. If a file
          is indicated in both the FREQUENT and EXCLUDE lists,
          it is excluded.

                                      NOTE

             The amount of free space on the volume, the
             number of files currently being accessed, and
             other factors influence file placement. The
             Disk File Optimizer does not guarantee file
             placement, but makes every effort to place files
             as described.

 3.8 - /FULL

       /FULL
       /NOFULL (default)

          The /FULL qualifier requests a full log of all
          actions taken by the defragmentation process. The
          /FULL qualifier has no meaning if the /LOG qualifier
          is absent. The /FULL and /BRIEF qualifiers are
          mutually exclusive, and /NOFULL provides the same
          functionality as /BRIEF.

 3.9 - /HOTFILE_DATABASE

       /HOTFILE_DATABASE
       /NOHOTFILE_DATABASE (default)

          The /HOTFILE_DATABASE qualifier causes the
          defragmenter to query the appropriate hotfile
          database and append the list of hotfiles to the
          /FREQUENT file list.

 3.10 - /IGNORE

       /IGNORE=(keyword[,...])
       /IGNORE=(PLACED) (default)
       /NOIGNORE

          The /IGNORE qualifier requests that the
          defragmentation process ignore certain types of files
          as specified by the following keywords:

          o  INDEXED-Ignores all RMS indexed files

          o  NOINDEXED-May defragment RMS indexed files

          o  PLACED-Ignores all files with explicit placement
             flags set in their headers

          o  NOPLACED-May defragment files with explicit
             placement flags

          Files indicated by the /IGNORE qualifier are added to
          the EXCLUDE list.

          The default value (/IGNORE=PLACED) indicates that
          files with explicit placement control should be
          ignored, and that RMS indexed files should be
          defragmented and placed in appropriate locations
          on the volume.

 3.11 - /INHERIT

       /INHERIT={script-name}
       /NOINHERIT (default)

          The purpose of the /INHERIT qualifier is to make
          script creation easier. By inheriting most of the
          command data from a previously entered script and
          modifying only a few items (such as volume name), a
          completely new script can be created. The /INHERIT
          qualifier creates a database entry for a new script
          in the following way:

          o  Copies all fields from the specified script to the
             new script.

          o  Overwrites any qualifier or parameter values in
             the new script with those specified on the command
             line.

          o  Names the new script as appropriate. The user may
             specify a script name using the /SCRIPT={script-
             name} qualifier. Otherwise, the defragmentation
             software creates a unique script name. You can
             use wildcards in the script-name specification.
             Use an asterisk (*) to take action on all scripts
             on the VAXcluster system; use a percent sign (%)
             to match a single character in the script-name
             specification.

 3.12 - /INTERVAL

       /INTERVAL={delta-time}
       /NOINTERVAL (default)

          The /INTERVAL qualifier executes a script at
          regularly scheduled intervals. The /INTERVAL
          qualifier specifies the minimum time between two
          consecutive executions of a script.

          Specify time as a delta time. Refer to the OpenVMS
          User's Manual for more information on specifying
          times. If you do not specify a time with the
          /INTERVAL qualifier, a default value of 24 hours
          is used. This value causes the associated script to
          run every 24 hours.

          If you specify the /AFTER qualifier with the
          /INTERVAL qualifier, the first defragmentation
          operation occurs at or after the time specified
          by the /AFTER qualifier; all subsequent operations
          execute at intervals set according to the /INTERVAL
          qualifier.

 3.13 - /LEVEL

       /LEVEL={n}
       /LEVEL=1 (default)

          The defragmentation process selects files for
          defragmentation (from among those not excluded) based
          on the /LEVEL qualifier. Once a file is selected as
          a candidate, the defragmentation process attempts
          to fully defragment that file (make it 100 percent
          contiguous). Specify the level number as an integer
          ranging from one to five:

          o  /LEVEL=1

             Any file that is not 100 percent contiguous, or
             that can be selected using levels two and three,
             is a candidate for defragmentation.

          o  /LEVEL=2 (default)

             Any file whose extents cannot be completely
             mapped by the mapping window, or that can be
             selected using level three, is a candidate for
             defragmentation. The default window value is seven
             and can be set for a given volume using:

             $ SET VOLUME {device-spec}/WINDOWS=[n]

          o  /LEVEL=3

             Any file with retrieval pointers in more than one
             file header is a candidate for defragmentation.

          o  /LEVEL=4

             The defragmentation process for level four
             processing performs only free space consolidation.
             This level is used with the /CONSOLIDATE_FREESPACE
             qualifier.

          o  /LEVEL=5

             This level requests a volume analysis only;
             no defragmentation occurs. The statistical
             results are available in the log file, which is
             required when /LEVEL=5 is selected (see the /LOG
             qualifier). If level 5 is selected, the /LEVEL=2
             candidate file specifications are listed in the
             full log file.

 3.14 - /LOG

       /LOG={file-spec}
       /NOLOG (default)

          The /LOG qualifier causes the defragmentation process
          to create a file containing a list of all its
          operations. The information in the log file varies
          with the presence of the /FULL or /BRIEF qualifiers.

          The /FULL qualifier lists all files analyzed by the
          defragmentation process and reports their status
          during each phase of defragmentation.

          The /BRIEF qualifier lists only the statistics of
          each phase, such as number of files analyzed and
          number of files defragmented.

 3.15 - /MAIL_NOTIFICATION

       /MAIL_NOTIFICATION
       /NOMAIL_NOTIFICATION (default)

          The /MAIL_NOTIFICATION qualifier requests that
          brief status and termination messages regarding
          defragmentation processes be mailed to the
          distribution list provided in the file DFG$MAIL_
          ADDRESS.

 3.16 - /NODE

       /NODE=(node-name[,...])
       /NONODE (default)

          The /NODE qualifier limits the scope of the
          DEFRAGMENT command to the node or set of nodes
          specified by /NODE=(node-name). By default,
          defragmentation processes may execute on any LMF
          licensed node in the system.

 3.17 - /OPCOM_NOTIFICATION

       /OPCOM_NOTIFICATION (default)
       /NOOPCOM_NOTIFICATION

          The /OPCOM_NOTIFICATION qualifier requests that
          brief status and termination messages regarding
          defragmentation processes be sent to OPCOM.

 3.18 - /OPTIONS

       /OPTIONS={file-spec}
       /NOOPTIONS (default)

          The /OPTIONS qualifier provides an alternate method
          for associating files with the /DORMANT, /EXCLUDE, or
          /FREQUENT qualifiers. If the list of files for any of
          these qualifiers is long, you can create a separate
          file for this information. Each record in the options
          file consists of a file name followed by one of the
          following keywords:

          o  /EXCLUDE-File to be excluded

          o  /FREQUENT-File to be considered frequently
             accessed

          o  /DORMANT-File to be considered dormant

          The following example shows the contents of an
          options file called MYOPTFILE.OPT. This file
          specifies that all files on the target device called
          FILE1.EXE are frequent files, all files in the
          [ARCHIVE] directory are to be excluded, and all files
          in the [OLDSTUFF] directory and its subdirectories
          are dormant.

              FILE1.EXE/FREQUENT
              [ARCHIVE]*.*;*/EXCLUDE
              [OLDSTUFF...]*.*;*/DORMANT

          Files indicated by the /EXCLUDE qualifier and by
          either the /DORMANT or /FREQUENT qualifier are
          excluded. Files indicated by the /DORMANT qualifier
          and by the /FREQUENT qualifier are considered
          dormant. This rule is applied equally across all
          files specified in the /OPTIONS file, as well as
          those associated with these qualifiers on the command
          line.

 3.19 - /PREDECESSOR

       /PREDECESSOR={script-name}
       /NOPREDECESSOR (default)

          The /PREDECESSOR qualifier links scripts. These
          scripts execute in sequence; one successfully
          completes before the next one begins.

          The predecessor script name must exist in the
          scheduling database or an error status message is
          returned. You can use wildcards in the script-name
          specification. Use an asterisk (*) to take action on
          all scripts on the VAXcluster system; use a percent
          sign (%) to match a single character in the script-
          name specification.

 3.20 - /PRIORITY

       /PRIORITY=(DEFAULT=n, MINIMUM=n)
       /NOPRIORITY (default)

          The /PRIORITY qualifier specifies priorities for the
          defragment process. The minimum priority setting is
          used when the defragmentation process exceeds the
          value specified by either /CPU_LIMIT or /IO_LIMIT.

 3.21 - /PROLOGUE

       /PROLOGUE={file-name}
       /NOPROLOGUE (default)

          The /PROLOGUE qualifier identifies a DCL command
          file which DFO executes just before the Defragment
          operation starts.

          Mounting or dismounting the disks cannot be done
          through the Command file specified.

 3.22 - /RVN

       /RVN=n
       /RVN=0 (default)

          When you have a bound volume set, use this qualifier
          to identify a disk from the volume set or all disks
          in the volume set. The default of zero tells the Disk
          File Optimizer to defragment all disks in the bound
          volume set. Specify a relative volume number (RVN)
          to defragment a specific disk that belongs to a bound
          volume set.

 3.23 - /SCRIPT

       /SCRIPT={script-name}
       /NOSCRIPT (default)

          The /SCRIPT qualifier assigns a user-supplied name
          to a script. If a duplicate script-name is selected,
          defragmentation software issues a duplicate script
          name error message and does not enter the new script
          into the database-no defragmentation takes place.

          A script name may be up to 64 characters in length
          and may contain any of the following characters:

          o  Any alphanumeric character

          o  Underscore ( _ )

          o  Hyphen ( - )

          o  Dollar sign ( $ )

          Observe the following rules when naming a script:

          o  You may use any combination of uppercase and
             lowercase letters.

          o  DO not begin script names using the dollar sign.
             However, you can include the dollar sign within
             the script name. (The dollar sign is reserved for
             special use by HP.)

          o  Do not end a script name with a hyphen, since the
             hyphen is the DCL continuation character.

 3.24 - /TIME_LIMIT

       /TIME_LIMIT={delta-time}
       /NOTIME_LIMIT (default)

          The /TIME_LIMIT qualifier specifies the maximum
          elapsed time allowed for a given defragmentation
          operation. If the time limit is exceeded, the
          defragmentation process is aborted.

          Specify time as a delta time. Refer to the OpenVMS
          User's Manual for more information on specifying
          times.

          For linked scripts, the time limit of the first
          script applies to the whole set. Time limits
          specified with successor scripts apply to these
          scripts only.

          If the time limit is set unreasonably low, the
          defragmentation process may not accomplish useful
          defragmentation.

 3.25 - /WRITE_CHECK

       /WRITE_CHECK
       /NOWRITE_CHECK (default)

          The /WRITE_CHECK qualifier requests that a read-
          after-write check be performed on all defragmented
          or placed files. This qualifier significantly extends
          the execution time of a defragmentation process.

  4 - Examples

      The following examples show different ways to defragment a file
      or group of files and how to use the common qualifiers:

    1.$ DEFRAGMENT FILE *.C;*

      This command defragments all files with a .C extension in the
      user's current default directory. To determine the device
      and directory in which the files are located, issue the SHOW
      DEFAULT command.

    2.DFO> DEFRAGMENT FILE *.C;*

      This command defragments all files with a .C extension on the
      user's current default device. The only difference between
      this command and the previous example is that this command is
      entered from within the Disk File Optimizer utility instead of
      from the DCL prompt.

    3.$ DEFRAGMENT FILE SYS$SYSDEVICE:[000000...]*.C

      This command is the same as the previous one, except that
      the RMS default string is now explicitly identified as
      SYS$SYSDEVICE:[000000...]*.C;*.

    4.$ DEFRAGMENT FILE SYS$LOGIN:LOGIN.COM;2/EXCLUDE=*.OLD;*

      This command defragments the user's LOGIN.COM file and excludes
      all files with a .OLD extension.

    5.$ DEFRAGMENT FILE/INHERIT=OTHER_FILE_SCRIPT.NOAFTER

      This commands creates a file script identical to the OTHER_
      FILE_SCRIPT and allows the Disk File Optimizer to name it
      (DFG$XXX).

    6.$ DEFRAGMENT FILE SYS$SYSTEM:[000000...]*.RDB/INHERIT=X/SCRIPT=Y

      This command creates a script called Y . Other script
      characteristics, such as log file, are inherited from script
      X.
  Close     Help