The information provided is for help with Commtest Instruments products:
SYMPTOMS
The backup and restore process is taking a long time on my large database.
SOLUTION
Use InterBase's backup and restore functions. This is available for users of Ascent/MAS VB versions which use InterBase (Ascent 7.00 to Ascent 8.30 inclusive).
This will reduce the time needed to perform backup/restore functions on large databases. Backing up and restoring a database can help reduce the size of the database and increase its speed; unused space in the database file is reclaimed and the data is de-fragmented.
If you have large databases you may find that the backup and restore process takes some time. The author of this article had just been visiting a company in the UK which had collected 4.4 GB of data with vb instruments over the last 2 years. The largest database was 480 MB. A backup or restore using the Ascent backup/restore facility took somewhere in the vicinity of 1 hour to perform on their computers. This same database took 10 minutes to backup using InterBase directly. After discarding some data and doing a backup/restore it was half the size and ran about 5 times faster. The discarded data was kept in another backup file in case it needed to be referred to at some time in the future.
In particular, if you have used the File>Discard Old Data or File>Data Thinning function to reduce the size of the database, you must do a backup then delete the original database, then restore from the backup file to actually see a reduction in database file size.
You do need to let the Ascent software use its own backup/restore facility when upgrading the database format (i.e. after upgrading) so that the software can translate the database from the old structure to the new structure.
The backup process in the Ascent program is accessed using the File>Backup Now and File>Restore functions on the main menu. There are also facilities for automatically scheduling backups (File>Backup options).
To perform a backup, the software must iterate through all of the data in the database, asking the database engine for every item individually so that it can write the data to a backup file. Each item of data must be translated from the database format to the SQL format that the Ascent software uses to communicate with the database. The Ascent program then translates the data from SQL format to a binary format to write to the backup file. The InterBase backup facility has direct access to the database itself and can work through the database file, generating the backup file without all these extra translation stages.
First we will set up some file associations so that the InterBase backup/restore process can be accessed easily.
First we are going to associate InterBase database files with a 'Backup' command so that you can right-click on the files in Windows Explorer and select Backup to create an InterBase backup file. (The names of menus and buttons may vary on different operating systems - these instructions refer to Windows 2000).
|
C:\Program Files\Borland\InterBase\bin\gbak.exe
If you can't find gbak.exe in the InterBase \bin folder this means that the Command Line Tools for InterBase have not been installed - this was default behaviour for some Ascent/MAS VB installation CDs. To install the Command Line Tools, insert your Ascent/MAS VB installation CD and instead of using the Menu program, browse to the CD using Windows Explorer and run the IBWin32Setup.exe program in the InterBase folder. Follow the prompts through to the Select Components screen and ensure that Server, Client and Command Line Tools are checked then keep following the prompts to re-install InterBase.
b -user SYSDBA -password masterkey "%1" Database_Backup.gbak
If you are browsing this document electronically you can copy and paste the above line into the edit box.
When you have done this the box should contain both the complete path to the gbak.exe file and the command line from above i.e.
C:\Program Files\Borland\InterBase\bin\gbak.exe" -b -user SYSDBA -password masterkey "%1" Database_Backup.gbak
Now we are going to create another file association for the backup files that will allow us to restore them by right clicking and selecting Restore.
|
C:\Program Files\Borland\InterBase\bin\gbak.exe
-c -user SYSDBA -password masterkey -p 2048 -use_all_space "%1" Database_Restored.gdb
If you are browsing this document electronically you can copy and paste the above line into the edit box.
When you have done this the box should contain both the complete path to the gbak.exe file and the command line from above i.e.
C:\Program Files\Borland\InterBase\bin\gbak.exe" -c -user SYSDBA -password masterkey -p 2048 - use_all_space "%1" Database_Restored.gdb
To backup and restore a database perform the following steps:
Windows 95, 98, NT, 2000:
C:\Program Files\Commtest Instruments\Ascent\Ascent_Database.gdb
Windows XP
C:\Documents and Settings\All Users\Documents\Ascent_Database.gdb
Windows ME:
C:\Documents and Settings\[username]\MyDocuments\Ascent_Database.gdb
This will create a file called Database_Backup.gbak in the same folder. If such a file already exists the backup will not work. You must delete or rename any existing file in the same folder called Database_Backup.gbak before using the Backup function.
This will create a new database file called Database_Restored.gdb in the same folder. Wait until the black DOS window has finished processing before using the database file. If a file called Database_Restored.gdb already exists in the same folder you must delete or rename it before performing the Restore process. Once the operation is complete you can move or rename the Database_Restored.gdb file. Once you have verified that it is working well with the Ascent program you can replace the original .gdb with this one.
The database file is actually slightly bigger now - what's going on?
The option -pagesize 2048 that is specified in the Restore function above means that larger blocks of database file space will be allocated for storing the database. The default is 1024 bytes. 2048 is recommended so that a 400 line spectrum will fit on one database page - this improves Ascent performance. Typically a spectrum will require [number of lines] x 4 bytes to store in the database. If you can afford to have larger database files and you use 1600 or 3200 line spectra often, feel free to change the -pagesize option to 4096 or even 8192 (these are the only valid options). If you want to make the database as small as possible then change the pagesize value to 1024 (or leave the option out altogether).
It doesn't work at all. The black DOS window appears very briefly then disappears without apparently doing anything
Most often this happens when there is an existing Database_Restored.gdb or Database_Backup.gbak file in the same folder. It can also happen if the database server is not available; if you select Start>Programs>InterBase>InterBase Server Manager then you should see a green message indicating that the server is 'running'. If not you can start it using the Start button. If you are still having problems please contact help for assistance.
Why do we specify '-use_all_space' on the Restore command line?
A condition monitoring database is typically going to increase size, not decrease. We do not perform many 'edits' to existing data in the database; therefore, if we do not specify - use_all_space InterBase will reserve 20% of the space within each block for revisions of existing data.
What other ways are there of making the software run faster?
Within the Ascent program there is a command File>Rebuild Database that will rebuild the indexes in the database, ensuring that you get maximum performance. Also make sure that you have plenty of disk space available and no other programs running in the background. Keep up to date with the latest version of Ascent software either from your distributor or the Commtest website.
FAQ ID: 11607 Last Reviewed: 23/09/2005