| #FAQ: 10085-EN, Date: 3/20/2006 How to validate and repair the OroTimesheet 5 database with the Firebird "gbak" and "gfix" command line utilities. |
| The information in this article applies to : OroTimesheet 5.x (English) OroTimesheet 5.x (French) Description This procedure explains how to validate and repair the OroTimesheet 5 database when it has been damaged. A database could become damaged in circumstances such as:
- Abnormal termination of the OroTimesheet application or the Firebird server. - Write errors in the operating system or hardware. - Hardware failures. Here are some examples of error messages you can receive in such cases: - "I/O error for file ..." - "Error while trying to read from file ..." - "Database file appears corrupt" - "Database corrupted" WARNING: Assistance of a qualified technician is strongly recommended to use the Firebird "gbak" and "gfix" utilities. For more information about command line utilities of Firebird, refer to the Firebird documentation. Solution 1- Logon directly to the server console where Firebird is installed on. If the server is a Windows server, open an "MS-DOS" session. If the server is a Unix/Linux server, open a command shell session.
Important notice: If you are using a Windows server, commands below will only work if they are run directly from the Windows server concole. They will not work if you are accessing the Windows server console through a client terminal server session. 2- Define the following two variables (by doing this, you do not have to type in the user name and password every time you issue a command). SET ISC_USER=SYSDBA SET ISC_PASSWORD=masterkey (If you have changed the password for the SYSDBA Firebird user, affect this new password to the ISC_PASSWORD variable instead of masterkey) 3- Go to the folder where the Firebird command line utilities are located. Usually these utilities are in the C:\Program Files\Firebird\Firebird_1_5\bin folder under Windows and in the /opt/firebird/bin folder under Unix/Linux. 4- Be sure that nobody is using OroTimesheet 5 while you are trying to repair the database else the operation will fail. 5- It is strongly recommended to make a copy of the OroTimesheet 5 database file (usually ot.fdb) before trying to repair it. Use the operating system to make a copy of the database (Under Windows use Windows Explorer or the copy command. Under Unix/Linux use the cp command). By doing this, you ensure to have a copy of your database before any modification to this one. 6- Type the following command line to check for database corruption: gfix -v -full ot.fdb (Replace ot.fdb by the full path to the OroTimesheet 5 database.) For example, under Windows, if the full path to the database is C:\Program Files\OroLogic\OroTimesheet5\ot.fdb enter: gfix -v -full "C:\Program Files\OroLogic\OroTimesheet5\ot.fdb" Under Unix/Linux, if the full path to the database is /home/orotimesheet5/ot.fdb, enter: gfix -v -full /home/orotimesheet5/ot.fdb Note: Use quotation marks only under Windows and only if the database path contains spaces. 7- The previous command should indicate thay the database contains errors. To repair these errors type the following command: gfix -mend -full -ignore ot.fdb (Replace ot.fdb by the full path to the OroTimesheet 5 database) 8- Now check to see if the corruption has been repaired by typing the following command: gfix -v -full ot.fdb (Replace ot.fdb by the full path to the OroTimesheet 5 database) 9- If you still see errors, you should now do a full backup and restore with the gbak utility. Type the following command to make a backup of the OroTimesheet 5 database: gbak -backup -v -ignore ot.fdb ot.fbk (Replace ot.fdb by the full path to the OroTimesheet 5 database. Replace also ot.fbk by the full path to the OroTimesheet 5 database but be sure to keep the .fbk extension.) If gbak falls over because it is having trouble with garbage collection, then use the following command: gbak -backup -v -ignore -garbage ot.fdb ot.fbk If there is corruption in record versions of a limbo transaction, then you may need to include the -limbo switch: gbak -backup -v -ignore -garbage -limbo ot.fdb ot.fbk 10- Now restore the OroTimesheet 5 database by typing the following command: gbak -replace -v ot.fbk ot.fdb (Replace ot.fdb by the full path to the OroTimesheet 5 database. Replace also ot.fbk by the full path to the database but be sure to keep the .fbk extention) 11- The restore is now completed. Verify that the database has been fixed by typing the command indicated at step 6. The gfix utility should not indicate any errors. 12- Now you can run OroTimesheet 5 again. Status Information
Revision 2 |
| © 1996-2008 OroLogic Inc. |