How to copy predictions from OPITA01 to local DB

From LHEP Wiki
Revision as of 09:49, 18 March 2015 by Lhep (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Create brick with (This operation doesn't seem to be necessary BEFORE downloading predictions - I.K., 29.07.08):
Substituted spaces by underscores in b072289.map.XG.

Make sure that in  b072289.0.1.100.operation.h file FROM_PLATE=57, TO_PLATE=45

Started @15:00
 root [0] .L b072289.h                       
 root [1] .L b072289.0.1.100.operation.h     
 root [2] .L LibScanToOracle7.C              
 root [3] #define MIC_NAME MIC1              
 root [4] #define USER KRESLO                
 root [5] Add()                                      


  • Connect to bern4 as OPERAPUB,
execute in SQLDeveloper the following command (NOTE the single and double quotes!!!):

To copy system settings:

insert into tb_sites (select * from tb_sites@OPITA01 a where not exists (select * from tb_sites b where a.id = b.id));
insert into tb_machines (select * from tb_machines@OPITA01 a where not exists (select * from tb_machines  b where a.id = b.id));
insert into tb_users (select * from tb_users@OPITA01 a where not exists (select * from tb_users  b where a.id = b.id));
insert into tb_programsettings (select * from tb_programsettings@OPITA01 a where not exists (select * from tb_programsettings  b where a.id = b.id));
commit;

To download predictions:

call PC_ADD_BRICK_SPACE(72289,'opera cs');
commit;
call pp_download_predictions(3072289,'OPITA01');          
commit;
(press F5)
Result:

call PC_ADD_BRICK_SPACE(72289,'opera cs') succeeded.
call pp_download_predictions(3072289,'OPITA01') succeeded.
commit succeeded.
  • Check it:
select * from tb_cs_candidates;

Result:
ID_EVENTBRICK          ID_PROCESSOPERATION    ID_EVENT               CANDIDATE              ID                     
---------------------- ---------------------- ---------------------- ---------------------- ---------------------- 
3072289                9000000000723563       82000000000080277      1                      9000000000724825       
3072289                9000000000723563       82000000000080277      2                      9000000000724826       

2 rows selected
  • Link CS candidate to SB operation:

INSERT INTO "OPERA"."TB_B_CSCANDS_SBPATHS" (ID_CS_EVENTBRICK, ID_CANDIDATE, ID_EVENTBRICK, ID_SCANBACK_PROCOPID, PATH) VALUES ('3072289', '9000000000724825', '1072289', '5000000001130001', '1');
Commit;

Here 3072289 - CS eventbrick (starts with 3!), 
9000000000724825 - ID of CS candidate (see above)
1072289 - ID eventbrick (starts from 1)
5000000001130001 - id of scanback operation (get when execute AddHeaderOperation during publication procedure)
1 - ID of SB path (set in .operation.h file)