====== Databases ====== ===== How to make a snapshot of the online database ===== On lxplus, do: SetupProject LHCb --dev --use-grid lhcb-proxy-init Now create a folder where your database should be, like ''~/mydatabase''. Set this path to $SQLITEDBPATH Then do: CondDBAdmin_MakeSnapshot.py --options $SQLDDDBROOT/options/SQLDDDB-Oracle.py -s 2010-02-01UTC -u yyyy-mm-ddUTC ONLINE sqlite_file:myFileName.db/ONLINE where yyyy-mm-dd is the date in year-month-day which it should cover. ===== How to access the database in the options file ===== Do from Configurables import CondDB, CondDBAccessSvc CondDB(UseOracle = False) connection="sqlite_file:/afs/cern.ch/user/initial/name/mydatabase/myFileName.db/ONLINE" CondDB().addLayer(CondDBAccessSvc("DB",ConnectionString=connection)) ===== How to use the latest tag ===== Do CondDB().UseLatestTags = ["2011"] if you want to use the latest tag for 2011 data. For **real data** it should always be safe to use the latest tag (this is **not** the case for MC) ===== How to find the tag corresponding to a dataset ===== In the bookkeeping-browser: First click on ''Advanced Queries'', then navigate yourself to the production name (for example ''Stripping 17b'') and then right-click to get to ''More Information''. There you should be able to read of the database tags. ===== Where to find the description of the official tags ===== Here: http://lhcb-release-area.web.cern.ch/LHCb-release-area/DOC/dbase/conddb/release_notes.html