Database Backup and Recovery

See also Database Utilities Keeping Your Database Size Minimal

Investor/RT Database Concepts

Investor/RT utilizes an embedded database management system to record and maintain historical data, user preferences, and definitional data. The database contains many different kinds of records, for example there is a record for each instrument. These in turn are related to the records containing historical data for the instrument. Similarly, relationships are maintained between instruments and the quote pages in which they appear, between instruments and trading positions within portfolios, between instruments and news items and trading notes pertaining to the instrument. Preferences and definitions of charts, quotepages, scans, signals, custom indicators, and all other saved objects are kept in the data base.

The Investor/RT database is a collection of files kept within a folder (directory) named db inside the InvestorRT working directory. Investor/RT 13 uses an older database system and the files are instead kept in a folder named data_f.

Investor/RT has an automated daily back-up feature and built-in database recovery system that will restore the database back to its most recent back-up if the database is damaged in any way due to a power failure, system error or application failure. The Backup Preferences window allows the user to specify when daily backups are to be made and the location where the backup is kept. The back-up location is by default the archives folder (directory) within the InvestorRT working directory. Investor/RT Version 14 and higher create the backup as a restore point. A restore point is a compressed file that contains a backup of every database file. Certain files used for storage of historical data are by default included when making the backup restore point. The daily restore point is kept in the archives directory and is named BackupDatabase.dba. Investor/RT also makes periodic restore points every day or so automatically that do not include the historical data. These restore point, also in the archives directory are named with the date and time they were made and are useful if you wish to restore your database to a point in the past. Typically, such dated restore points are retained for the last 30 days as a additional backup mechanism. The daily backup typically takes a few seconds longer to create since it includes all of the historical data on file. Users who track many instruments and retain many years of intra-day data and many days of tick data per symbol typically have much larger historical files that take much longer to backup. Advanced users can set the Preferences > Configuration variable AutoBackupIncludeHistData to false; daily backups will then be made in just a few seconds. Restore points that lack historical data contain all user information (instrument setups, charts, quotepages, preferences, RTL, etc). Reverting to such a restore point simply means that historical data will be retrieved by the platform automatically before the charts populate.

When Investor/RT starts up, it determines whether the database was closed normally the last time Investor/RT ended. If so, startup continues normally. If the database was not closed properly, Investor/RT launches the database maintenance utility application to correct minor errors and verify the integrity of the database. If the database is okay, startup continues normally. If the database is damaged (rare) the user is given the opportunity to restore the database to the most recent backup. Options are provided in Backup Preferences for automating the recovery process. It is recommended that the user enable the option to verify the database before making backups and enable the option to automatically restore the database if errors are encountered.

Daily backup is necessary. Additionally, a weekly or monthly backup to some other media (e.g. a USB thumb drive, or a cloud storage folder) is advised to protect against data loss in case a hard drive failure renders the database and backups unrecoverable.

Reverting to a Restore Point

Reverting  the database to either the daily backup or to another restore point is easy. If Investor/RT is running, use the File menu to access Functions. In the functions window, select the function Revert To Restore Point. Investor/RT then prompts for selection of the restore point you wish to use.  If you decide to revert when RT is not yet running, start up Investor/RT and hold down the shift key as the platform starts. The Startup Manager window will appear, listing all of the restore points presently available. The restore point named BackupDatabase.dba is the most recent daily backup and other restore point file names will reflect the date and time they were created. Select the one to use and click the button Revert to Restore Point. The platform will revert the database and restart automatically. Historical data will be downloaded automatically as needed.