User Tools

Site Tools


tsm:tsm_select

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tsm:tsm_select [2022/12/19 14:57]
manu
tsm:tsm_select [2023/11/13 09:14] (current)
manu
Line 2: Line 2:
  
 https://​github.com/​thobiast/​tsm_sql https://​github.com/​thobiast/​tsm_sql
 +
 +https://​thobias.org/​tsm/​sql/​
  
 http://​www.lascon.co.uk/​tsm-sql-queries.php http://​www.lascon.co.uk/​tsm-sql-queries.php
Line 15: Line 17:
 ===== Advanced select ===== ===== Advanced select =====
  
-I use the following select command to anonymize data from TSM +I use the following select command to **anonymize** data from TSM 
 +  * node_name is replaced by first 3 letters + node_id 
 +  * IP, and other vital info are replaced by **0** 
 +<cli prompt='>'>​ 
 +SP> select concat(substr(char(node_name),​1,​3),​NODE_ID) AS NODE_NAME,​NODE_ID,​PLATFORM_NAME,​DOMAIN_NAME,'​0','​0','​0'​ from NODES  
 +</​cli> ​
  
 +<cli prompt='>'>​
 +SP> select concat(substr(char(a.node_name),​1,​3),​a.NODE_ID) AS NODE_NAME,​o.type,​concat('​fs',​o.FILESPACE_ID) as fs,​o.STGPOOL_NAME,​o.NUM_FILES,​o.PHYSICAL_MB,​o.LOGICAL_MB,​o.REPORTING_MB,​o.FILESPACE_ID from occupancy o,nodes a where a.node_name=o.node_name
 +</​cli>​
 ===== List tables and columns in TSM ===== ===== List tables and columns in TSM =====
  
Line 549: Line 558:
 APP-SRV01 ​                            ​DEFAULT ​                                           0.0 APP-SRV01 ​                            ​DEFAULT ​                                           0.0
 APP-SRV01 ​                            ​MC_ARCHIVES_10Y ​                                 429.6 APP-SRV01 ​                            ​MC_ARCHIVES_10Y ​                                 429.6
 +</​cli>​
 +
 +===== Mgmt Class =====
 +
 +<cli prompt='>'>​
 +########################################################################################################​
 +# Is a specific MGMT_CLASS used
 +########################################################################################################​
 +Protect: TSM1> SELECT b.node_name,​ b.filespace_name,​ b.class_name,​ CAST(FLOAT(SUM(bk.bfsize))/​1024/​1024/​1024 as DEC(14,1)) as size_gb, -
 +cont> count( bk.bfsize ) as number_of_objects FROM  backups b, backup_objects bk WHERE b.object_id=bk.objid and b.class_name='​MC_ORA'​ GROUP BY b.node_name,​ b.filespace_name,​ b.class_name
 +
 +NODE_NAME ​     FILESPACE_NAME ​    ​CLASS_NAME ​         SIZE_GB ​            ​NUMBER_OF_OBJECTS
 +------------- ​ -------------- ​    ​----------------- ​  ​----------------- ​  ​-------------------
 +APP-ORA01 ​     /​tsmorc ​           MC_ORA ​             158.1               12600
 +APP-ORA02 ​     /​tsmorc ​           MC_ORA ​             208.1               12800
 </​cli>​ </​cli>​
tsm/tsm_select.1671458272.txt.gz · Last modified: 2022/12/19 14:57 by manu