
\documentclass[9pt]{article}
\usepackage{geometry}
\geometry{a4paper}
%\geometry{twoside, bindingoffset=2cm, a4paper, left=2cm}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent

% Palatino for rm and math | Helvetica for ss | Courier for tt
%\usepackage{mathpazo} % math & rm
%\linespread{1.05}        % Palatino needs more leading (space between lines)
%\usepackage{helvet} % ss
%\usepackage{courier} % tt
%\normalfont
%\usepackage[T1]{fontenc}

\usepackage{url}
%% Define a new 'leo' style for the package that will use a smaller font.
\makeatletter
\def\url@leostyle{%
  \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}}
\makeatother
%% Now actually use the newly defined style.
\urlstyle{leo}

\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\title{TPC-FEE FERO DB Structure \& Access}

\author{R. Bramm and C. Lippmann}
%\date{}                                           % Activate to display a given date or no date

\begin{document}
\maketitle

\tableofcontents
\newpage


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Structure}

The structure of the FERO database in the DCS system of the ALICE-TPC follows the structure of the
Hardware. The following hardware components will need a configuration:

\begin{itemize}
\item ALTRO
\item FEC (Board Controller)
\item RCU
\end{itemize}

The amount of $\approx$ 5 million configurable parameters of one TPC configuration rejected an
atomic representation of each parameter, thus all parameters of an ALTRO chip (also FEC and RCU)
are collected in one database entry. The components are linked together via the corresponding
relation tables. In the following sections the tables will be sketched, a full SQL-create query
(in oracle format) is in the Appendix (See section \ref{sec:Appendix} on page \pageref{sec:Appendix}).
This Document is written for the table revision 7 (See section \ref{sec:Structure_TPC} on page
\pageref{sec:Structure_TPC}). This revision includes the changes done to adapt to the new Firmware
of the RCU (RCU Firmware V2).

The reuse of the configuration parameters in one of the parameter tables can be achieved by the
multiple use of this configuration id in the appropriate link tables. This has to be done by the
client which creates the configuration in the database (Insert the configuration).
One complete configuration needs $\approx$ 30\,MByte of space in the database. It is expected that
the TPC will need 20 to 100 different configurations. As the state of the electronics is stored
in the database the configurations will change over time due to disfunctional or changed Hardware
or changing hardware behaviour, but obsolete configurations can be backuped. The configurations
of the TPC should never be deleted, since the FERO-db is the only source for informations of the
state of the Detector.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{ALTRO}
\label{sec:Structure_ALTRO}

The table consists of 150 columns. There are 8 ALTROs per FEC. \newline

\begin{tabular}{ll}
\hline
id                                     & unique id of one ALTRO configuration \\
Position                               & Position of the ALTRO on the FEC (0...7) \\
ON\_ALTRO                              & Switch to define the state of the chip (0,1)\\
ON\_CHANNEL$[$0\dots15$]$              & Switch to define the state of the channel (0,1)\\
$[$K/L/VFPED$]$\_CHANNEL$[$0\dots15$]$ & Channel configuration parameters \\
ZSTHR/\dots/DPCF2                      & Global configuration parameters \\
\hline
\end{tabular} 
\newline

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{FEC}
\label{sec:Structure_FEC}

The table consists of 16 columns. There are 18, 20 or 25 (depending on the Position of the RCU
in the Sector) FECs per RCU\\

\begin{tabular}{ll}
\hline
id                   & unique id of one  FEC configuration \\
BranchPosition       & Branch-Position of the FEC (0,1)\\
Position             & Position of the FEC in the branch \\
ON\_FEC              & Switch to define the state of the card (0,1)\\
BC\_T\_TH/\dots/CSR3 & Configuration parameters \\
RDO\_FEC             & Switch to define if the card should be read out (0,1)\\
\hline
\end{tabular}
\newline

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{RCU}
\label{sec:Structure_RCU}

The table consists of 24 columns. There are 6 RCUs per Sector. \\

\begin{tabular}{ll}
\hline
id                               & unique id of one RCU configuration \\
Equipmentid                      & Equipment id of the corresponding readout partition \\
Position                         & Position of the RCU in the SECTOR (0...5) \\
ON\_RCU                          & Switch to define the state of the card (0,1) \\
ALTROIF\_NSAM\_EV/\dots          & Configuration Parameters \\
\ \ \dots/TRGCONF\_TRG\_MODE     & \\
EN\_INT\_BA/\dots                & \\
\ \ \dots/PLACEHOLDER            & Placeholder for configuration parameters \\
\hline
\end{tabular}
\newline

The placeholder will possibly be redefined and used in future.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{SECTOR}
\label{sec:Structure_SECTOR}

The table consists of 3 colums, the sector has no configuration, it is only needed for the
position determination. There are 36 Sectors per TPC.\\

\begin{tabular}{ll}
\hline
id           & unique id of the SECTOR \\
Position     & Position of the SECTOR on the TPC (0..17) \\
SidePosition & Side of TPC with the SECTOR (0,1)\\
\hline
\end{tabular}
\newline

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{TPC}
\label{sec:Structure_TPC}
The table consists (currently) of 6 columns. The TPC has no configuration; this table holds the
meta information in the configuration. Later some additions will be implemented here, as global
Firmwares of the FPGAs or the detector and the readout list. \\

\begin{tabular}{ll}
\hline
id       & unique id of the TPC configuration \\
Created  & Time of the creation of this configuraion \\
Used     & Time since when the configuration has the first use \\
Updated  & Time when the configuration was last updated \\
Revision & Revision of the TPC tables \\
Comment  & Comment to describe the configuration \\
\hline
\end{tabular}
\newline

The TPC table revision is supposed to ensure that the client is build for the correct table
version.
\newline

In total one TPC configuration needs $\approx$ 30\,MByte and consists of 
\newline

\begin{tabular}{ll}
\hline
	34848 & ALTRO entries,\\
	4356  & FEC entries,\\
	216   & RCU entries,\\
	36    & Sector entries,\\
	1     & TPC entry,\\
	34848 & ALTRO and FEC relation entries,\\
	4356  & FEC and RCU relation entries,\\
	216   & RCU and Sector relation entries and\\
	36    & Sector and TPC relation entries.\\
\hline
\end{tabular}
\newline

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{ALTRO\_FEC \& FEC\_RCU \& RCU\_SECTOR \& SECTOR\_TPC}
\label{sec:Structure_Relation}

These tables consist of the relation between the tables holding the data. \\

\begin{tabular}{ll}
\hline
$[$ALTRO\&FEC\&RCU\&SECTOR$]$\_id & unique id of the configuration table\\
$[$FEC\&RCU\&SECTOR\&TPC$]$\_id & unique id of the configuration table\\
\hline
\end{tabular}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Access}

The configuration of the TPC is subdivided in 216 blocks (one block per RCU, respectively DCS
Board) as the Detector Control System (DCS) of the TPC has 216 devices on the detector for
monitoring and configuration. There are 2 querys per RCU. The input of the queries is the
requested configuration id (ConfigID) and the Target. The ConfigID is in the TPC Table
(See section \ref{sec:Structure_TPC} on page \pageref{sec:Structure_TPC}). The Target carries
the position information, thus side, sector \& readout partition (RCU). The task of the
first query is to retrieve the rcuID for the requested ConfigID and Target. The second query
retrieves the RCU, FEC and ALTRO configuration using the rcuID from the first query. The
parameters are encapsulated in the $[$\hspace{0.1cm}$]$.

\begin{verbatim}
  SELECT * FROM tpc, sector_tpc, sector, rcu_sector, rcu
  WHERE rcu."id"=rcu_sector."RCU_ID" 
  AND sector."id"=rcu_sector."SECTOR_ID" 
  AND sector."id"=sector_tpc."SECTOR_ID" 
  AND tpc."id"=sector_tpc."TPC_ID" 
  AND tpc."id"= [ConfigID] 
  AND sector.SidePosition = [Target.Side] 
  AND sector.Position = [Target.Sector]  
  AND rcu.Position = [Target.ReadoutPartition]
\end{verbatim}

\begin{verbatim}
  SELECT * FROM fec, fec_rcu, altro, altro_fec, rcu 
  WHERE altro.id = altro_fec.altro_id 
  AND fec.id=altro_fec.fec_id 
  AND fec.id = fec_rcu.fec_id 
  AND rcu.id = fec_rcu.rcu_id 
  AND rcu.id = [rcuID]
  ORDER BY fec.BranchPosition, fec.Position, altro.Position
\end{verbatim}

The time to compile, send and execute the configuration is expected on the order of a few seconds.
The time to get the data and configure the detector is around 20\,s. By the use of bind variables
for the geometry variables instead of literals the execution plans for these two statements can be
reused. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Appendix}
\label{sec:Appendix}

Here we give the CREATE statements for the described tables.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{ALTRO}
\label{sec:Appendix_ALTRO}

\begin{verbatim}
  CREATE TABLE "ALTRO" ( 
  "id" Number(11) Primary Key ,
  "Position" Number(1) default NULL ,
  "ON_ALTRO" Number(1) default NULL ,
  "ON_CHANNEL00" Number(1) default NULL ,
  "ON_CHANNEL01" Number(1) default NULL ,
  "ON_CHANNEL02" Number(1) default NULL ,
  "ON_CHANNEL03" Number(1) default NULL ,
  "ON_CHANNEL04" Number(1) default NULL ,
  "ON_CHANNEL05" Number(1) default NULL ,
  "ON_CHANNEL06" Number(1) default NULL ,
  "ON_CHANNEL07" Number(1) default NULL ,
  "ON_CHANNEL08" Number(1) default NULL ,
  "ON_CHANNEL09" Number(1) default NULL ,
  "ON_CHANNEL10" Number(1) default NULL ,
  "ON_CHANNEL11" Number(1) default NULL ,
  "ON_CHANNEL12" Number(1) default NULL ,
  "ON_CHANNEL13" Number(1) default NULL ,
  "ON_CHANNEL14" Number(1) default NULL ,
  "ON_CHANNEL15" Number(1) default NULL ,
  "K1_CHANNEL00" Number(5) default NULL ,
  "K1_CHANNEL01" Number(5) default NULL ,
  "K1_CHANNEL02" Number(5) default NULL ,
  "K1_CHANNEL03" Number(5) default NULL ,
  "K1_CHANNEL04" Number(5) default NULL ,
  "K1_CHANNEL05" Number(5) default NULL ,
  "K1_CHANNEL06" Number(5) default NULL ,
  "K1_CHANNEL07" Number(5) default NULL ,
  "K1_CHANNEL08" Number(5) default NULL ,
  "K1_CHANNEL09" Number(5) default NULL ,
  "K1_CHANNEL10" Number(5) default NULL ,
  "K1_CHANNEL11" Number(5) default NULL ,
  "K1_CHANNEL12" Number(5) default NULL ,
  "K1_CHANNEL13" Number(5) default NULL ,
  "K1_CHANNEL14" Number(5) default NULL ,
  "K1_CHANNEL15" Number(5) default NULL ,
  "K2_CHANNEL00" Number(5) default NULL ,
  "K2_CHANNEL01" Number(5) default NULL ,
  "K2_CHANNEL02" Number(5) default NULL ,
  "K2_CHANNEL03" Number(5) default NULL ,
  "K2_CHANNEL04" Number(5) default NULL ,
  "K2_CHANNEL05" Number(5) default NULL ,
  "K2_CHANNEL06" Number(5) default NULL ,
  "K2_CHANNEL07" Number(5) default NULL ,
  "K2_CHANNEL08" Number(5) default NULL ,
  "K2_CHANNEL09" Number(5) default NULL ,
  "K2_CHANNEL10" Number(5) default NULL ,
  "K2_CHANNEL11" Number(5) default NULL ,
  "K2_CHANNEL12" Number(5) default NULL ,
  "K2_CHANNEL13" Number(5) default NULL ,
  "K2_CHANNEL14" Number(5) default NULL ,
  "K2_CHANNEL15" Number(5) default NULL ,
  "K3_CHANNEL00" Number(5) default NULL ,
  "K3_CHANNEL01" Number(5) default NULL ,
  "K3_CHANNEL02" Number(5) default NULL ,
  "K3_CHANNEL03" Number(5) default NULL ,
  "K3_CHANNEL04" Number(5) default NULL ,
  "K3_CHANNEL05" Number(5) default NULL ,
  "K3_CHANNEL06" Number(5) default NULL ,
  "K3_CHANNEL07" Number(5) default NULL ,
  "K3_CHANNEL08" Number(5) default NULL ,
  "K3_CHANNEL09" Number(5) default NULL ,
  "K3_CHANNEL10" Number(5) default NULL ,
  "K3_CHANNEL11" Number(5) default NULL ,
  "K3_CHANNEL12" Number(5) default NULL ,
  "K3_CHANNEL13" Number(5) default NULL ,
  "K3_CHANNEL14" Number(5) default NULL ,
  "K3_CHANNEL15" Number(5) default NULL ,
  "L1_CHANNEL00" Number(5) default NULL ,
  "L1_CHANNEL01" Number(5) default NULL ,
  "L1_CHANNEL02" Number(5) default NULL ,
  "L1_CHANNEL03" Number(5) default NULL ,
  "L1_CHANNEL04" Number(5) default NULL ,
  "L1_CHANNEL05" Number(5) default NULL ,
  "L1_CHANNEL06" Number(5) default NULL ,
  "L1_CHANNEL07" Number(5) default NULL ,
  "L1_CHANNEL08" Number(5) default NULL ,
  "L1_CHANNEL09" Number(5) default NULL ,
  "L1_CHANNEL10" Number(5) default NULL ,
  "L1_CHANNEL11" Number(5) default NULL ,
  "L1_CHANNEL12" Number(5) default NULL ,
  "L1_CHANNEL13" Number(5) default NULL ,
  "L1_CHANNEL14" Number(5) default NULL ,
  "L1_CHANNEL15" Number(5) default NULL ,
  "L2_CHANNEL00" Number(5) default NULL ,
  "L2_CHANNEL01" Number(5) default NULL ,
  "L2_CHANNEL02" Number(5) default NULL ,
  "L2_CHANNEL03" Number(5) default NULL ,
  "L2_CHANNEL04" Number(5) default NULL ,
  "L2_CHANNEL05" Number(5) default NULL ,
  "L2_CHANNEL06" Number(5) default NULL ,
  "L2_CHANNEL07" Number(5) default NULL ,
  "L2_CHANNEL08" Number(5) default NULL ,
  "L2_CHANNEL09" Number(5) default NULL ,
  "L2_CHANNEL10" Number(5) default NULL ,
  "L2_CHANNEL11" Number(5) default NULL ,
  "L2_CHANNEL12" Number(5) default NULL ,
  "L2_CHANNEL13" Number(5) default NULL ,
  "L2_CHANNEL14" Number(5) default NULL ,
  "L2_CHANNEL15" Number(5) default NULL ,
  "L3_CHANNEL00" Number(5) default NULL ,
  "L3_CHANNEL01" Number(5) default NULL ,
  "L3_CHANNEL02" Number(5) default NULL ,
  "L3_CHANNEL03" Number(5) default NULL ,
  "L3_CHANNEL04" Number(5) default NULL ,
  "L3_CHANNEL05" Number(5) default NULL ,
  "L3_CHANNEL06" Number(5) default NULL ,
  "L3_CHANNEL07" Number(5) default NULL ,
  "L3_CHANNEL08" Number(5) default NULL ,
  "L3_CHANNEL09" Number(5) default NULL ,
  "L3_CHANNEL10" Number(5) default NULL ,
  "L3_CHANNEL11" Number(5) default NULL ,
  "L3_CHANNEL12" Number(5) default NULL ,
  "L3_CHANNEL13" Number(5) default NULL ,
  "L3_CHANNEL14" Number(5) default NULL ,
  "L3_CHANNEL15" Number(5) default NULL ,
  "VFPED_CHANNEL00" Number(5) default NULL ,
  "VFPED_CHANNEL01" Number(5) default NULL ,
  "VFPED_CHANNEL02" Number(5) default NULL ,
  "VFPED_CHANNEL03" Number(5) default NULL ,
  "VFPED_CHANNEL04" Number(5) default NULL ,
  "VFPED_CHANNEL05" Number(5) default NULL ,
  "VFPED_CHANNEL06" Number(5) default NULL ,
  "VFPED_CHANNEL07" Number(5) default NULL ,
  "VFPED_CHANNEL08" Number(5) default NULL ,
  "VFPED_CHANNEL09" Number(5) default NULL ,
  "VFPED_CHANNEL10" Number(5) default NULL ,
  "VFPED_CHANNEL11" Number(5) default NULL ,
  "VFPED_CHANNEL12" Number(5) default NULL ,
  "VFPED_CHANNEL13" Number(5) default NULL ,
  "VFPED_CHANNEL14" Number(5) default NULL ,
  "VFPED_CHANNEL15" Number(5) default NULL ,
  "ZSTHR_OFFSET" Number(4) default NULL ,
  "ZSTHR_ZS_THR" Number(4) default NULL ,
  "BCTHR_THR_HI" Number(4) default NULL ,
  "BCTHR_THR_LOW" Number(4) default NULL ,
  "TRCFG_ACQ_START" Number(4) default NULL ,
  "TRCFG_ACQ_END" Number(4) default NULL ,
  "DPCFG_BC1_MODE" Number(2) default NULL ,
  "DPCFG_BC1_POL" Number(1) default NULL ,
  "DPCFG_BC2_PRE" Number(1) default NULL ,
  "DPCFG_BC2_POST" Number(2) default NULL ,
  "DPCFG_BC2_EN" Number(1) default NULL ,
  "DPCFG_ZS_GF" Number(1) default NULL ,
  "DPCFG_ZS_POST" Number(1) default NULL ,
  "DPCFG_ZS_PRE" Number(1) default NULL ,
  "DPCFG_ZS_EN" Number(1) default NULL ,
  "DPCF2_PTRG" Number(5) default NULL ,
  "DPCF2_BUF" Number(1) default NULL ,
  "DPCF2_FLT_EN" Number(1) default NULL ,
  "DPCF2_PWSV" Number(1) default NULL)
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{FEC}
\label{sec:Appendix_FEC}

\begin{verbatim}
  CREATE TABLE "FEC" ( 
  "id" Number(11) Primary Key ,
  "BranchPosition" Number(1) default NULL ,
  "Position" Number(2) default NULL ,
  "ON_FEC" Number(1) default NULL ,
  "BC_T_TH" Number(5) default NULL ,
  "BC_AV_TH" Number(5) default NULL ,
  "BC_AC_TH" Number(5) default NULL ,
  "BC_DV_TH" Number(5) default NULL ,
  "BC_DC_TH" Number(5) default NULL ,
  "TSMWORD" Number(3) default NULL ,
  "USRATIO" Number(5) default NULL ,
  "CSR0" Number(4) default NULL ,
  "CSR1" Number(4) default NULL ,
  "CSR2" Number(5) default NULL ,
  "CSR3" Number(5) default NULL),
  "RCO_FEC" Number(1) default NULL
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{RCU}
\label{sec:Appendix_RCU}

\begin{verbatim}
  CREATE TABLE "RCU" ( 
  "id" Number(11) Primary Key ,
  "Equipmentid" Number(11) NOT NULL ,
  "Position" Number(2) default NULL ,
  "ON_RCU" Number(1) default NULL ,
  "ALTROIF_NSAM_EV" NUMBER(10) default NULL ,
  "ALTROIF_CLK_RATIO" NUMBER(4) default NULL ,
  "ALTROIF_CSTB_DELAY" NUMBER(2) default NULL ,
  "RDOMOD_SPARSE_RDO" NUMBER(1) default NULL ,
  "RDOMOD_MEB_MODE" NUMBER(1) default NULL ,
  "RDOMOD_DISABLE_RDYRX" NUMBER(1) default NULL ,
  "TTC_CONTROL_CDH_VERSION" NUMBER(4) default NULL ,
  "TTC_L1_LATENCY" NUMBER(12) default NULL ,
  "TTC_L1_LATENCY_WINDOW" NUMBER(4) default NULL ,
  "TTC_L1_MSG_LATENCY_MIN" NUMBER(12) default NULL ,
  "TTC_L1_MSG_LATENCY_MAX" NUMBER(12) default NULL ,
  "TTC_L2_LATENCY_MIN" NUMBER(12) default NULL ,
  "TTC_L2_LATENCY_MAX" NUMBER(12) default NULL ,
  "TTC_ROI_CONFIG1" NUMBER(18) default NULL ,
  "TTC_ROI_CONFIG2" NUMBER(18) default NULL ,
  "TTC_ROI_LATENCY_MIN" NUMBER(12) default NULL ,
  "TTC_ROI_LATENCY_MAX" NUMBER(12) default NULL ,
  "RDOMOD_SKIP_EMPTY" NUMBER(5) default NULL ,
  "EN_INT_BA" NUMBER(5) default NULL ,
  "PLACEHOLDER" NUMBER(5) default NULL
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{SECTOR}
\label{sec:Appendix_SECTOR}

\begin{verbatim}
  CREATE TABLE "SECTOR" (
  "id" Number(11) Primary Key ,
  "Position" Number(2) default NULL ,
  "SidePosition" Number(1) default NULL)
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{TPC}
\label{sec:Appendix_TPC}

\begin{verbatim}
  CREATE TABLE "TPC" (
  "id" Number(11) Primary Key ,
  "Created" timestamp default to_timestamp('0001-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ,
  "Used" timestamp default to_timestamp('0001-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ,
  "Updated" timestamp default to_timestamp('9999-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') ,
  "Revision" Number(5) default NULL ,
  "Comment" VARCHAR(2000 CHAR))
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{ALTRO\_FEC}
\label{sec:Appendix_ALTRO_FEC}

\begin{verbatim}
  CREATE TABLE "ALTRO_FEC" ( 
  "ALTRO_ID" Number(11) default NULL ,
  "FEC_ID" Number(11) default NULL ,
  CONSTRAINT "afid" FOREIGN KEY ("ALTRO_ID") REFERENCES "ALTRO" ("id") ,
  CONSTRAINT "faid" FOREIGN KEY ("FEC_ID") REFERENCES "FEC" ("id"))
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{FEC\_RCU}
\label{sec:Appendix_FEC_RCU}
\begin{verbatim}
  CREATE TABLE "FEC_RCU" ( 
  "FEC_ID" Number(11) default NULL ,
  "RCU_ID" Number(11) default NULL ,
  CONSTRAINT "frid" FOREIGN KEY ("FEC_ID") REFERENCES "FEC" ("id") ,
  CONSTRAINT "rfid" FOREIGN KEY ("RCU_ID") REFERENCES "RCU" ("id"))
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{RCU\_SECTOR}
\label{sec:Appendix_RCU_SECTOR}
\begin{verbatim}
  CREATE TABLE "RCU_SECTOR" ( 
  "RCU_ID" Number(11) default NULL ,
  "SECTOR_ID" Number(11) default NULL ,
  CONSTRAINT "rsid" FOREIGN KEY ("RCU_ID") REFERENCES "RCU" ("id") ,
  CONSTRAINT "srid" FOREIGN KEY ("SECTOR_ID") REFERENCES "SECTOR" ("id"))
\end{verbatim} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{SECTOR\_TPC}
\label{sec:Appendix_SECTOR_TPC}
\begin{verbatim}
  CREATE TABLE "SECTOR_TPC" ( 
  "SECTOR_ID" Number(11) default NULL ,
  "TPC_ID" Number(11) default NULL ,
  CONSTRAINT "stid" FOREIGN KEY ("SECTOR_ID") REFERENCES "SECTOR" ("id") ,
  CONSTRAINT "tsid" FOREIGN KEY ("TPC_ID") REFERENCES "TPC" ("id"))
\end{verbatim} 


\end{document} 
