SCRATCH Tape Management and FAQ with Tivoli Storage Manager

Technote (FAQ)


Various techniques to create new SCRATCH volumes, free up existing SCRATCH, monitor volume usage in storage pools, and information about APARs.


Common techniques to resolve these issues include:
. 1) Understand SCRATCH tapes vs volumes, and MAXSCRATCH.
. 2) Add new tapes to the library.
. 3) Consolidate two mostly-empty tapes onto one (reclamation).
. 4) Ensure retention settings are correct, and files are expiring.
. 5) Release DBBACKUP or DRM volumes that are no longer needed.

These sections contain potential solutions for fixing SCRATCH issues:
. 1) Check if MAXSCRATCH value on STGPOOL needs to be increased.
. 2) LABEL and CHECKIN new tape volumes for the library.
. 3) Set STGPOOL RECLAIM values so reclamation runs automatically.
. 4) Delete data that is past the retention period using EXPIRE INVENTORY.
. 5) Ensure older DBBACKUP volumes are erased using DELETE VOLHIST.
. Brief summary of solutions.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1) First, let's review MAXSCRATCH restrictions and clarify terminology:

- SCRATCH tapes -- could be empty tapes, sitting in a box. To be useful, turn SCRATCH tapes into SCRATCH *volumes*.

- SCRATCH volumes -- have been checked in to the Tivoli Storage Manager Server, labelled, and are ready for use. The Tivoli Storage Manager Server needs scratch *volumes*.

To determine if there are SCRATCH volumes checked in, use this Tivoli Storage Manager Server administrative command to list each volume in a library, and the volume status of SCRATCH or PRIVATE:
   QUERY LIBVOLUME <library_name>

Use QUERY STGPOOL with FORMAT=DETAIL to check the value of the "Maximum Scratch Volumes Allowed:" field, and compare that with how many volumes are in the tape storage pool. If the MAXSCRATCH value is set too low and the stgpool already has that number of scratch volumes assigned to it, even if scratch volumes are available, none will be assigned to the stgpool and the operation will fail. For this reason, unless there is a particular need to limit the number of scratch volumes assigned to a given storage pool, set the number higher to avoid exceeding the MAXSCRATCH limit.

IMPORTANT NOTE ==> MAXSCRATCH is *not* related to how many SCRATCH volumes are in a tape library. The MAXSCRATCH parameter is set for each tape storage pool, and it limits the total number of volumes used by that stgpool at one time. The storage pool will show all the symptoms of being out of SCRATCH volumes (ANR1405W) if needs more volumes than the MAXSCRATCH value. Note that at v5.3 and higher, the QUERY STGPOOL command output shows both the MAXSCRATCH setting, and the total number of scratch volumes currently allocated by that storage pool.

If that is the problem, use the UPDATE STGPOOL command to increase the MAXSCRATCH value. For the syntax, usage, and examples of Tivoli Storage Manager Server commands, please refer to the chapter "Administrative Commands" in the "Tivoli Storage Manager Administrators Reference." We also suggest the Tivoli Storage Manager Support website:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2) Checking new tapes into the library is a quick solution, although there is an expense for new media and this solution may be limited by the number of slots in the tape library. If there are available empty tapes and free slots, load them into the library and enter Tivoli Storage Manager Server admin command:

IMPORTANT NOTE ==> When new tapes are first checked into the Tivoli Storage Manager Server, always label the volume before using the CHECKIN LIBVOL. To label a volume, use the LABEL LIBVOL command, or define a SCSI tape library with AUTOLABEL=YES (default is NO). If new tape volumes do not have a magnetic label written, expect I/O errors to cause failures when the volumes are used by a storage pool. The tape volume may be unreadable, until it is labelled (erasing existing data). A good move would be to use the LABEL LIBVOL command with SEARCH=BULK (with the new volumes in the I/O door, bulk loader, convenience station) to label the volumes in that loader (instead of using SEARCH=YES to search through the entire library). The LABEL LIBVOL command can be used with the "CHECKIN=SCRATCH" parameter to check the new volumes into the library inventory after having been labelled with the same operation.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3) Reclamation is automatically run by the Tivoli Storage Manager Server approximately every hour. Reclamation thresholds are set using the RECLAIM parameter on the DEFINE or UPDATE STGPOOL commands. Important concept -- RECLAIM specifies the amount of *empty* space. For more information about reclamation, please refer to the chapter "Defining Device Classes" in the "Tivoli Storage Manager Admin Guide", and DCF 1192464 "How to reclaim volumes when out of scratch tapes" on the Tivoli Storage Manager Support website:

We recommend using the Tivoli Storage Manager default of RECLAIM=60 (percent of empty space), so two tapes that are 40% (or less) full are reclaimed onto a single new volume that is 80% full. Reclamation writes to an empty volume, so it typically requires a SCRATCH tape before it frees up two SCRATCH tapes.

IMPORTANT NOTE ==> We do not recommend RECLAIM values below 52% -- it can move data from two mostly-full tapes, onto two other tapes; which can waste a lot of Tivoli Storage Manager Server CPU, tape drive utilization, and tape volume wear. Higher values (above 60%) are OK, that simply delays reclamation until volumes are closer to empty.

Reclamation relies on empty space being created by expiration. Typically, after expiration completes some volumes will become eligible for reclamation, depending on the stgpool REUSEDELAY setting. The REUSEDELAY defaults to zero, but if specified, it is the number of days to wait before empty volumes are returned to the scratch pool. View the REUSEDELAY value using "QUERY STGPOOL F=D" looking for the field "Delay Period for Volume Re-use," and change the value using the UPDATE STGPOOL command.

Reclamation can also be run manually using the "MIGRATE STGPOOL" command. Reclamation can be turned off using the service (undocumented) Tivoli Storage Manager Server option NOMIGRRECL in the "dsmserv.opt" file -- designed only for temporary use during CPU-intensive Tivoli Storage Manager DB processes such as recovery, upgrades, or audits. Remember, if the Tivoli Storage Manager Server option "dsmserv.opt" file is changed, the Tivoli Storage Manager Server must be halted, then re-started for the changes to take effect.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4) Storing and expiring data are two of the most important Tivoli Storage Manager Server functions, and there is a lot of flexibility in how retention is configured. Customers must analyze the business value of retaining the various types data, and balance it with the cost. There are unique retention values for combinations of:
4.a) Backups, Archives, and Backupsets.
4.b) Files or directories.
4.c) Whether the file exists (ACTIVE) or was deleted (INACTIVE).
4.d) How many versions (copies) of changed files.
4.e) How many days to keep volumes containing only expired files.

Because of the ability to customize Tivoli Storage Manager Server backup and archive retention using the COPYGROUP and DOMAIN settings, and the associations with management classes, the subject is beyond the scope of this document. For an excellent overview of retention, please refer to "DCF 1224145 File Versioning, File Retention and File Expiration Explained" from the Tivoli Storage Manager Support website:

Backupset retention is the simplest to understand and control. Use the Tivoli Storage Manager Server administrative command QUERY BACKUPSET to determine the retention value -- all the data in the backupset expires at the same time. Use UPDATE BACKUPSET to change the expiration value, or DELETE BACKUPSET to erase all the data at once.

Backups and archives use similar, more complex retention settings. On the Tivoli Storage Manager Client, use QUERY BACKUP or QUERY ARCHIVE to determine which files are assigned to which management classes. Then, from the Tivoli Storage Manager Server, use the QUERY COPYGROUP and QUERY DOMAIN commands to determine the retention values for backups or archives, for ACTIVE/INACT files, based on versions retained and the number of days retained. Files and directories can be assigned unique mgmtclasses.

Directories are treated differently than files. It can be surprising if a new mgmtclass is created with a long retention period -- then all of a sudden it has more data than expected! Tivoli Storage Manager is working as designed. By default, directories are automatically bound to the management class with the longest retention period in that domain. This makes sense because otherwise there could be files to restore, but without a directory to restore them into; from the GUI, there would be no "container" to show the files existed. If to override this default behavior, specify a DIRMC (directory mgmtclass) option in the Tivoli Storage Manager Client option file for backups, or the ARCHMC option on a manual or scheduled ARCHIVE command (but not in the option file). However, since directories represent such a small amount of data, there is rarely a good business reason to specify a shorter retention (DIRMC/ARCHMC mgmtclass). We recommend using the default behavior.

Extra copies of files and directories are eligible for expiration when they exceed *either* the versions *or* days limitations -- the Tivoli Storage Manager Server uses the first/earliest expired value (not the largest/longest value). Do not change retention values without peer review!

IMPORTANT NOTE ==> Other software cannot read the data on Tivoli Storage Manager volumes. Once files are expired, there is no way to get them back. The only exception: if REUSEDELAY is set, it is possible to use a point-in-time "RESTORE DB" to a date before the data expired, to enable retrieving the previously expired files. This is typically only recommended in case of emergencies, and only in non-production (test/DRM) environment.

After files are eligible for expiration, the Tivoli Storage Manager Server will mark the files for deletion when expiration is run. EXPIRE INVENTORY can be run:
- Manually, from a Tivoli Storage Manager Server administrative commandline or GUI.
- Automatically, as a Tivoli Storage Manager Server administrative scheduled command or script.
- Automatically, using the Tivoli Storage Manager Server EXPINTERVAL option.

We recommend using a Tivoli Storage Manager Server administrative schedule instead of the EXPINTERVAL option, since schedules provide more control than a simple timer that runs every few minutes. Check the EXPINTERVAL setting using the QUERY OPTION command, and change it with the SETOPT command.

As expiration processing completes, the Tivoli Storage Manager Server typically will show new volumes are now eligible for reclamation, depending on the stgpool REUSEDELAY setting (as described above).

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5) There are two ways to immediately free up SCRATCH volumes, depending on the type of data. Please refer to the output from "QUERY VOLHIST" for all the types of Tivoli Storage Manager volumes; this document will address these two categories:
5.A) Tivoli Storage Manager Server database backups and snapshots.
5.B) Disaster Recovery Manager (DRM) volumes.

Most customers should have a Tivoli Storage Manager administrative schedule defined for BACKUP DB that runs at least once daily; perhaps more often, perhaps a mix of FULL and INCREMENTAL backups. Additionally, some customers also create DBSNAPSHOT backups. Without DRM configured, these volumes do not expire because they are not part of a stgpool that has retention settings.

IMPORTANT NOTE ==> Without DRM configured, unless there is a Tivoli Storage Manager administrative schedule defined for "DELETE VOLHIST ... TYPE=DBBACKUP", the database backups will accumulate until all SCRATCH volumes are consumed.

To get rid of unnecessary DBBACKUP volumes, either:

- Use Tivoli Storage Manager admin cmd DEFINE SCHEDULE to run this daily:
...where "<days>" is how long to retain the backups.
This is also applicable for DBSNAPSHOT volume.

- If using Disaster Recovery Manager (DRM), configure
the SET DRMDBBACKUPEXPIREDAYS and run the DRM scripts.

Either way, this removes the volumes from the Tivoli Storage Manager Server VOLHIST and immediately returns them to the SCRATCH pool for re-use.

Also, if there is a tape in the library which is empty, not in a state of REUSEDELAY, is not shown in VOLHIST output, but remaining PRIVATE, it may be possible to reset it to SCRATCH using this command:
   UPDATE LIBVOL  <library>  <volume>  STATUS=SCRATCH

IMPORTANT NOTE ==> The Tivoli Storage Manager Server will not allow setting to SCRATCH or deleting the most recent DBBACKUP or DBSNAPSHOT, no matter how old.

For more information about DRM scripts, please refer to the chapter "Using Disaster Recovery Manager" in the Tivoli Storage Manager Server Administrators Guide.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SUMMARY: To review, here are ways to prevent SCRATCH problems:
- Ensure tape storage pools MAXSCRATCH is higher than volumes in use.
- Add new blank tapes, label them, and check them in to Tivoli Storage Manager.
- Verify that reclamation is running, and RECLAIM thresholds are low
enough to reclaim mostly-empty volumes (such as 60%).
- Ensure EXPIRE INVENTORY is running at least daily.
- Check whether retention values are appropriate for business needs.
- Free up DBBACKUP, DBSNAPSHOT, and/or DRM volumes, either by:
--> Scheduled DR scripts to expire DB backups.
--> Scheduled admin command DELETE VOLHIST.

Additional considerations, beyond the scope of this document, include:
- The length of time that copy stgpool volumes are kept offsite.
- Deleting filespaces for obsolete Tivoli Storage Manager Clients.
- The Tivoli Storage Manager Server ARCHIVERETENTIONPROTECTION parameter.
- Using AUDIT VOLUME to clear volumes from failed offsite reclamation.
- Hardware problems such as tape I/O errors, label failure, 3494
category issues, device drivers, or defining tape devices.

IMPORTANT NOTE ==> There have been known issues with SCRATCH volume reporting and usage, such as the APARs below; please refer to the Tivoli Storage Manager Support website for the latest information:

APAR IC57911: AUDIT LIBRARY RUN FROM A LIBRARY CLIENT CAN RESET PRIVATE VOLUMES TO SCRATCH. If there is Tivoli Storage Manager Server Library Client with an invalid or nonexistent (deleted) DEVCLASS, and it runs "AUDIT LIBRARY", those Tivoli Storage Manager Library Client volumes may get reset to SCRATCH. Fix projected for Tivoli Storage Manager Server v5.5.3.0 or higher.

APAR IC59887: RECLAMATION OF ONSITE VOLUME FINISHES WITH NO ERRORS BUT VOLUME IS NOT RECLAIMED. After reclamation ends, an onsite volume may still report 100% reclaimable. MOVE VOLUME results in "ANR2209W Volume contains no data". Workarounds are either "DELETE VOLUME" or "AUDIT VOLUME ... FIX=YES".

DELETE VOLUME is not normally a method used for management of volumes, since the volumes will be recycled in the normal course of operations, unless there is an issue. In order to understand volume deletion using DELETE VOLUME then please see the Administrator's Reference on the following site for the appropriate level of your Tivoli Storage Manager server:


Historical Number


Rate this page:

(0 users)Average rating

Add comments

Document information

More support for:

Tivoli Storage Manager

Software version:

All Supported Versions

Operating system(s):

Platform Independent

Software edition:

All Editions

Reference #:


Modified date:


Translate my page

Machine Translation

Content navigation