User’s Guide : EViews Fundamentals : EViews Databases : Maintaining the Database
  
Maintaining the Database
 
Database File Operations
Packing the Database
Dealing with Errors
Rebuilding the Database
In many cases an EViews database should function adequately without any explicit maintenance. Where maintenance is necessary, EViews provides a number of procedures to help you perform common tasks.
Database File Operations
Because EViews databases are spread across multiple files, all of which have the same name but different extensions, simple file operations like copy, rename and delete require multiple actions if performed outside of EViews. The Proc button in the database window toolbar contains the procedures Copy the database, Rename the database, and Delete the database that carry out the chosen operation on all of the files that make up the database.
Note that file operations do not automatically update the database registry. If you delete or rename a database that is registered, you should either create a new database with the same name and location, or edit the registry.
Packing the Database
If many objects are deleted from an EViews database without new objects being inserted, a large amount of unused space will be left in the database. In addition, if objects are frequently overwritten in the database, there will be a tendency for the database to grow gradually in size. The extent of growth will depend on the circumstances, but a typical database is likely to stabilize at a size around 60% larger than what it would be if it were written in a single pass.
A database can be compacted down to its minimum size by using the pack procedure. Simply click on the button marked Proc in the toolbar at the top of the database window, then select the menu item Pack the Database. Depending on the size of the database and the speed of the computer which you are using, performing this operation may take a significant amount of time.
You can get some idea of the amount of space that will be reclaimed during a pack by looking at the Packable Space percentage displayed in the top right corner of the database window. A figure of 30%, for example, indicates that roughly a third of the database file consists of unused space. A more precise figure can be obtained from the Database Statistics view of a database. The number following the label “unused space” gives the number of unused bytes contained in the main database file.
Dealing with Errors
EViews databases are quite robust, so you should not experience problems working with them on a regular basis. However, as with all computer files, hardware or operating system problems may produce conditions under which your database is damaged.
The best way to protect against damage to a database is to make regular backup copies of the database. This can be performed easily using the Copy the Database procedure documented above. EViews provides a number of other features to help you deal with damaged databases.
Damaged databases can be divided into two basic categories depending on how severely the database has been damaged. A database which can still be opened in a database window but generates an error when performing some operations may not be severely damaged and may be reparable. A database which can no longer be opened in a database window is severely damaged and will need to be rebuilt as a new database.
EViews has two procedures designed for working with databases which can be opened: Test Database Integrity and Repair Database. Both procedures are accessed by clicking on the button marked Proc in the database window toolbar, then selecting the appropriate menu item.
Test Database Integrity conducts a series of validity checks on the main database and index files. If an error is detected, a message box will be displayed, providing some information as to the type of error found and a suggestion as to how it might be dealt with. Because testing performs a large number of consistency checks on the database files, it may take considerable time to complete. You can monitor its progress by watching the messages displayed in the status line at the bottom of the EViews window. Testing a database does not modify the database in any way, and will never create additional damage to a database.
Repair Database will attempt to automatically detect and correct simple problems in the database. Although care has been taken to make this command as safe as possible, it will attempt to modify a damaged database, so it is probably best to make a back up copy of a damaged database before running this procedure.
Rebuilding the Database
If the database is badly corrupted, it may not be possible for it to be repaired. In this case, EViews gives you the option of building a new database from the old one using the dbrebuild command. This operation can only be performed from the command line (since it may be impossible to open the database). The command is:
dbrebuild old_dbname new_dbname
The dbrebuild command does a low level scan through the main data file of the database old_dbname looking for any objects which can be recovered. Any such objects are copied into the new database new_dbname. This is a very time consuming process, but it will recover as much data as possible from even heavily damaged files.