# Presentation: 930594

## SPEAR PV RDB Database

**SPEAR PV RDB Database**
**Clemens Wermelskirchen**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## PV Recording (HistoryLog)

**The SPEAR control system is recording PV values into an Rdb database:**
**2070 analog readbacks, fixed periodic recording**
**	****recording rate: every 2 seconds****	****recording time: minimum ~ 120 msec**
**300 status readbacks + 3260 setpoint values, event driven recording**
**	****recording rate: 0.5 seconds (changes only)****	****recording time: minimum ~ 5 msec**
**All data is recorded as float value (for now), i.e. no strings, no arrays.**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## IOC Configuration and Bumpless Reboot Challenge

**Problem:**
**  ****various ways to configure IOCs (IOC static “database”)**
**  ****generation of IOC configuration file difficult (and data always out of date)**
**Our approach:**
**  ****standard IOC boot procedure**
**  ****special initialization program “dbrestore” before IOCINIT**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## IOC Reboot and “dbrestore”

**dbrestore:**
**  ****has access to complete IOC static database structures**
**  ****uploads specific PV information to PVServer, which stores all****   information in an Rdb database ****   ******** always current PV configuration in database for Web view**
**  ****PVServer downloads last recorded (monitored) setpoint values from****   History database to dbrestore, which restores themusing static DB access**
**  ****IOC starts with restored setpoint values**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## dbrestore, History Database, and History Recording Management

**  ****Management of all PVs in History Database is done via WEB (PHP)**
**  ****After IOC has reported a new PV record for the first time, recording options****   and HistoryPlot display options are configured**
**  ****PVs can move between IOCs, only the PVname is relevant**
**  ****Actual information about PV is always available via WEB****   (includes IOCname, IOC boot time, current value)**
**  ****currently more than 40,000 PV definitions in database**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## Procedure for new PV record

**generate IOC db-file**
**boot IOC**
**dbrestore reports new PV**
**PVServer stores new PV attributes in Rdb database**
**IOC runs**
**If record field needs to be recorded, recording turned on via Web,**** also, attributes on how to display value in HistoryPlot are defined**
**Recording begins (assuming field is assign valid value)**
**parameter can be viewed in HistoryPlot**
**next time IOC boots, the monitored value is restored by dbrestore**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## History Database Applications Overivew

- PV and IOC configuration data

- Recorded PV values

**Tables:**

**Tables:**

- Database

- PVServer

- IOCs

- dbrestore

- HistoryLog

- IOCs

- CA monitor

- PHP programs

- Web Server

- HistoryPlot

- X-Applications

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## Slide 8

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## Slide 9

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## History Data

**Recorded history data:**
**periodic data (every 2 seconds)**
**event driven data (every 0.5 seconds, when changed)**
**Periodic data older than 90 days is reduced to single data point every minute**
**8 months of data results in database files of about 70 GB**
**Data is accessible through ODBC and JDBC**
**Database applications are C-programs, Matlab-programs, Web-applications (PHP)**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## Additional Rdb Databases

**Additional Rdb databases:**
**Event database (collects messages sent from application programs)****Web interface for viewing**
**Machine configuration database (not fully implemented yet)**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005

## Conclusion

**  ****Standard database and database tools are very useful, performance tuning****    without touching applications**
**  ****Database acts as central repository for different applications**
**  ****Two tier IOC configuration:****   - static configuration file****   - modifiable fields (like calibration data, ESLO, EOFF) from always****      up-to-date database (monitored)**

- SPEAR PV RDB Database                            EPICS Collaboration Meeting                 April 27, 2005