DB Corruption repair

Discussion in 'Backup & Disaster Recovery' started by Anonymous, Nov 16, 2006.

  1. Anonymous

    Anonymous Guest

    As with any database, it is a fact that can corruption can occur. In this eventuality what tools are available to repair corrupted databases?

    What is the typical sequence for recovery. ie: recover from backup, attempt to repair db etc.
  2. Graham

    Graham Developer Staff Member

    Database corruption occurs due to hardware faults, or improper server installation. It is strongly advised that servers must be installed onto dedicated PCs for serving, and ideally using a server OS eg. Windows 2000 server, or Windows 2003 server. Anything else is second best.


    In the event that database corruption has occurred, your best bet is to restore from a backup.

    Failing the availability of a recent backup, then you may follow the steps here. Although it refers to Interbase, it also applies to Firebird.

  3. Graham

    Graham Developer Staff Member

    And here is an article on some common ways to cause corruption!
  4. Jason

    Jason Developer / Handyman Staff Member

    I've used Firebird SQL with Synapse since March 2006. I've had absolutely no database problems at all. This includes many crashes of Synapse while playing with alpha releases etc. Firebird is easy to maintain and darn near close to zero administration. I do hourly backups, but have never needed to use them.

    And I guess the good (or bad,for me) news is that I violate all ofGraham'ssuggestions.

    (1)I use a Windows XP box to host the Firebird Database.

    (2) The computer was cheap, not overly high-powered.

    (3) I often (mostly) use Synapse right from the "server" computer !

    (4) I often run tonnes of other apps on the "server" computer as well.



    Admittedly I am going to migrate to an apparently more robust system, more along the lines of Graham's suggestions.

    This is just a real life testimony that despite not following the most robust guidelines, Firebird has been rock solid.

  5. Graham

    Graham Developer Staff Member

    Very naughty... you're asking for trouble. You should always minimize the circumstances in which corruption can occur.
  6. Graham

    Graham Developer Staff Member

    I was forced to do a clinic out of town where there was no access to the internet. So, I copied my database to my laptop and did the clinic that way running the server locally.

    Back home I copied the database to a USB hard drive and then back onto the server.

    Start up Synapse EMR - no go. It asked to setup a new connection.

    I then went to the ODBC control panel to test my connection on the server and it reported that the database was damaged [:(]

    No problem ... copied it from my laptop again to the USB hard drive, and then back again on to the server. Worked fine after that.
  7. qilin

    qilin Member

    You can do that if you are the only one accessing the database. If your main office staff still have to work on the database or if you have another physician usng the database, you won't be able to do it this way.
  8. Lewis

    Lewis New Member

    I am serious about safeguading patients' database.However, as far as reasonably possible, I would like to minimize cost also.Hope you canexplain to me in clearer terms why is it not recommended for Synapse Server & Client to run from the same PC. You mentioned that anything else is second best. How good is "second best" & whether "second best" is an acceptable risk level?If I dedicate a PC to become the server, would any PC running Windows XP Pro be sufficient?Howto find outwhetherDB corruption has occured?
  9. Graham

    Graham Developer Staff Member

    If you run the synapse server from your PC, then there is a risk that any of the programs on your PC can crash windows and that might interrupt a database write which then corrupts the database tables. Programs that do that also includes spyware and viruses. It happens. But it is much less likely to happen on a PC which no one else is using.

    When I used another database program - not Firebird, on my laptop, it was a regular occurrence to get database corruption which is why I wrote Synapse as n-tier architecture, or client server, to prevent this happening.

    To check for db corruption, you should do daily database backup with the Firebird backup tool and this also can check for corruption.

    XP Pro, XP Home ... both can be used if you're a single physician. I'd recommend 2Ghz P4 or faster with 512Mb of ram minimum.

    If you really want to run Synapse-server on the same PC, then I'd at least suggest you run it from a virtual PC to protect it from viruses/spyware.
  10. Lewis

    Lewis New Member

    Graham,Where is the database located as you mentioned you can copy the database to your laptop?Although I have installed Synapse Client & Synapse Server onto my single PC & started trying to familiarize myself with it, I have absolutely no idea at all as to where is my patient's data (consultation records etc) being stored to (which drive/directory/folder/file extension etc).I am very concerned/scared of relying on EMR & go paperless if I do not know what an EMR program/software is doing for/to me[^o)].Does Firebird comes preinstalled with Synapse Client/Server? I asked this because when I tried to install Firebird 2.0.3 I was informed that 1 existing Firebird or Interbase version has been found. And I did find Firebird 1.5.3 in my program folders.May I know where is the Firebird Backup Tool located, within the Synapse Client?
  11. Graham

    Graham Developer Staff Member

    the database that stores all your data is called remr.fdbbut all the scans and other files generated ( such as pdfs ) are stored in the cache-listener directory.
    Firebird was installed when you installed the synapse-server using the installation program.

    The firebird backup tool is a command line tool named gbak.exe

    You can not use the DOS or Windows "copy" program safely to copy the remr.fdb file.
  12. Lewis

    Lewis New Member

    What is a command line tool & how can I get gbak.exe running to do backup using firebird backup tool?What can I used safely to copy remr.fdb file?
  13. Graham

    Graham Developer Staff Member

  14. Jason

    Jason Developer / Handyman Staff Member

    Re: Database maintenance

    I have something 6,000 copies of my REMR.fdb :)

    I just keeps making backups. I've never had a problem, so maybe I should reduce the frequency of the backing up :)

  15. Graham

    Graham Developer Staff Member

    Re: Database maintenance

    I think that's overkill! are you making hourly backups with Fibs??

  16. Lewis

    Lewis New Member

    How to restore database backup created using FIBS?
  17. Graham

    Graham Developer Staff Member

    http://www.destructor.de/firebird/gbak.htm

    Eg <code></code>

    <code>gbak -c -v -user SYSDBA -password masterkey
    c:\backups\remr.fbk c:\emr\server\remr.fdb</code>
  18. Lewis

    Lewis New Member

    Actually I am aware of the commands for backup / restore. However I do not know where should I type in the command line in order to execute the restore. I managed to avoid the need to use the gbak command line to perform backup since I could just use FIBS instead without the need to type anything.
  19. Graham

    Graham Developer Staff Member

    Let's say you have installed firebird 2.0

    Then it might be something like this from a dos shell

    "c:\program files\firebird\firebird_2_0\bin\gbak" and then the rest of the above line.

  20. Jason

    Jason Developer / Handyman Staff Member

    I usually do it manually, just find where the files are stored.

    I use FIBS

Share This Page