DBS-lite: A Minimal Database for Laptops

If you want to install and run DBMauto to maintain a full copy of the database, see Slave Site Operation

Introduction

A number of MINOS collaborators run or wish to run the MINOS Database on their laptops, most often for the purposes of analysis software running or development. The Database can be installed using the standard priming set, but the Database is becoming very big now (~ 30GB in full), too large for the average laptop, and takes too long to download for the average physicist. The typical development jobs a laptop Database user would run do not need the Database in all its glory, and a representative "slice" of data will normally suffice. This Database slice can be obtained using the --dbs-lite option to the dump_table_context_query.perl DB maintenance tool.

Creating the DBS-Lite Tables

The tool dump_table_context_query.perl is normally used to dump a slice of a database table for a given context (date,detector and data type).

The --dbs-lite option changes the behaviour to:-

  1. Make the data universal by extending the validity to cover all times
  2. Convert the normal table update into a table replacement.
For example to dump UGLIDBIGEOMETRY:-
 $SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/dump_table_context_query.perl \
    --host <host> --username  <user> --password <pswd> --dbs-lite            \
    --database <database (usually offline)> UGLIDBIGEOMETRY 
which should create the file:-
  UGLIDBIGEOMETRY-DBS-LITE.tar.gz
A list of the minimal set of tables required to run standard off line code is maintained at:-
  /afs/fnal.gov/files/data/minos/d210/database_dumps/prime_xxxxxxxx.lis

  where xxxxxxxx = current update number
so to generate a complete set of tables for your laptop, start from a place where you can access your favourite maintained database server, and do the following:-

  mkdir   <some scratch directory> 
  cd <some scratch directory> 

and then, for sh/bash shells:-
  for table in `cat /afs/fnal.gov/files/data/minos/d210/database_dumps/prime_*.lis`
  do
    $SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/dump_table_context_query.perl  \
      --host <host> --username  <user> --password <pswd> --dbs-lite              \
      --database <database> $table
  done
or for csh/tcsh shells:-
  foreach table (`cat /afs/fnal.gov/files/data/minos/d210/database_dumps/prime_*.lis`)
    $SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/dump_table_context_query.perl  \
      --host <host> --username  <user> --password <pswd> --dbs-lite              \
      --database <database> $table
  end

Applying the DBS-Lite Tables

Caution: Applying an update file created using the --dbs-lite option will completely erase any existing data from the table from the database. You have been warned!

To apply a single update file, e.g. UGLIDBISTRIPSTRUCT-DBS-LITE.tar.gz held in the current work directory, do:-

$SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/load_tables.sh  \
      --host <host> --username  <user> --password <pswd>      \
      --database <database> --tar_dir ./ UGLIDBISTRIPSTRUCT-DBS-LITE.tar.gz
To do this on your laptop for a complete set of tables as described in the previous section, collect up the files and place them on the laptop and cd to the directory that holds them. Then, for sh/bash shells:-
  for file in `ls *-LITE.tar.gz`
  do
    $SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/load_tables.sh  \
        --host <host> --username  <user> --password <pswd>        \
        --database <database> --tar_dir ./  $file
  done
or for csh/tcsh shells:-
  foreach table (`ls *-LITE.tar.gz`)
    $SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/load_tables.sh  \
        --host <host> --username  <user> --password <pswd>        \
        --database <database> --tar_dir ./  $file
  end

Last Modified: $Date: 2007/09/07 15:31:42 $