#FAQ: 10170-EN, Date: 07/21/2011

How to validate and repair the OroTimesheet 7 database with the Firebird "gbak" and "gfix" command line utilities.


The information in this article applies to :
OroTimesheet 7.x (English)
OroTimesheet 7.x (French)


Description
This procedure explains how to validate and repair the OroTimesheet 7 database when it has been damaged.

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_2_5\bin folder under Windows and in the /opt/firebird/bin folder under Unix/Linux.

4- Be sure that nobody is using OroTimesheet 7 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 7 database file (the default database file is named ot.fdb) before trying to repair it. 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 7 database.)

For example, under Windows, if the full path to the database is C:\Documents and Settings\All Users\Application Data\OroLogic\OroTimesheet\Databases\ot.fdb enter:

   gfix -v -full "C:\Documents and Settings\All Users\Application Data\OroLogic\OroTimesheet\Databases\ot.fdb"

Under Unix/Linux, if the full path to the database is /home/orotimesheet/ot.fdb, enter:

   gfix -v -full /home/orotimesheet/ot.fdb

Note: Use quotation marks only under Windows and only if the database path contains spaces.

7- The previous command should indicate that 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 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 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 LogiSale database:

   gbak -backup -v -ignore ot.fdb ot.fbk

(Replace ot.fdb by the full path to the OroTimesheet database. Replace also ot.fbk by the full path to the OroTimesheet 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 database by typing the following command:

   gbak -rep -v ot.fbk ot.fdb

(Replace ot.fdb by the full path to the OroTimesheet 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 again.


Status
Information

See also FAQ 10169-EN



© 1996-2012 OroLogic Inc.