Finding SURLs of files on a dCache pool
From GridPP Wiki
Contents
Step 1 - Finding the list of pnfsids on a pool
There are two ways to do this, the second one is the more versatile - it can be used if a pool had gone down, or if you have many pools to do.
Method 1 - List the data files
ls the data directory of the pool
Method 2 - SQL
Log on the companion database directly- usually on the same database instance as the pnfs databases
# psql -U srmdache companion
Redirect the output to a file
companion=> \o myfile
Adapt one of the queries below to fit your situation:
select pnfsid from cacheinfo where pool = 'csfnfs51_3';
Will list all the pnfsids on a single pool.
select pnfsid from cacheinfo where pnfsid in ( select pnfsid from cacheinfo where pool = 'csfnfs51_3') group by pnfsid having count(pool) =1;
Will list all the pnfsids on a pool, which are not on any other pool. You may also want to get the list of pnfsids which are on other pools, by replacing the
having count(pool) =1
clause with
having count(pool) >1
to allow you to check that at least one of the replicas on another pool is precious.