You are on page 1of 4

Applications & Systems

MANAGEMENT

Finding ‘lost’ Tape Volumes

DOCUMENT INFORMATION
Document Owner A J SINGH
Issue Number 1.00
Date of Issue 03 February 2008
Status In Circulation, pending further discussion
Platform TSM Server 5.2.3 to 5.5
TERMS & CONDITIONS OF USE

1. APPLICATION & SYSTEMS MANAGEMENT (ASM) provides a digital archive – on its website – of
technical documentation on IBM TIVOLI STORAGE MANAGER (TSM).

2. ASM is committed to making the information and resources that it provides via the web accessible to
all users. We aim to be standards compliant and follow general principles of usability and universal
design, which should help all visitors to this website.

3. Articles and other material in the ASM usually include an explicit copyright statement. In the absence
of a copyright statement, users should assume that standard copyright protection applies, unless the
article contains an explicit statement to the contrary.

4. Some articles and other material in the ASM website is in the public domain and may be used and
reproduced without special permission. However, anyone using the material is requested to properly
cite and acknowledge the source.

5. Not all of the information and materials on the ASM website is public; some materials are published
here by permission of the creators or authors of the material and that permission generally is not
automatically transferable to a user of the website. Should you intend to republish, distribute, copy,
perform, or display any of the information or materials on this website, you should investigate the
copyright status of that material or information to make sure your use of it does not infringe any
rights of the creator or author.

6. References in any material to Tivoli Systems or IBM products, programs, or services do not imply
approval by IBM.

7. Any licensed materials (e.g., software) which you download from the ASM web site are governed
exclusively by the license terms accompanying the file or the terms of the license agreement which
accompanied the original materials licensed by you which you are updating, and by downloading such
licensed materials, you agree to abide by the terms of the license. Any reproduction or redistribution
of such software or materials not in accordance with the applicable license is expressly prohibited by
law.

8. Because of the number of individuals as contributors and sources of data contributing to this archive,
ASM does not make any warranty or guarantee regarding the accuracy of any information and
products.

9. ASM shall not be liable for any consequential loss incurred or sustained by you or any third party
howsoever arising in respect of your use of or reliance on this document or the ASM website.

APPLICATIONS & SYSTEMS MANAGEMENT


P O Box 11752, Zwartkop, 0051, South Africa
Tel +27.84.786-8029 Cell +27.84.786-8029 Fax +27.86.645-9754
www.ASMHoldings.com E-Mail inbox@ASMHoldings.com
Finding ‘lost’ Tape Volumes
The DELETE VOLHISTORY command deletes volume history file records that are no longer needed (for
example, records for obsolete database backup volumes).

When you delete records for volumes that are not in storage pools (for example, database backup or export
volumes), the volumes return to scratch status if TSM acquired them as scratch volumes. Scratch volumes of
device type FILE are deleted. When you delete the records for storage pool volumes, the volumes remain in
the TSM database.

For users of DRM, the database backup expiration should be controlled with the SET DRMDBBACKUPEXP
command instead of this DELETE VOLHISTORY command. Using the DELETE VOLHISTORY command removes
TSM's record of the volume. This can cause volumes to be lost that were managed by the MOVE DRMEDIA
command. The following bash script identifies these volumes:

#!/bin/bash
# ----------------------------------------------------------------------------------------------------------------------------
# Description: 'Missing Tapes' volumes.
# Date: 29th March 2007
# Queries: Ajith Singh - singh.ajith@gmail.com
# ----------------------------------------------------------------------------------------------------------------------------
# Update this with the highest value of the volume labels.
MAX_VOLUMES=1300

# Update this with the lowest value of the volume labels.


MIN_VOLUMES=1000

# ----------------------------------------------------------------------------------------------------------------------------

# Tape Label Parameters - update as necessary


PREFIX="BL"
SUFFIX="L3"
# length of label excluding PREFIX and SUFFIX
LABEL_LENGTH=4
ZERO="0"

# ----------------------------------------------------------------------------------------------------------------------------

# TSM Server administrator a/c details - update as necessary


DSM_DIR=/opt/tivoli/tsm/client/ba/bin
DSM_ADMIN=admin
DSM_PWD=secret
DSM_CMD="$DSM_DIR/dsmadmc -id=$DSM_ADMIN -pa=$DSM_PWD -datao=y"

# ----------------------------------------------------------------------------------------------------------------------------

test -x $DSM_DIR/dsmadmc || { echo "TSM Client Administrative CLI not installed."; if [ "$1" = "stop" ]; then exit 0; else exit 5;
fi }

APPLICATIONS & SYSTEMS MANAGEMENT


P O Box 11752, Zwartkop, 0051, South Africa
Tel +27.84.786-8029 Cell +27.84.786-8029 Fax +27.86.645-9754
www.ASMHoldings.com E-Mail inbox@ASMHoldings.com
DATA_VOLS_SQL="select volume_name from volumes order by 1 asc"
VOLH_SQL="select volume_name from volhistory order by 1 asc"
LIBVOLS_SQL="select volume_name from libvolumes order by 1 asc"

MISSING_VOLS=" "
DATA_VOLS=`$DSM_CMD $DATA_VOLS_SQL`
VOLH_VOLS=`$DSM_CMD $VOLH_SQL`
LIB_VOLS=`$DSM_CMD $LIBVOLS_SQL`

DSM_VOLS=`echo $DATA_VOLS $VOLH_VOLS $LIB_VOLS | sort | uniq`

for (( i=$MIN_VOLUMES; i<=$MAX_VOLUMES; i++ ))


do
tmpvol="$i"
for (( j=${#tmpvol}; j<$LABEL_LENGTH; j++ )); do tmpvol=$ZERO$tmpvol; done
tmpvol=$PREFIX$tmpvol$SUFFIX
MISSING_VOLS=" "$tmpvol$MISSING_VOLS
done

for i in $DSM_VOLS
do
MISSING_VOLS=`(for j in $MISSING_VOLS; do echo $j; done) | grep -v $i`
done

echo "'MISSING' TAPE VOLUMES"


echo "----------------------"
echo
echo "This is a list of tape volumes that are not in the tape libraries and are not listed in the volume history file and the TSM
volumes list."
echo

echo $MISSING_VOLS | tr [" "] ["\n"]

# ----------------------------------------------------------------------------------------------------------------------------

APPLICATIONS & SYSTEMS MANAGEMENT


P O Box 11752, Zwartkop, 0051, South Africa
Tel +27.84.786-8029 Cell +27.84.786-8029 Fax +27.86.645-9754
www.ASMHoldings.com E-Mail inbox@ASMHoldings.com

You might also like