Back to home page

Project CMSSW displayed by LXR

 
 

    


Warning, /OnlineDB/EcalCondDB/doc/README-channelview.txt is written in an unsupported language. File is not indexed.

0001 Channelview Table
0002 
0003 Overview
0004 
0005   The channelview contains mappings from array based numbering systems
0006   used by ECAL to a single integer (logic_id).  It also contains
0007   mappings from one type of channel to another, for example from
0008   crystal number to high voltage channel.
0009 
0010   TODO:  Describe the mappings in more detail.
0011 
0012 
0013 
0014 Creating channelview table from scratch
0015 
0016   To create the channelview table from scratch, use the
0017   "define-channels.pl" script in the perl/ directory.  
0018 
0019   TODO:  more information about this
0020 
0021 
0022 
0023 Copying channelview tables from one DB to another
0024 
0025   Because creating the channelview table from scratch is quite slow,
0026   you may wish to simply copy a complete channelview table from one
0027   table to another.  There are two ways to do this.
0028 
0029 
0030 
0031   Method 1 - Using a database link
0032 
0033   -- Connect to the target database
0034   lxplus>  sqlplus [targetDB]
0035 
0036   -- Create backups of the channelview tables
0037   SQL>  create table bkup_channelview as select * from channelview;
0038   SQL>  create table bkup_viewdescription as select * from
0039   channelview;
0040 
0041   -- Create the database link
0042   SQL>  create database link ecalh4db.world connect to cond01
0043   identified by [password] using 'pccmsecdb.cern.ch:1521/ecalh4db';
0044   
0045   -- Make sure the database link works
0046   SQL>  select count(*) from channelview@ecalh4db.world;
0047   
0048   -- Drop the old channelview tables
0049   SQL>  drop table channelview;
0050   SQL>  drop table viewdescription;
0051 
0052   -- Copy the other channelview tables using the DB link
0053   SQL>  create table channelview as select * from
0054   channelview@ecalh4db.world;
0055   SQL>  create table viewdescription as select * from
0056   viewdescription@ecalh4db.world;
0057 
0058   -- Remove the backup tables
0059   SQL>  drop table bkup_channelview;
0060   SQL>  drop table bkup_viewdescription;
0061 
0062 
0063 
0064   Method 2 - Using oracle tools EXP and IMP
0065 
0066   You can also use the Oracle export/import tools to do the table
0067   copy.  Note you may run into some problems with this method if the
0068   databases are of different version.  Use the setoraenv command to
0069   set your environment to use Oracle tools appropriate to your target
0070   database.
0071 
0072   #  Have a look at the help files
0073   lxplus>  exp help=yes
0074   lxplus>  imp help=yes
0075 
0076   # Export the tables
0077   lxplus>  exp [source connection string] TABLES=(CHANNELVIEW,VIEWDESCRIPTION)
0078 
0079   # Import the tables
0080   lxplus>  imp [dest connection string] TABLES=(CHANNELVIEW,VIEWDESCRIPTION)