banner_bild_01 banner_bild_02 banner_bild_03 banner_bild_04 banner_bild_05
banner_bild_06 banner_bild_07 banner_bild_08

TSM SQL Beginners Tutorial (9)

button-home

Home SQL

arrow

Previous

Next

Sometimes you want to know, how many entries of a certain type exist in the database. Lets write a query telling you, how many Objects the node Benjamin has currently stored from backups at the TSM Server. We use the "Backups" Table in the TSM database. We'll take a quick look at the entire table first. Since we don't want the TSM Server to transfer possibly gigabytes of object information about everything ever backed up, we define the scope carefully and tell TSM to display information about objects stored by node 'Benjamin' and saved from the file space \\benjamin\c$. Note that we concatenate the two conditions node_name='BENJAMIN' and filespace_name='\\benjamin\c$' using the SQL "and" clause. This results in SQL delivering only those entries fitting both conditions. Instead of "and" you can also use logical operators like "or", "and not" etc. to construct the query you want:

select * from backups where node_name='BENJAMIN' and filespace_name='\\benjamin\c$'

TSM will warn you that this query might be excessively time consuming and you will have to answer "y" in order to proceed. Depending on the node and file space you chose, TSM will probably take a couple of minutes to start (and stop) displaying the output. Choose a node and filespace that contains few objects (not your biggest fileserver). The TSM internal indexing structure is optimised for maximum backup and restore performance for clients. Select statements for informational purposes are not optimised and therefore may take some time.

      NODE_NAME: BENJAMIN
 FILESPACE_NAME: \\benjamin\c$
          STATE: ACTIVE_VERSION
           TYPE: DIR
        HL_NAME: \
        LL_NAME:
      OBJECT_ID: 6145
    BACKUP_DATE: 2002-12-30 08:29:29.000000
DEACTIVATE_DATE:
          OWNER:
     CLASS_NAME: STANDARD

      NODE_NAME: BENJAMIN
 FILESPACE_NAME: \\benjamin\c$
          STATE: ACTIVE_VERSION
           TYPE: FILE
        HL_NAME: \
        LL_NAME: 1-3200201.PRT
      OBJECT_ID: 6176
    BACKUP_DATE: 2002-12-30 08:29:29.000000
DEACTIVATE_DATE:
          OWNER:
     CLASS_NAME: DEFAULT
 

Take a brief look at the information in the Backups table. We already know node_name and filespace_name. Type reveals information about the class of the object we're looking at (Directory or File). HL_Name (HL=High Level) is the Path to the Object, relative from the file space. LL_Name (LL=Low Level) is the file name. Consequently, objects with the Type "DIR" don't have an LL_Name entry. State holds information concerning the TSM Versioning scheme (ACTIVE_VERSION means this object hasn't been backed up in a later version yet etc.). Backup_Date holds the timestamp describing when this Object has been backed up.
The previous example gave us a long list containing all this information, but what we probably need is simply the number of objects TSM currently stores for the given file space. We can gather this information by using the "count" clause. Count will not return the fitting objects themselves, but just the number of them. So lets adjust the previous example to return the number of objects backed up by node "Benjamin" from file space "\\benjamin\c$".

select count(*) as "Objects from Benjamin C:" from backups -
where node_name='BENJAMIN' and filespace_name='\\benjamin\c$'

The result will look like this:

Objects from Benjamin C:
------------------------
                 2340234

You can limit the result i.e. to count only files by adding "and type='FILE'" to your query, differentiate between active and inactive versions, select more than one nodes and file spaces etc.

 Alle erwähnten Produkte und Bezeichnungen können eingetragene Warenzeichen der jeweiligen Hersteller sein und werden als solche betrachtet.
Bei Fragen oder Problemen kontaktieren Sie bitte info@general-storage.de

Navigation  | Über GS  |  Lösungen  |  ServiceReferenzen  |  Impressum  |  Download

© 2016 by General Storage GbR. Alle Rechte vorbehalten

arrow

Previous

Next

Kontaktieren Sie uns:

Telefon: +49 6206 157686
Telefax:  +49 6206 157687
E-Mail: info@general-storage.de

arrow
arrow
GS_Logo1_Neu
gse-logo

13th ISP Symposium 2017
26.-29. September 2017,
Cologne Marriott Hotel


IBM

SSW-2258:
An Alternative to NDMP for Network Attached Storage Backup 
with dsmISI MAGS


Kundenforum
IBM Spectrum Protect und Veeam Kundenform, 28. Juni 2017, Skyloft Frankfurt Airport


Pressemitteilung:
dsmISI for Veeam ermöglicht unbegrenzte Speicher für Backups

Hier nachlesen


General Storage Lösungen
Ready for IBM Tivoli Software

tivoli_ready