Spirit Software Solutions - TSM Administration and Reporting made easy
Spirit Software Solutions
  • DownloadDownload Products
  • PurchasePurchase Products
  • ProductsOur Products
    • SP Studio
    • TSM Studio Server
  • SupportProduct Support
    • Open a case
    • Helpful TSM SQL Commands
    • Knowledge Base
    • Known Issues
    • Pre Release
    • TSM Studio Documentation
  • ResellersResell TSM Studio
  • Contact UsGet in Touch With Us
Knowledge Base

Helpful TSM SQL Commands

Show all Client Nodes that are not in a Collocation Group

For TSM version 5

SELECT * FROM NODES WHERE NODE_NAME NOT IN ( SELECT NODE_NAME FROM COLLOCGROUP WHERE NODE_NAME IS NOT NULL )

 

For TSM version 6 and above

SELECT * FROM NODESVIEW WHERE NODE_NAME NOT IN ( SELECT NODE_NAME FROM COLLOCGROUP WHERE NODE_NAME IS NOT NULL )

Permalink.

Get the Number of Client Nodes on a TSM Server

For TSM v 5

SELECT COUNT(*) FROM NODES

 

For TSM v6 and above

SELECT COUNT(*) FROM NODESVIEW

Permalink.

Show all the Management Classes Used by Client

SELECT DISTINCT NODE_NAME, CLASS_NAME FROM BACKUPS WHERE NODE_NAME=’XXXXX’

Replace XXXXX with your node name

Permalink.

Show the number of Linux Client Nodes on a TSM Server

TSM v5

SELECT COUNT(*) FROM NODES WHERE PLATFORM_NAME LIKE ‘%LINUX%’

 

TSMv6 and above

SELECT COUNT(*) FROM NODESVIEW WHERE PLATFORM_NAME LIKE ‘%LINUX%’

Permalink.

Show the number of Windows Clients on a TSM Server

TSM v5

SELECT COUNT(*) FROM NODES WHERE PLATFORM_NAME LIKE ‘WIN%’

TSM v6 and above

SELECT COUNT(*) FROM NODESVIEW WHERE PLATFORM_NAME LIKE ‘WIN%’

Permalink.

Show All Filespaces that have not backed up or did not backup successfully

TSM v5

SELECT NODE_NAME, FILESPACE_NAME from FILESPACE  WHERE BACKUP_END IS NULL OR BACKUP_END < BACKUP_START

 

TSMv6

SELECT NODE_NAME, FILESPACE_NAME from FILESPACEVIEW  WHERE BACKUP_END IS NULL OR BACKUP_END < BACKUP_START

Permalink.

Show the number of TDP Agents on a TSM Server

TSM v5

SELECT COUNT(*) FROM NODES WHERE PLATFORM_NAME LIKE ‘%DP%’

 

TSMv6 and above

SELECT COUNT(*) FROM NODESVIEW WHERE PLATFORM_NAME LIKE ‘%DP%’

Permalink.

Show the number of AIX Client Nodes on a TSM Server

TSM v5

SELECT COUNT(*) FROM NODES WHERE PLATFORM_NAME LIKE ‘%AIX%’

 

TSMv6 and above

SELECT COUNT(*) FROM NODESVIEW WHERE PLATFORM_NAME LIKE ‘%AIX%’

Permalink.

Show the number of Solaris Client Nodes on a TSM Server

TSM v5

SELECT COUNT(*) FROM NODES WHERE PLATFORM_NAME LIKE ‘%SOLARIS%’

 

TSMv6 and above

SELECT COUNT(*) FROM NODESVIEW WHERE PLATFORM_NAME LIKE ‘%SOLARIS%’

Permalink.

Show a list of unavailable volumes

SELECT * FROM VOLUMES WHERE ACCESS=’UNAVAILABLE’

Permalink.

Show a list of read only volumes

SELECT * FROM VOLUMES WHERE ACCESS=’READONLY’

Permalink.

Show the Number of Readonly Volumes

SELECT COUNT(*) FROM VOLUMES WHERE ACCESS=’READONLY’

Permalink.

Show the number of Offsite Volumes

SELECT COUNT(*) FROM VOLUMES WHERE ACCESS=’OFFSITE’

Permalink.

Show all Offsite Volumes

SELECT * FROM VOLUMES WHERE ACCESS=’OFFSITE’

Permalink.

Show the number of volumes used by each node sorted by node name

SELECT NODE_NAME, COUNT(DISTINCT VOLUME_NAME) AS VOLUME_COUNT FROM VOLUMEUSAGE GROUP BY NODE_NAME ORDER BY NODE_NAME

or in reverse order

SELECT NODE_NAME, COUNT(DISTINCT VOLUME_NAME) AS VOLUME_COUNT FROM VOLUMEUSAGE GROUP BY NODE_NAME ORDER BY NODE_NAME DESC

Permalink.

Show the number of volumes used by each node sorted by number of volumes used

SELECT NODE_NAME, COUNT(DISTINCT VOLUME_NAME) AS VOLUME_COUNT FROM VOLUMEUSAGE GROUP BY NODE_NAME ORDER BY VOLUME_COUNT

or in reverse order

SELECT NODE_NAME, COUNT(DISTINCT VOLUME_NAME) AS VOLUME_COUNT FROM VOLUMEUSAGE GROUP BY NODE_NAME ORDER BY VOLUME_COUNT DESC

Permalink.

Show all Client Nodes with no data

TSM v6 and Above

SELECT NODE_NAME FROM NODESVIEW WHERE NODE_NAME NOT IN (SELECT NODE_NAME FROM OCCUPANCY)

 

Permalink.

Show the Number of Nodes per Schedule

SELECT DOMAIN_NAME,SCHEDULE_NAME,COUNT(NODE_NAME) AS NUMBER_OF_NODES FROM ASSOCIATIONS GROUP BY DOMAIN_NAME,SCHEDULE_NAME

Permalink.

Show the number of scratch tapes per library

NOTE: Wont show anything for a library that has no scratch tapes available, for that use TSM Studio

SELECT LIBRARY_NAME,COUNT(*) AS NUM_SCRATCH FROM LIBVOLUMES WHERE UPPER(STATUS)=’SCRATCH’ GROUP BY LIBRARY_NAME

Permalink.

Show all volumes in an error state

SELECT * FROM VOLUME WHERE UPPER(ERROR_STATE) = ‘YES’

Permalink.

Show volumes with write errors

SELECT * FROM VOLUMES WHERE WRITE_ERRORS>5     (Use a number relevant for your environment, this should be 0 if using a VTL)

 

NOTE: The > symbol when using the TSM Admin CLI is also used for redirection. To ensure it is used for correct intention here as a GREATER THAN sign remove the spaces on either side of the > symbol

Permalink.

Show volumes with read errors

SELECT * FROM VOLUMES WHERE READ_ERRORS>5     (Use a number relevant for your environment, this should be 0 if using a VTL)

 

NOTE: The > symbol when using the TSM Admin CLI is also used for redirection. To ensure it is used for correct intention here as a GREATER THAN sign remove the spaces on either side of the > symbol

Permalink.

Show the number of volumes with more than 50% reclaimable space

SELECT COUNT(*) AS NUM_RECLAIMABLE_TAPES FROM VOLUMES WHERE PCT_RECLAIM>50

Permalink.

Show the number of volumes used grouped by Storage Pool

SELECT STGPOOL_NAME, COUNT(VOLUME_NAME) AS VOLUME_COUNT FROM VOLUMES GROUP BY STGPOOL_NAME

Permalink.

Show how many error messages have happened in the last 24 hours

SELECT COUNT(*) AS ERROR_MESSAGE_COUINT FROM ACTLOG WHERE SEVERITY = ‘E’ AND DATE_TIME> ‘YYYY-MM-DD HH:MM‘

WHERE
YYYY = Year
MM = Month
DD = Day
HH = Hour
MM = Month

Permalink.

Show how many debug messages have happened in the last 24 hours

SELECT COUNT(*) AS DEBUG_MESSAGE_COUINT FROM ACTLOG WHERE SEVERITY = ‘D’ AND DATE_TIME> ‘YYYY-MM-DD HH:MM‘

WHERE
YYYY = Year
MM = Month
DD = Day
HH = Hour
MM = Month

Permalink.

Show how many warning messages have happened in the last 24 hours

SELECT COUNT(*) AS WARNING_MESSAGE_COUINT FROM ACTLOG WHERE SEVERITY = ‘W’ AND DATE_TIME> ‘YYYY-MM-DD HH:MM‘

WHERE
YYYY = Year
MM = Month
DD = Day
HH = Hour
MM = Month

Permalink.

Show all drives that are offline

SELECT * FROM DRIVES WHERE UPPER(ONLINE)<>’YES’

Permalink.

Show all paths that are offline

SELECT * FROM PATHS WHERE UPPER(ONLINE)<>’YES’

Permalink.

    • Home
    • FAQ
    • IBM Redbooks
    • Known Issues
    • Pre Release
    • Privacy Policy
    • Product Comparison
    • Sitemap
    • TSM Documentation
    • TSM Studio Dataviews
    • TSM Studio Documentation
    • TSM Resources
    • TSM Studio Videos
  • Twitter

    • #WCF If you are looking for an easy authentication method that you can use in WCF with multiple service contracts - http://t.co/ZjGu8UNJvF 25 April from Twitter Web Client
    • See the new blog on #TSMStudio posted on the tsmblog website - http://t.co/WHhd2oWRXa. 25 April from Twitter Web Client
    • Just finished the Microsoft WCF learning stream at http://t.co/oy2RmpnBqy absolutely fantastic way to understand WCF in-depth. 16 April from Twitter Web Client
    @spirit_software
  • Recent Comments

    • Operational Reporting Viewer - Spirit Software Solutions on How to uninstall6 years ago[…] Supported on Windows XP SP3, Vista. ...
    • TSM Studio Alerting - Spirit Software Solutions on How to uninstall6 years ago[…] TSM Studio Alerting Client Supported on ...
    • TSM Studio Operational Reporting - Spirit Software Solutions on How to uninstall6 years ago[…] TSM Studio Operational Reporting Client Supported ...
  • RSS IBM TSM Notifications

    • An error has occurred, which probably means the feed is down. Try again later.
© 2014 Spirit Software Solutions
  • Download
  • Purchase
  • Products
  • Support
  • Resellers
  • Contact Us