Show Children Hide Children

Main FTS Pages
FtsRelease22
Install
Configuration
Administration
Procedures
Operations
Development
Previous FTSes
FtsRelease21
FtsRelease21
All FTS Pages
FtsWikiPages
Last Page Update
SteveTraylen
2007-03-26

Useful FTS database queries.

It is often required to access and run some special custom query on the database to obtain particular information not available via the FTS application.

Command Line Access to the Database.

Use YAIM's site-info.def file to get the values to connect: $FTA_GLOBAL_DB_CONNECTSTRING, $FTA_GLOBAL_DB_USER and $FTA_GLOBAL_DB_PASSWORD.

$ . /opt/glite/yaim/etc/site-info.def
$  sqlplus $FTA_GLOBAL_DB_USER/"$FTA_GLOBAL_DB_PASSWORD@$FTA_GLOBAL_DB_CONNECTSTRING"
SQL>
or if you have rlwap installed.
$  rlwrap sqlplus $FTA_GLOBAL_DB_USER/"$FTA_GLOBAL_DB_PASSWORD@$FTA_GLOBAL_DB_CONNECTSTRING"
SQL>

List of Active Users on a Channel

To get a list of DNs submitting jobs to a channel:
SQL> select distinct user_dn, count(*) from t_job where channel_name = 'STAR-CERN' and 
             submit_time >= TIMESTAMP '2007-03-19 00:00:00 +00:00' group by user_dn ;
USER_DN
--------------------------------------------------------------------------------
  COUNT(*)
----------
/C=CH/O=CERN/OU=GRID/CN=XXXXXXXXXXXXX
       548

/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=YYYYYYYYYYYYYYYYYYYYY
       974
SQL> 

Check which VO a DN is in.

Given a DN to check which VO the user is operating as.
SQL> select distinct vo_name,count(*) from t_job where user_dn='/C=RU/O=RDIG/OU=users/OU=sinp.msu.ru/CN=XXXXX' 
               group by vo_name;

VO_NAME                                              COUNT(*)
-------------------------------------------------- ----------
cms                                                      3348


-- SteveTraylen - 26 Mar 2007

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2007-03-26 - SteveTraylen
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LCG All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback