Orphaned Filespaces

From Wikistix
Jump to: navigation, search

To report filespaces that exist in the filespaces table, but have no corresponding entry in the occupancy table. The following SQL can be run on the TSM server via dsmadmc, but may take a while to run.

select node_name, filespace_name
from filespaces f
where not exists
  (select node_name, filespace_name
   from occupancy o
   where f.node_name = o.node_name and f.filespace_name = o.filespace_name);

If using a copy of the filespace and occupancy tables in MySQL, the following is simpler, but functionally equivalent:

select f.node_name, f.filespace_name
from filespaces f left join occupancy o using (node_name, filespace_name)
where o.node_name is null;

Misinformation found herein copyright Paul Ripke (aka “stix”) stixpjr@gmail.com.