TSM capacity


 
Thread Tools Search this Thread
Operating Systems AIX TSM capacity
# 8  
Old 08-29-2011
I didn't write many of these. Many I have modified for my environment. If you need something specific I might be able to help...

Code:

########################################################################################################
# List all Nodes, Filespaces
########################################################################################################
select NODE_NAME as "Node Name", FILESPACE_NAME as "Filespace Name                                              ", FILESPACE_ID as "Filespace ID " from filespaces order by 1,2

########################################################################################################
# List all admin schedules
########################################################################################################
select SCHEDULE_NAME as "Schedule Name                   ",ACTIVE from admin_schedules

########################################################################################################
# Space usage by filespace by storage pool
########################################################################################################
SELECT node_name,filespace_name "Filespace Name               ", physical_mb,stgpool_name FROM occupancy order by 3

########################################################################################################
#
########################################################################################################
select node_name,sum(capacity) as "filespace capacity MB",sum(capacity*pct_util/100) as "filespace occupied MB" from adsm.filespaces \
where cast((current_timestamp-backup_end)day as decimal(18,0))<2 and filespace_type not like 'API%'  group by node_name

########################################################################################################
# Find Volumes in the LIBVOLUMES table that have been marked PRIVATE that are really SCRATCH.  The following select statement will find the volumes.
# You can then do an UPDATE LIBVOLUME library-name volume-name status=scratch for each one that is private and should not be.
########################################################################################################
select volume_name from libvolumes where status='Private' and libvolumes.volume_name not in (select volume_name from volumes) and libvolumes.volume_name not in (select volume_name from volhistory where type in ('BACKUPFULL', 'BACKUPINCR', 'DBSNAPSHOT', 'EXPORT'))

########################################################################################################
# Show tapes returned from vault that are in the library but still in VAULT status.  These can be ejected and put on the racks.  Just do a CHECKOUT
# command to remove them from the library and place them on the rack.
########################################################################################################
select volumes.volume_name, volumes.stgpool_name, drmedia.state from volumes, drmedia where volumes.volume_name in \
(select volume_name from libvolumes) and access='OFFSITE' and drmedia.volume_name=volumes.volume_name

########################################################################################################
# This one pumps out filespaces that have been missed for active nodes.  If
# the contacts field has one of the special key words in it then they are skipped.
########################################################################################################
select node_name as "Node Name", filespace_name as "File Space Name", filespace_type as "File Space Type", \
substr(cast(backup_start as char(26)),1,16) as "Last Backup Begin", substr(cast(backup_end as char(26)),1,16) \
as "Last Backup End" from filespaces where backup_start >current_timestamp - 7 days and backup_end < current_timestamp - 22 hours \
and node_name not in (select node_name from nodes where domain_name in ('PD_WKSTATION_DEFAULT') or upper(contact) in ('*SUSPENDED*', '*RETIRED*') \
or upper(contact) like '%*NO AUDIT*%') order by 3,4,1,2

########################################################################################################
#We have developed a way to look for Nodes that have not backed up in the
#last 30 days and also turn off scanning by putting key words in the contact field.
########################################################################################################
select node_name as "Node Name", substr(cast(lastacc_time as char(26)),1,16) as "Last Access" from nodes where upper(contact) not in ('*SUSPENDED*', '*RETIRED*') and upper(contact) not like '%*NO AUDIT*%' and lastacc_time < current_timestamp - 23 hours and lastacc_time >current_timestamp - 30 days and domain_name not in ('PD_WKSTATION_DEFAULT') order by 2 desc

########################################################################################################
# These are message numbers you should be concerned about.  Tapes marked
# UNAVAILABLE, drives offline, I/O errors, etc.  I could have used an "in"
# verb with a string, but at the time I did not know how to do that.
########################################################################################################
select substr(cast(date_time as char(26)),1,16) as "date time", message as "Message                                            "  from actlog where date_time >current_timestamp - 24 hours - 5 minutes and (msgno = 8359 or msgno = 8302 or msgno = 1412 or msgno = 1229 or msgno = 1402 or msgno = 1440 or msgno = 8873)

########################################################################################################
# This one tells me how many scratch tapes I have in each Library.  I do
# some really smart things in a script and send flaming emails if we are
# getting close to out of scratch tapes.
########################################################################################################
select 'Total', Library_name, count(*) as "Count of Scratch Tapes" from libvolumes where status='Scratch' group by library_name

########################################################################################################
# My favorite that saves the bacon.  Remember the backup stgpool command
# skips volumes in the primary pool that are unavailable.  I run a script to backup a storage pool and do something similar below and generate an error
# if I find a volume in the primary pool that is UNAVAILABLE.  Remember, if you get a RC=11 from this you are OK, zero is bad news.
########################################################################################################
select volume_name, stgpool_name from volumes where access in ('UNAVAILABLE','DESTROYED')

########################################################################################################
#This one is an example of how to create a command for each volume from a
#select.  You will have to edit your.output.file to trim off the title lines.
#The where clause here may not be very useful for you, but it demonstrates
#the process.  Once you have edited the file you can use a macro command to
#execute it.
########################################################################################################
select 'checkout libvolume', 'your-atl', volume_name, 'remove=yes' from volumes where access<>'READWRITE' and stgpool_name = 'your-offsite-stg-pool' and volume_name in (select volume_name from libvolumes) > your.output.file

########################################################################################################
# space usage by domain
########################################################################################################
select nodes.DOMAIN_NAME,sum(occupancy.physical_mb) as "Space used" from nodes,occupancy where nodes.NODE_NAME=occupancy.node_name group by nodes.DOMAIN_NAME order by 2 desc

DOMAIN_NAME                                   Unnamed[2]
------------------     ---------------------------------
AIX_TEST_SERVERS                                74797.36
NISA_DOM                                      6611720.74
NOVELL_CLIENTS                                  21867.84
NT_CLIENTS                                     391218.06

########################################################################################################
# total space per a domain
########################################################################################################
select sum(occupancy.physical_mb) from nodes,occupancy where DOMAIN_NAME='NISA_DOM' and nodes.NODE_NAME=occupancy.node_name

                       Unnamed[1]
---------------------------------
                       6611720.74

########################################################################################################
# space usage per node in a domain
# DOMAIN_NAME='NISA_DOM' and
########################################################################################################
select nodes.NODE_NAME,sum(occupancy.physical_mb) as "Space used" from nodes,occupancy where  \
nodes.NODE_NAME=occupancy.node_name group by nodes.NODE_NAME order by 2 desc

NODE_NAME                                     Space used
------------------     ---------------------------------
UNXR                                         56675918.13
MS                                           10198241.86

########################################################################################################
# Space used per node
########################################################################################################
select nodes.NODE_NAME,sum(occupancy.physical_mb) as "MB" from nodes,occupancy where nodes.NODE_NAME=occupancy.node_name group by nodes.NODE_NAME order by 2 desc

NODE_NAME                                     Unnamed[2]
------------------     ---------------------------------
KOSTELNJ_LAPTOP                                   359.85
ARA                                               635.25
ARA2                                              676.14
BOULETB                                           767.64
DBA3                                              905.97
DBA1                                             1257.39
UNXZ                                             4274.11

########################################################################################################
# avg compression ratio
########################################################################################################
select avg(EST_CAPACITY_MB)/100000 as "Average Compression Raito" from volumes where DEVCLASS_NAME='LTO' and EST_CAPACITY_MB != 0.0

        Average Compression Raito
---------------------------------
                 1.90164878125000

########################################################################################################
# amount backed up last night
########################################################################################################
select summary.entity as "NODE NAME", nodes.domain_name as "DOMAIN", nodes.platform_name as "PLATFORM", \
cast((cast(sum(summary.bytes) as float) / 1024 / 1024) as decimal(10,2)) as MBYTES , \
count(*) as "CONECTIONS" from summary ,nodes where summary.entity=nodes.node_name and \
summary.activity='BACKUP' and start_time >current_timestamp - 1 day group by entity, domain_name, platform_name \
order by MBytes desc

NODE NAME              DOMAIN                 PLATFORM                   MBYTES      CONECTIONS
------------------     ------------------     ----------------     ------------     -----------
UNXR                   NISA_DOM               AIX                      72963.48               8
UNXP                   NISA_DOM               AIX                      34052.88               9
UNXM                   NISA_DOM               AIX                      10923.21               6
CITRIX01               NT_CLIENTS             WinNT                      734.06               2
WAG                    NT_CLIENTS             WinNT                      454.40               2

########################################################################################################
# list each node name, file space name and the sum of all the files in that filespace
#
# good
########################################################################################################
dsmadmc -id=query -password=query 'select NODE_NAME, FILESPACE_NAME as "Filespace                            ", sum(PHYSICAL_MB)/1024 as "GB" from OCCUPANCY group by NODE_NAME, FILESPACE_NAME order by GB desc'

select NODE_NAME, FILESPACE_NAME as "Filespace Name                       ", sum(PHYSICAL_MB)/1024 as "GB" from OCCUPANCY \
group by NODE_NAME, FILESPACE_NAME order by GB desc

########################################################################################################
# To delete old FS
########################################################################################################
dsmadmc -id=query -password=query 'select NODE_NAME, FILESPACE_NAME as "Filespace                            ", sum(PHYSICAL_MB)/1024 as "GB" from OCCUPANCY group by NODE_NAME, FILESPACE_NAME order by GB desc' | grep u0 | awk '{ print "del filespace " $1 " " $2 "\ny\n"}'

########################################################################################################
#
########################################################################################################
q actlog begind=-1 search='ANR1214I' | join_tsm_actlog | grep -vE "ANR2017I|----|====|Output|join_tsm_actlog|Tivoli|^ *$" | sed "s/^.*Bytes Backed Up: //g" | sed "s/, Unreadable Files.*$//g"

########################################################################################################
# find tapes to reclaim
########################################################################################################
select VOLUME_NAME,STGPOOL_NAME,PCT_RECLAIM from volumes where PCT_RECLAIM>90 order by PCT_RECLAIM

########################################################################################################
# Time spent archiving...shouldn't be too high
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='ARCHIVE' and cast(date(current_timestamp)-date(start_time) as integer)<30

DURATION
--------------------------------
215 22:28:00.000000

########################################################################################################
# Time spent backing up...shouldn't be too high
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='BACKUP' and cast(date(current_timestamp)-date(start_time)as integer)<30

DURATION
--------------------------------
767 02:33:02.000000

########################################################################################################
# Time spent performing copystg
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='STGPOOL BACKUP' and days(current_timestamp)-days(start_time)<30

DURATION
--------------------------------
20 20:17:30.000000

########################################################################################################
# Time spent doing full db backups
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='FULL_DBBACKUP' and cast(date(current_timestamp)-date(start_time)as integer)<30

DURATION
--------------------------------
0 23:19:12.000000

########################################################################################################
# How much time is spent performing expiration
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='EXPIRATION' and cast(date(current_timestamp)-date(start_time)as integer)<30

DURATION
--------------------------------
16 02:25:03.000000

########################################################################################################
# How much time was spent migrating stuff
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='MIGRATION' and cast(date(current_timestamp)-date(start_time)as integer)<30

DURATION
--------------------------------
79 01:06:08.000000

Total time spent with the tapes mounted
select sum(end_time-start_time) as duration from summary where
activity='TAPE MOUNT' and cast(date(current_timestamp)-date(start_time)as
integer)<30

DURATION
--------------------------------
140 10:48:41.000000

########################################################################################################
# Total time each drive was spent mounted.....look for anomalies
########################################################################################################
select sum(end_time-start_time) as duration, drive_name as "     D R I V E N A M E   "from summary where activity='TAPE MOUNT' \
and cast(date(current_timestamp)-date(start_time)as integer)<30 group by drive_name

DURATION          D R I V E   N A M E
--------------------------------     ---------------------------
23 14:40:33.000000     DRIVE0 (/dev/rmt1)
22 23:27:46.000000     DRIVE1 (/dev/rmt2)
23 19:42:04.000000     DRIVE2 (/dev/rmt3)
23 05:26:06.000000     DRIVE3 (/dev/rmt4)
23 16:35:07.000000     DRIVE4 (/dev/rmt5)
23 02:57:05.000000     DRIVE5 (/dev/rmt6)

########################################################################################################
# Time spent reclaiming
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='RECLAMATION' and cast(date(current_timestamp)-date(start_time)as integer)<30

DURATION
--------------------------------
26 01:50:27.000000

########################################################################################################
# Time spent restoring
########################################################################################################
select sum(end_time-start_time) as duration from summary where
activity='RESTORE' and cast(date(current_timestamp)-date(start_time)as
integer)<30


DURATION
--------------------------------
7 20:02:45.000000

########################################################################################################
# The number of tapes in the offsite copy stgpools
########################################################################################################
select count(volume_name) as "Num Vols", stgpool_name from volumes where  \
stgpool_name in (select stgpool_name from stgpools where pooltype='COPY'  \
and devclass<>'DISK') group by stgpool_name

   Num Vols     STGPOOL_NAME
-----------     ------------------
        102     OFFSITE
         66     ONSITE_BACKUP

########################################################################################################
# Number of volumes in the primary storagepool
########################################################################################################
select count(volume_name) as "Num Vols", stgpool_name from volumes where stgpool_name in (select stgpool_name from stgpools where pooltype='PRIMARY' and devclass<>'DISK') group by stgpool_name

   Num Vols     STGPOOL_NAME
-----------     ------------------
         17     ARCHIVE
         25     BACKUP
         10     BACKUP_FC
         52     DATABASE
          3     DATABASE_ONSITE
          2     ONSITE

########################################################################################################
# Number of volumes in all STG
########################################################################################################
select count(volume_name) as "Num Vols", stgpool_name from volumes group by stgpool_name order by 1

   Num Vols     STGPOOL_NAME
-----------     ------------------
          1     DIRMCSTGPOOL
          1     DISKDATA_SMALL
          2     DISKDATA_ONSITE
          2     ONSITE
          4     DISKDATA_FC
          6     DISKDATA_ARCHIVE
          8     DISKDATA_DATABASE
         10     DATABASE_ONSITE
         11     BACKUP_FC
         11     DISKDATA
         22     ARCHIVE
         35     BACKUP
         60     DATABASE
         79     ONSITE_BACKUP
        122     OFFSITE

########################################################################################################
# Filespaces that are dormant for more than 40 days.....can be exported and removed form the database
########################################################################################################
select node_name as "     N O D E     N A M E    ", filespace_name AS " F I L E S P A C E   N A M E    ", DATE(backup_end) AS "DATE", \
cast(date(current_timestamp)-date(backup_end) as integer) as "Days", capacity pct_util from filespaces where \
cast(date(current_timestamp)-date(backup_end) as integer)>40 order by 3 asc


########################################################################################################
#List the nodes that have had no activity for 60 day and list how much
#space they are taking up......these too can be exported and removed from
#the database
########################################################################################################
select node_name as "Node", backup_mb as "Backup", backup_copy_mb as "Ba Copy", archive_mb as "Archive", archive_copy_mb as "Arch Copy", total_mb \
from auditocc where node_name in (select node_name from nodes where cast(date(current_timestamp)-date(lastacc_time)as integer)>60 ) order by TOTAL_MB desc

########################################################################################################
# How big is each backup on average each day...look for the biggest hits &
# look for better ways to perform the backup
########################################################################################################
select entity as "           NODE   NAME               ", cast(sum(bytes/1024/1024/1024/30) as decimal(8,2)) as "Daily GB" from summary \
where activity='BACKUP' and cast(date(current_timestamp)-date(start_time) as integer)<30 group by entity order by "Daily GB" desc

########################################################################################################
# How many node on each tape in a collocated storage pool(TAPEPOOL-EC).....it should be a very low number
########################################################################################################
select count(distinct node_name) as "Number of Nodes", volume_name from volumeusage where stgpool_name='SQLBTPRD_TAPE' group by volume_name order
by "Number of Nodes" desc

########################################################################################################
# How many tapes would it take to recover each client in a collocated
# storage pool. This can be run over all stroage pools......... Again this
# should be a low number, but usually larger than expected
########################################################################################################
select count(distinct volume_name) as "Number of Tapes", node_name from
volumeusage where stgpool_name='SQLBTPRD_TAPE' group by node_name,
stgpool_name order by "Number of Tapes" desc

How many tapes would be needed to recover all clients..per client
select count(distinct volume_name) as "Number of Tapes", node_name,
stgpool_name from volumeusage group by node_name, stgpool_name order by
"Number of Tapes" desc


########################################################################################################
#How much data is copied each day from and to each storagepool...should equal the amount backed up/migrated
########################################################################################################
select entity as " F R O M    -    T O   S T G ", cast(sum(bytes/1024/1024/30) as decimal(8,2)) as "Daily MB" from summary \
where activity='STGPOOL BACKUP' and cast(date(current_timestamp)-date(start_time)as integer)<30 group by \
entity order by "Daily MB" desc

########################################################################################################
# How many volumes in the library
########################################################################################################
select library_name, count(volume_name) as "Vols", status from libvolumes group by library_name, status

LIBRARY_NAME                  Vols     STATUS
------------------     -----------     ----------
3584ATL                        467     Private
3584ATL                         56     Scratch

########################################################################################################
# List maxscratch, number of scratch and collocation for all storage pools
########################################################################################################
select a.stgpool_name, b.maxscratch, count(a.volume_name) as "Scratch" from VOLUMES a, stgpools b where a.stgpool_name=b.stgpool_name group by \
a.stgpool_name, b.maxscratch

########################################################################################################
#Info on access, collocation, maxscr and reu for the copy stgpools
########################################################################################################
select stgpool_name, access, collocate, maxscratch, reusedelay from stgpools where pooltype='COPY'

########################################################################################################
# Info on access, collocation, maxscr and reu for the primary stgpools
########################################################################################################
select stgpool_name, access, collocate, maxscratch, reusedelay from stgpools where pooltype='PRIMARY'

########################################################################################################
Migration information. Total, average and maximum migrated
########################################################################################################
select entity, cast(sum (bytes/1024/1024/1024) as decimal (18,2)) as "SUM GB", cast(avg(bytes/1024/1024/1024) as decimal (10,2)) as "AVG GB", \
cast(max(bytes/1024/1024/1024) as decimal (12,2))as "MAX GB" from summary where activity='MIGRATION' group by entity

########################################################################################################
# Number of migpr fir disk stgpools
########################################################################################################
select stgpool_name, migprocess from stgpools where devclass='DISK'

########################################################################################################
# Number of volumes in the disk stgpools.....should be 4-6
########################################################################################################
select count(volume_name) as "Number of Volumes", stgpool_name from volumes where stgpool_name like '%DISK%' group by stgpool_name

########################################################################################################
# Name and size of the volumes in the disk stgpool....should be equal
########################################################################################################
select volume_name as "    V  O  L  U  M  E       N A M E      ", stgpool_name, est_capacity_mb from volumes where stgpool_name like 'DISK%'

########################################################################################################
# Tape info write passes, write errors, read errors
########################################################################################################
SELECT VOLUME_NAME AS "VOLUME", STGPOOL_NAME AS "STGPOOL", WRITE_PASS AS "WP",  WRITE_ERRORS AS "WE", READ_ERRORS AS "RE" FROM VOLUMES WHERE \
WRITE_PASS>1 OR WRITE_ERRORS>0 OR READ_ERRORS>0

########################################################################################################
# Volumes not readwrite
########################################################################################################
select volume_name AS "          V O L U M E    N A M E           ", ACCESS from volumes where access in ('READONLY','UNAVAILABLE')

########################################################################################################
# Volumes below 50% utilized (that are full)
########################################################################################################
select count(*) as "Number of Volumes below 50pct util" from volumes where devclass_name like'%ATL%' and PCT_utilized<50 and status='FULL'

########################################################################################################
#
########################################################################################################
select sum(end_time-start_time) as duration from summary where activity='TAPE MOUNT' and days(current_timestamp)-days(start_time)<30

This will result in something like
39 05:48:51.000000
This is 39 days, 5 hours and 48 minutes.

########################################################################################################
# DB fragmetation
########################################################################################################
SELECT CAST((100 - (CAST(MAX_REDUCTION_MB AS FLOAT) * 256 ) / (CAST(USABLE_PAGES AS FLOAT) - CAST(USED_PAGES AS  FLOAT) ) * 100) \
AS DECIMAL(4,2)) AS PERCENT_FRAG FROM DB

PERCENT_FRAG
------------
9.58

Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tsm commands

hi all, In my shell script, they have used the bplist commands where backup team were using the bplist utility and right now they have changed the utility to TSM. Could you please help me out the revelant commands for TSM utility for the backup. Let me know if you have any idea on tis. (1 Reply)
Discussion started by: ramkumar15
1 Replies

2. Linux

Tsm

my backup team was using the bpclient utility which they are migrated to TSM client. I need to change the script running from bpclient to TSM . if anyone give some inputs that would be great. (2 Replies)
Discussion started by: ramkumar15
2 Replies

3. Red Hat

TSM service not found

Hello, I have some trouble checking the TSM ( Tivoli storage Mgr )service status in Linux box when i am doing service tsm status -bash: service command not found Above command is working fine in all other linux box ( Any idea how to look into this to resolve this, i am clueless from... (2 Replies)
Discussion started by: saurabh84g
2 Replies

4. AIX

TSM backup and recovery problem

When I use tsm command: archive -subdir=yes /dir1/ to backup file system: /dir1 After I delete the contents under /dir1 and recovery it from TSM backup, retrieve /dir1/ I found the link breaked. Such as: Before: ls -l lrwxrwxrwx 1 abc develop 8 Apr 28 16:04 bin... (1 Reply)
Discussion started by: rainbow_bean
1 Replies

5. Solaris

TSM Storage agent performance

Guys, I have TSM Lanfree on a 5220, Being an AIX Admin I'm looking for help on Solaris. Detailed Monitoring provided by Teamquest. The problem is that although the 'root' owned 'dsmsta quiet' process is apparently using 27 software threads they never add up to more than 1/64th of the... (0 Replies)
Discussion started by: SHCART
0 Replies

6. Linux

tsm client (basic question)

Hello, i was trying to install tsm client on a linux box(i386) I get asked for a lot of dependent filesets. I dont have the cd? how can i get these?? is there a way to copy these from a server which has it? and how do i check if a server has it? rpm -qa|grep fileset?? pls advice # rpm -ivh... (4 Replies)
Discussion started by: karthikosu
4 Replies

7. AIX

Backup solutions / TSM alternative?

Hey all, I've just about had it with Tivoli Storage Manager. I won't go into the what's and why's. Do any of you have suggestions for an alternative? We have around 70 linux clients and 10 AIX lpars. We mostly do incremental filesystem backups each night and have a 3494 tape library with 3... (2 Replies)
Discussion started by: cruiser
2 Replies
Login or Register to Ask a Question