### System database maintenance You should perform the following system maintenance on a regular basis. See To safely shut down the WebCTRL® application for database server maintenance before doing any maintenance on your database server.
Click for details below To back up a system To compact and defragment To minimize the database size To safely shut down the WebCTRL® application for database server maintenance
#### To back up a system The type of database your system uses determines the method you use to back up the system. In WebCTRL®, you can find the database type on the System Settings > General tab. CAUTION Do Not use SiteBuilder's Replicate feature to back up your database. For Apache Derby or SQL Server Express Shut down the SiteBuilder and WebCTRL Server applications. In the WebCTRL x.x\webroot folder, copy your system folder. Paste the copy to a new location. TIP Zip the copy before transporting it over a network or to a CD. For MySQL, MS SQL Server, Oracle, or PostGreSQL Follow the instructions above to copy your system folder in WebCTRL x.x\webroot. Use the database management system's backup method. See To safely shut down the WebCTRL® application for database server maintenance before doing any maintenance on your database server.
#### To compact and defragment In a new WebCTRL® system, the records in a database are contiguous. As records are added, deleted, and modified, the records become scattered in the database. This condition, called fragmentation, can slow down system performance and increase the database size. Compact the database to correct this situation. The files on the server's hard drive can also become fragmented. Defragment the hard drive to correct this situation. You should compact and defragment on a regular schedule such as once a month. But, you may need to do these more often, depending on how often the data or files change. NOTE Compacting a database may take several minutes to several hours, depending on its size. TIP To minimize the effects of fragmentation, you should maintain at least 20% free disk space on the server. Compacting the database The following databases are compacted dynamically—compacting occurs in the background when a database is open. MySQL MS SQL Server MS SQL Server Express Oracle PostGreSQL To compact a Derby database: Shut down the SiteBuilder and WebCTRL® Server applications. Open the computer's Command Prompt application and type``cd c:\WebCTRLx.x``, replacing x.x with your system version number. Click Enter. Type``"Derby Compression Tool.exe" <system name>``. Click Enter. When compacting finishes, close the command window. Defragmenting the server's hard drive For all database types, use a defragmentation utility such as Windows® Disk Defragmenter. NOTE If you are using a single computer as both the WebCTRL® server and the client, you must defragment the disk more often than the disk of a dedicated server—especially if people access the Internet from this computer.
#### To minimize the database size The larger a database is, the less responsive it may become. Deleting closed alarm incident groups, expired schedules, and expired historical trends on a regular basis will reduce the database size. You can set up your WebCTRL® application to automatically delete these. See "System Settings > Scheduled Tasks tab" in WebCTRL® Help.
#### To safely shut down the WebCTRL® application for database server maintenance Occasionally, the database server is shut down for maintenance or backups. If this is done without shutting down the WebCTRL® Server first, the database may get locked and the WebCTRL® application may not be able to reconnect. Shut down the WebCTRL® application.`` Shut down the database server. Perform the maintenance or repair needed on the server. Restart the database server. Restart the WebCTRL® application.