Difference between revisions of "G2pmysql"

From Hall A Wiki
Jump to: navigation, search
(Useful Files & Notes)
(Useful Files & Notes)
Line 22: Line 22:
 
*Thanks to Chao for providing the EPICS information
 
*Thanks to Chao for providing the EPICS information
  
Run start and stop times can be found  [https://userweb.jlab.org/~rbziel/mysql_files/time.dat here]
+
Run start and stop times can be found  [https://userweb.jlab.org/~rbziel/mysql_files/time.dat here] and the perl script used to edit the mysql db is [https://userweb.jlab.org/~rbziel/mysql_files/epics_time.pl this]
 
*Thanks to Chao for providing these times
 
*Thanks to Chao for providing these times
 
*The times are in UNIX and I can't off the top of my head remember what the different columns are.
 
*The times are in UNIX and I can't off the top of my head remember what the different columns are.

Revision as of 19:42, 14 August 2012

Below is a description of the g2p mysql database. It will be continuously updated with new features as they're requested and as I think of them. So if you think of something you would like the database to do, just let me know.

-Ryan

List of good mysql tutorial websites.

http://www.tutorialspoint.com/mysql/index.htm
http://www.tizag.com/mysqlTutorial/
http://www.dreamincode.net/forums/topic/42301-beginners-guide-to-creating-simple-mysql-tables/

Installing a MYSQL Server on your own machine

http://dev.mysql.com/doc/refman/5.0/en/macosx-installation.html
http://dev.mysql.com/doc/refman/5.0/en/windows-installation.html
http://dev.mysql.com/doc/refman/5.0/en/linux-installation-rpm.html
Note: Default ROOT password for mysql user is blank

Useful Files & Notes

g2p mysql DB backups

  • Backup_List gives some information on the backups

Script used to fill AnaInfo table from this csv file.

  • Thanks to Chao for providing the EPICS information

Run start and stop times can be found here and the perl script used to edit the mysql db is this

  • Thanks to Chao for providing these times
  • The times are in UNIX and I can't off the top of my head remember what the different columns are.

Epics variables and descriptions can be found here https://hallaweb.jlab.org/wiki/index.php/G2p_epics

Target Variable Epics reporting: Going through the HALOG I don't see Target Encoder Variables accurately reporting until Runs 3220/22305 on 3/16/12. See http://hallaweb.jlab.org/halog/log/html/1203_archive/120316153201.html

g2p mysql Table Descriptions

There are two main categories of tables in the g2p mysql database. The first category includes tables that were filled with data online. The fields were filled either at the start or end of run with a snapshot of the EPICS information associated with the table variable or with summary information from the end of run script. Some of this information was provided by the shift worker so one should be careful with these tables. These tables are the RunInfo Tables and there is one for each DAQ arm (Left, Right, Third). As of 8/13/2012 these tables will no longer be updated!

The second category of tables are AnaInfo, analysis tables. The data in these tables is either filled from the EPICS information from the accumulated data files or via a student "expert". In this regard, these tables should be used be used for the analysis. They will be continually updated with more data fields as needed in the analysis process and errors will be corrected as they are discovered.

The AnaInfo were created from the RunInfo tables. This means that all the runs that exist in RunInfo exist in AnaInfo.

RunInfo Tables

RunInfo Tables

AnaInfo Tables

AnaInfo Tables

Misc. MYSQL Commands and Hints

Below are some specific MYSQL commands so I don't have to look them up every time I want to use them.

Checking Database size

   SELECT SUM(ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024),2)) "Size in MB" FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = "g2p";
  +------------+
    | Size in MB |
  +------------+
    |       3.34 | 
  +------------+
  1 row in set (0.11 sec)

Dumping and Restoring the DB

backup: # mysqldump -h adaql10 -u g2p -p[password] [database_name] > dumpfilename.sql
restore:# mysql -h adaq10 -u g2p -p[password] [database_name] < dumpfilename.sql