Last modified 13 years ago Last modified on 11/07/07 11:01:48

Some useful SQL queries on Companion Database

get location of a file

SELECT * FROM cacheinfo WHERE pnfsid='<pnfsid>';

get list of files on a pool

SELECT * FROM cacheinfo WHERE pool='<pool name>';

rename a pool

UPDATE cacheinfo SET pool='<new name>' WHERE pool='<old name>';

retire a pool

DELETE FROM cacheinfo WHERE pool='<dead pool>';

cleanup a removed file

DELETE FROM cacheinfo WHERE pnfsid='<removed file>';

count number of files per pools ( takes a time)

SELECT pool, count(*) FROM cacheinfo GROUP BY pool;