Which version of Interbase or Firebird was a database created under?
Asked Answered
A

3

7

I have a file with an extension .ib. I am guessing it is either an Interbase or a Firebird file, but I am having trouble working out exactly which. Furthermore, it isn't clear exactly which version of Interbase (or Firebird) was used to create the file.

What I have found so far:

I have tried various different software to read this file (FlameRobin, Firebird's isql.exe and also the latest version of Interbase) and the error messages I get tell me the ODS ("On Disk Structure") is version 9. Which is quite old, and dates to around the time that Firebird was forked from Interbase.

I have managed to connect to the database and query it using Firebird, but some errors I'm getting lead me to believe it is actually an Interbase database (I can explain further if required)

Is there a fool proof way of determining exactly what sort of database I'm dealing with? i.e. is it an Interbase or Firebird file and if so which version was it written with?

Edit: The output of gstat.exe -h run using Firebird 2.5:

Database header page information:
    Flags           0
    Checksum        12345
    Generation      7558
    Page size       4096
    ODS version     9.1
    Oldest transaction  7506
    Oldest active       7544
    Oldest snapshot     7544
    Next transaction    7549
    Bumped transaction  1
    Sequence number     0
    Next attachment ID  5
    Implementation ID   16
    Shadow count        0
    Page buffers        0
    Next header page    0
    Database dialect    1
    Attributes      force write

    Variable header data:
    Sweep interval:     20000
    *END*

To summarise:

  • Get a copy of Firebird
  • Run gstat.exe -h from the bin directory
  • Get the ODS version from the output
  • Look it up in the table here
Apelles answered 2/4, 2012 at 7:45 Comment(8)
Can you please elaborate on the errors you're getting? Also, which database engine are you using to connect to the database? Are you connecting to it using Dialect 1?Guadalupe
The ODS corresponds to Interbase 5.5 or 5.6.Jazminejazz
Just to clarify, it could not have been Firebird 1.0 or 1.5 (both have a "Minor Version" of 9.1)Apelles
@GuillemVicens I am connecting with Firebird2.5 isql.exe. When I try to connect with FlameRobin I get "Unsupported Server: wrong ODS Version (9), at least '10' required"Apelles
@awmross, are you using Dialect 1 when connecting to it? I never used FlameRobin, but you won't be able to work correctly with the database if you are using Dialect 3.Guadalupe
@GuillemVicens I don't know what Dialect I am using.Apelles
@EMBarbosa I added the Delphi tag as I know Firebird is mostly used in the Delphi community and thought I would have a better chance of getting answers if I added the Delphi tag. Now I have an answer I will remove the tag.Apelles
@Apelles ohh. Makes sense. I will remove my comment then.Birdt
J
13
  1. About ODS and how to get it.
  2. Firebird, Interbase versions and corresponding ODS. It is on Russian, but the table you can read. It has columns - Version, Main ODS version, Supported ODS versions.
Jazminejazz answered 2/4, 2012 at 8:25 Comment(4)
I have run gstat.exe and added the output to the original question. So according to the russian table, it must have been created in Interbase 5.5 or 5.6? Is it possible a database created in Firebird 1.0 would have an ODS of 9.1 or would it always be 10.0?Apelles
Firebird 1.0 will always create a DB with ODS 10.0Jazminejazz
Too bad that FB3 choosed to use ODS 12.0 which is also used by IB 2007. destructor.de/firebird/3.0Urethroscope
@JeroenWiertPluimers The Firebird ODS uses a bitmask to distinguish itself from InterBase ODSes. All ODS higher than 10 are actually something like - for ODS 12 - ODS 32780.Kincaid
G
2

From the answer to my comments regarding the Dialect used, I guess FlameRobin is using Dialect 3 when connecting to the database, which is the default dialect for new databases Read Dialect for more information on this matter. On the other hand, Dialect 1 is the default for legacy databases (older than IB 6.0).

in iSQL you can use the following sentences to make sure you are on Dialect 1. When you start iSQL:

isql -sql_dialect n

or inside a iSQL session:

SET SQL DIALECT n;

More info on iSQL and dialects here.

If this does not work then your best best is to get some old installation of Interbase 5.0, perform a gbak and restore the database with your Firebird 2.5 installation.

You could also try to ask on the Firebird mailing lists. There is one of them focused on Interbase database conversions.

EDIT: as stated by @mghie, the problem with FlameRobin probably is because it does not support ODS prior to 10.

HTH

Guadalupe answered 2/4, 2012 at 10:17 Comment(2)
The SQL dialect is returned by a call of the isc_database_info() function. FlameRobin will use that dialect if it's either 1 or 3. It does however not support ODS versions below 10.Pursuance
@mghie, thanks for the info. I do not use FlameRobin so I was not sure if it would use the database's dialect or a default one.Guadalupe
M
0

You can use FBConvert utility to convert the database into latest Firebird 2.5 format.

Monorail answered 2/4, 2012 at 11:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.