/[PAMELA software]/YodaProfiler/docs/PAMELAProductionDB.sql
ViewVC logotype

Annotation of /YodaProfiler/docs/PAMELAProductionDB.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Tue Dec 5 12:23:15 2006 UTC (18 years ago) by mocchiut
Branch: MAIN
CVS Tags: v2r05
Changes since 1.6: +2 -0 lines
R2D2 updated to handle L2 files, small bug in the DB fixed

1 mocchiut 1.1 DROP DATABASE IF EXISTS dbname;
2    
3     CREATE DATABASE dbname;
4    
5     USE dbname;
6    
7 mocchiut 1.6 SET time_zone='+0:00';
8    
9 mocchiut 1.3 CREATE TABLE `_RUNID_GEN` (
10     `ID` int(10) unsigned NOT NULL auto_increment,
11     PRIMARY KEY (`ID`)
12     ) ENGINE=InnoDB;
13    
14 mocchiut 1.1 CREATE TABLE `GL_RAW` (
15     `ID` int(10) unsigned NOT NULL auto_increment,
16     `PATH` varchar(255) NOT NULL default '',
17     `NAME` varchar(255) NOT NULL default '',
18     `BOOT_NUMBER` smallint(5) unsigned default NULL,
19     `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
20     PRIMARY KEY (`ID`),
21     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
22     KEY `PATH_index` (`PATH`)
23     ) ENGINE=InnoDB;
24    
25 mocchiut 1.7 INSERT INTO GL_RAW VALUES(4294967295,'path to','level2 files',NULL,NULL);
26    
27 mocchiut 1.1 CREATE TABLE `GL_ROOT` (
28     `ID` int(10) unsigned NOT NULL auto_increment,
29     `ID_RAW` int(10) unsigned NOT NULL default '0',
30     `ID_TIMESYNC` int(10) unsigned NOT NULL default '0',
31     `PATH` varchar(255) NOT NULL default '',
32     `NAME` varchar(255) NOT NULL default '',
33     `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
34     PRIMARY KEY (`ID`),
35     KEY `ID_RAW_index` (`ID_RAW`),
36     KEY `PATH_index` (`PATH`),
37     CONSTRAINT `ROOT_fk` FOREIGN KEY (`ID_RAW`) REFERENCES `GL_RAW` (`ID`) ON DELETE CASCADE
38     ) ENGINE=InnoDB;
39    
40     CREATE TABLE `GL_RESURS_OFFSET` (
41     `ID` int(10) unsigned NOT NULL auto_increment,
42 mocchiut 1.3 `FROM_ORBIT` int(10) unsigned NOT NULL default '0',
43     `SPECIAL_FILE` varchar(255) NOT NULL default '',
44 mocchiut 1.1 `OFFSET_DATE` timestamp default '0000-00-00 00:00:00',
45     `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
46     PRIMARY KEY (`ID`)
47     ) ENGINE=InnoDB;
48    
49 mocchiut 1.3 INSERT INTO GL_RESURS_OFFSET VALUES(0,'0','','2006-06-14 21:00:00',NULL);
50     INSERT INTO GL_RESURS_OFFSET VALUES(0,'1619','','2006-09-28 21:00:00',NULL);
51 mocchiut 1.1
52     CREATE TABLE `GL_TIMESYNC` (
53     `ID` int(10) unsigned NOT NULL auto_increment,
54     `ID_RAW` int(10) unsigned NOT NULL default '0',
55     `OBT0` int(10) unsigned NOT NULL default '0',
56     `TIMESYNC` int(10) unsigned NOT NULL default '0',
57     `TYPE` smallint(5) unsigned NOT NULL default '0',
58     PRIMARY KEY (`ID`),
59     KEY `ID_RAW_index` (`ID_RAW`),
60     KEY `TYPE_index` (`TYPE`),
61     CONSTRAINT `TIME_RAW_fk` FOREIGN KEY (`ID_RAW`) REFERENCES `GL_RAW` (`ID`) ON DELETE CASCADE
62     ) ENGINE=InnoDB;
63    
64     CREATE TABLE `GL_PARAM` (
65     `ID` int(10) unsigned NOT NULL auto_increment,
66     `PATH` varchar(255) NOT NULL default '',
67     `NAME` varchar(255) NOT NULL default '',
68     `FROM_TIME` int(10) unsigned NOT NULL default '0',
69     `TO_TIME` int(10) unsigned NOT NULL default '0',
70 mocchiut 1.2 `TYPE` smallint(5) unsigned NOT NULL default '0',
71 mocchiut 1.1 `DESCR` varchar(255) NOT NULL default '',
72     `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
73     PRIMARY KEY (`ID`),
74     KEY `PATH_index` (`PATH`),
75     KEY `NAME_index` (`NAME`),
76     KEY `TYPE_index` (`TYPE`),
77     KEY `DESCR_index` (`DESCR`)
78     ) ENGINE=InnoDB;
79    
80     CREATE TABLE `GL_TLE` (
81     `ID` int(10) NOT NULL auto_increment,
82     `TLE1` varchar(255) NOT NULL default '',
83     `TLE2` varchar(255) NOT NULL default '',
84     `TLE3` varchar(255) NOT NULL default '',
85 mocchiut 1.2 `FROM_TIME` datetime NOT NULL default '0000-00-00 00:00:00',
86 mocchiut 1.1 `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
87     PRIMARY KEY (`ID`)
88     ) ENGINE=InnoDB;
89    
90     CREATE TABLE `GL_RUN` (
91     `ID` int(10) unsigned NOT NULL auto_increment,
92     `ID_RUN_FRAG` int(10) unsigned NOT NULL default '0',
93     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
94     `ID_ROOT_L2` int(10) unsigned NOT NULL default '0',
95     `RUNHEADER_TIME` int(10) unsigned NOT NULL default '0',
96     `RUNTRAILER_TIME` int(10) unsigned NOT NULL default '0',
97     `RUNHEADER_OBT` int(10) unsigned NOT NULL default '0',
98     `RUNTRAILER_OBT` int(10) unsigned NOT NULL default '0',
99     `RUNHEADER_PKT` int(10) unsigned NOT NULL default '0',
100     `RUNTRAILER_PKT` int(10) unsigned NOT NULL default '0',
101     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
102     `EV_FROM` int(10) unsigned NOT NULL default '0',
103     `EV_TO` int(10) unsigned NOT NULL default '0',
104     `NEVENTS` int(10) unsigned NOT NULL default '0',
105     `PKT_COUNTER` int(10) unsigned NOT NULL default '0',
106     `PKT_READY_COUNTER` int(10) unsigned NOT NULL default '0',
107     `COMPILATIONTIMESTAMP` int(10) unsigned NOT NULL default '0',
108     `FAV_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0',
109     `EFF_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0',
110     `PRH_VAR_TRG_MODE_A` int(10) unsigned NOT NULL default '0',
111     `PRH_VAR_TRG_MODE_B` int(10) unsigned NOT NULL default '0',
112     `ACQ_BUILD_INFO` int(10) unsigned NOT NULL default '0',
113     `ACQ_VAR_INFO` smallint(5) unsigned NOT NULL default '0',
114     `RM_ACQ_AFTER_CALIB` tinyint(3) NOT NULL default '0',
115     `RM_ACQ_SETTING_MODE` tinyint(3) NOT NULL default '0',
116     `TRK_CALIB_USED` int(10) unsigned NOT NULL default '0',
117     `CAL_DSP_MASK` tinyint(3) unsigned NOT NULL default '0',
118     `LAST_TIMESYNC` int(10) unsigned NOT NULL default '0',
119     `OBT_TIMESYNC` int(10) unsigned NOT NULL default '0',
120     `VALIDATION` tinyint(3) unsigned NOT NULL default '0',
121     `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
122     PRIMARY KEY (`ID`),
123     KEY `ID_RUN_FRAG_index` (`ID_RUN_FRAG`),
124     KEY `ID_ROOT_L0_index` (`ID_ROOT_L0`),
125     KEY `ID_ROOT_L2_index` (`ID_ROOT_L2`),
126     KEY `COMPILATIONTS_index` (`COMPILATIONTIMESTAMP`),
127     KEY `VALID_index` (`VALIDATION`),
128     KEY `TRKCALIB_index` (`TRK_CALIB_USED`),
129     KEY `CALDSPMASK_index` (`CAL_DSP_MASK`),
130     KEY `EFF_WS_index` (`EFF_WRK_SCHEDULE`),
131     KEY `FAV_WS_index` (`FAV_WRK_SCHEDULE`),
132     KEY `RM_ACQ_AFTER_CALIB_index` (`RM_ACQ_AFTER_CALIB`),
133     KEY `RM_ACQ_SETTING_MODE_index` (`RM_ACQ_SETTING_MODE`),
134     KEY `ACQ_VAR_INFO_index` (`ACQ_VAR_INFO`),
135     KEY `TRG_MODE_A_index` (`PRH_VAR_TRG_MODE_A`),
136     KEY `TRG_MODE_B_index` (`PRH_VAR_TRG_MODE_B`),
137     KEY `NEVENTS_index` (`NEVENTS`),
138     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
139     KEY `ID_RUN_fk_constraint` (`ID_ROOT_L0`),
140 mocchiut 1.5 KEY `ID_RUN_L2_fk_constraint` (`ID_ROOT_L2`)
141 mocchiut 1.1 ) ENGINE=InnoDB;
142    
143     CREATE TABLE `GL_RUN_FRAGMENTS` (
144     `ID` int(10) unsigned NOT NULL auto_increment,
145     `ID_RUN_FRAG` int(10) unsigned NOT NULL default '0',
146     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
147     `ID_ROOT_L2` int(10) unsigned NOT NULL default '0',
148     `RUNHEADER_TIME` int(10) unsigned NOT NULL default '0',
149     `RUNTRAILER_TIME` int(10) unsigned NOT NULL default '0',
150     `RUNHEADER_OBT` int(10) unsigned NOT NULL default '0',
151     `RUNTRAILER_OBT` int(10) unsigned NOT NULL default '0',
152     `RUNHEADER_PKT` int(10) unsigned NOT NULL default '0',
153     `RUNTRAILER_PKT` int(10) unsigned NOT NULL default '0',
154     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
155     `EV_FROM` int(10) unsigned NOT NULL default '0',
156     `EV_TO` int(10) unsigned NOT NULL default '0',
157     `NEVENTS` int(10) unsigned NOT NULL default '0',
158     `PKT_COUNTER` int(10) unsigned NOT NULL default '0',
159     `PKT_READY_COUNTER` int(10) unsigned NOT NULL default '0',
160     `COMPILATIONTIMESTAMP` int(10) unsigned NOT NULL default '0',
161     `FAV_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0',
162     `EFF_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0',
163     `PRH_VAR_TRG_MODE_A` int(10) unsigned NOT NULL default '0',
164     `PRH_VAR_TRG_MODE_B` int(10) unsigned NOT NULL default '0',
165     `ACQ_BUILD_INFO` int(10) unsigned NOT NULL default '0',
166     `ACQ_VAR_INFO` smallint(5) unsigned NOT NULL default '0',
167     `RM_ACQ_AFTER_CALIB` tinyint(3) NOT NULL default '0',
168     `RM_ACQ_SETTING_MODE` tinyint(3) NOT NULL default '0',
169     `TRK_CALIB_USED` int(10) unsigned NOT NULL default '0',
170     `CAL_DSP_MASK` tinyint(3) unsigned NOT NULL default '0',
171     `LAST_TIMESYNC` int(10) unsigned NOT NULL default '0',
172     `OBT_TIMESYNC` int(10) unsigned NOT NULL default '0',
173     `VALIDATION` tinyint(3) unsigned NOT NULL default '0',
174     `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
175     PRIMARY KEY (`ID`),
176     KEY `ID_RUN_FRAG_index` (`ID_RUN_FRAG`),
177     KEY `ID_ROOT_L0_index` (`ID_ROOT_L0`),
178     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
179     KEY `TRKCALIB_index` (`TRK_CALIB_USED`),
180 mocchiut 1.5 KEY `NID_RUN_fk_constraint` (`ID_ROOT_L0`)
181 mocchiut 1.1 ) ENGINE=InnoDB;
182    
183 mocchiut 1.4 CREATE TABLE `GL_RUN_TRASH` (
184 mocchiut 1.5 `ID_TRASH` int(10) unsigned NOT NULL auto_increment,
185     `ID` int(10) unsigned NOT NULL default '0',
186 mocchiut 1.4 `ID_RUN_FRAG` int(10) unsigned NOT NULL default '0',
187     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
188     `ID_ROOT_L2` int(10) unsigned NOT NULL default '0',
189     `RUNHEADER_TIME` int(10) unsigned NOT NULL default '0',
190     `RUNTRAILER_TIME` int(10) unsigned NOT NULL default '0',
191     `RUNHEADER_OBT` int(10) unsigned NOT NULL default '0',
192     `RUNTRAILER_OBT` int(10) unsigned NOT NULL default '0',
193     `RUNHEADER_PKT` int(10) unsigned NOT NULL default '0',
194     `RUNTRAILER_PKT` int(10) unsigned NOT NULL default '0',
195     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
196     `EV_FROM` int(10) unsigned NOT NULL default '0',
197     `EV_TO` int(10) unsigned NOT NULL default '0',
198     `NEVENTS` int(10) unsigned NOT NULL default '0',
199     `PKT_COUNTER` int(10) unsigned NOT NULL default '0',
200     `PKT_READY_COUNTER` int(10) unsigned NOT NULL default '0',
201     `COMPILATIONTIMESTAMP` int(10) unsigned NOT NULL default '0',
202     `FAV_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0',
203     `EFF_WRK_SCHEDULE` tinyint(3) unsigned NOT NULL default '0',
204     `PRH_VAR_TRG_MODE_A` int(10) unsigned NOT NULL default '0',
205     `PRH_VAR_TRG_MODE_B` int(10) unsigned NOT NULL default '0',
206     `ACQ_BUILD_INFO` int(10) unsigned NOT NULL default '0',
207     `ACQ_VAR_INFO` smallint(5) unsigned NOT NULL default '0',
208     `RM_ACQ_AFTER_CALIB` tinyint(3) NOT NULL default '0',
209     `RM_ACQ_SETTING_MODE` tinyint(3) NOT NULL default '0',
210     `TRK_CALIB_USED` int(10) unsigned NOT NULL default '0',
211     `CAL_DSP_MASK` tinyint(3) unsigned NOT NULL default '0',
212     `LAST_TIMESYNC` int(10) unsigned NOT NULL default '0',
213     `OBT_TIMESYNC` int(10) unsigned NOT NULL default '0',
214     `VALIDATION` tinyint(3) unsigned NOT NULL default '0',
215     `FILENAMEL0` varchar(255) NOT NULL default '',
216     `FILENAMEL2` varchar(255) NOT NULL default '',
217     `BELONGED_TO` varchar(255) NOT NULL default '',
218     `INSERT_TIME` timestamp NOT NULL default CURRENT_TIMESTAMP,
219 mocchiut 1.5 PRIMARY KEY (`ID_TRASH`),
220 mocchiut 1.4 KEY `TID_RUN_FRAG_index` (`ID_RUN_FRAG`),
221     KEY `TID_ROOT_L0_index` (`ID_ROOT_L0`),
222     KEY `TBOOTNUMBER_index` (`BOOT_NUMBER`),
223     KEY `TTRKCALIB_index` (`TRK_CALIB_USED`),
224     KEY `TFNAME0_index` (`FILENAMEL0`),
225     KEY `TFNAME2_index` (`FILENAMEL2`),
226     KEY `TBELONG_index` (`BELONGED_TO`)
227     ) ENGINE=InnoDB;
228    
229 mocchiut 1.1 CREATE TABLE `GL_CALO_CALIB` (
230     `ID` int(10) unsigned NOT NULL auto_increment,
231     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
232     `EV_ROOT` int(10) unsigned NOT NULL default '0',
233     `FROM_TIME` int(10) unsigned NOT NULL default '0',
234     `TO_TIME` int(10) unsigned NOT NULL default '0',
235     `SECTION` tinyint(3) unsigned NOT NULL default '0',
236     `OBT` int(10) unsigned NOT NULL default '0',
237     `PKT` int(10) unsigned NOT NULL default '0',
238     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
239     `VALIDATION` tinyint(3) unsigned NOT NULL default '0',
240     PRIMARY KEY (`ID`),
241     KEY `SECTION_index` (`SECTION`),
242     KEY `EV_ROOT_index` (`EV_ROOT`),
243     KEY `ID_ROOT_index` (`ID_ROOT_L0`),
244     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
245 mocchiut 1.5 KEY `VALID1_index` (`VALIDATION`)
246 mocchiut 1.1 ) ENGINE=InnoDB;
247    
248     CREATE TABLE `GL_TRK_CALIB` (
249     `ID` int(10) unsigned NOT NULL auto_increment,
250     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
251     `EV_ROOT_CALIBTRK1` int(10) unsigned default NULL,
252     `EV_ROOT_CALIBTRK2` int(10) unsigned default NULL,
253     `FROM_TIME` int(10) unsigned NOT NULL default '0',
254     `TO_TIME` int(10) unsigned NOT NULL default '0',
255     `OBT1` int(10) unsigned NOT NULL default '0',
256     `PKT1` int(10) unsigned NOT NULL default '0',
257     `OBT2` int(10) unsigned NOT NULL default '0',
258     `PKT2` int(10) unsigned NOT NULL default '0',
259     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
260     `VALIDATION` tinyint(3) unsigned NOT NULL default '0',
261     PRIMARY KEY (`ID`),
262     KEY `ID_ROOT_index` (`ID_ROOT_L0`),
263     KEY `EV_ROOT_CALIBTRK1index` (`EV_ROOT_CALIBTRK1`),
264     KEY `EV_ROOT_CALIBTRK2index` (`EV_ROOT_CALIBTRK2`),
265     KEY `BOOTNUMBER_index` (`BOOT_NUMBER`),
266 mocchiut 1.5 KEY `VALID2_index` (`VALIDATION`)
267 mocchiut 1.1 ) ENGINE=InnoDB;
268    
269     CREATE TABLE `GL_S4_CALIB` (
270     `ID` int(10) unsigned NOT NULL auto_increment,
271     `ID_ROOT_L0` int(10) unsigned NOT NULL default '0',
272     `EV_ROOT` int(10) unsigned NOT NULL default '0',
273     `FROM_TIME` int(10) unsigned NOT NULL default '0',
274     `TO_TIME` int(10) unsigned NOT NULL default '0',
275     `OBT` int(10) unsigned NOT NULL default '0',
276     `PKT` int(10) unsigned NOT NULL default '0',
277     `BOOT_NUMBER` smallint(5) unsigned NOT NULL default '0',
278     PRIMARY KEY (`ID`),
279     KEY `ID_ROOT_index` (`ID_ROOT_L0`),
280 mocchiut 1.5 KEY `BOOTNUMBER_index` (`BOOT_NUMBER`)
281 mocchiut 1.1 ) ENGINE=InnoDB;
282    
283    

  ViewVC Help
Powered by ViewVC 1.1.23