Is not a valid database ошибка

I’ve got two computers both running Firebird (let’s called them A and B) and two database files (let’s call them a.fdb and b.fdb), both copied to both computers. On B I get the message

b.fdb is not a valid database
The other files work, on A both files work.

This would be easy to explain, if B was an older version, but it’s a newer one (it was FB 2.1, and because of this problem I installed FB 2.5). The files a.fdb and b.fdb have ODS 11.1 and 10.1, respectively. It looks like new versions of FB wouldn’t support ODS 10.1 anymore, which I can’t believe. But I see no other explanation, can you?

bluish's user avatar

bluish

26.1k27 gold badges120 silver badges179 bronze badges

asked Feb 1, 2011 at 12:12

maaartinus's user avatar

maaartinusmaaartinus

44.4k31 gold badges159 silver badges317 bronze badges

I had the same problem with an old database.

In my case even the gbak command presented the «is not a valid database». (I also tried with the FIX_FSS_METADATA option)

I found that if the database was created in an 32bits environment it can’t be opened in a 64bits one.

So, what I had to do was:

  • Create a VM with a 32bits environment (in my case I created a VM with Windows XP)
  • Copy the database to this VM and make a backup using GBAK
  • Copy the backup file to my machine (64bits)
  • Run a restore using GBAK

After all this I could open the database again.

Hope it helps!

answered Mar 13, 2017 at 19:21

Rafael Araújo's user avatar

Rafael AraújoRafael Araújo

3,4441 gold badge13 silver badges14 bronze badges

1

Try to make backup and restore of database.

answered Feb 1, 2011 at 13:09

Hugues Van Landeghem's user avatar

1

In my case I can’t open a database whose was created in 32 bits in a 64 bits, so try to install firebird in 32 bits

answered Mar 28, 2022 at 21:43

André Ibarra's user avatar

2

курлык-курлык

87 / 96 / 8

Регистрация: 26.11.2009

Сообщений: 396

Записей в блоге: 1

1

13.05.2011, 22:22. Показов 14521. Ответов 6


Студворк — интернет-сервис помощи студентам

При попытке приконектиться к базе влетает ошибка

file C:DBLAB.FDB is not a valid database

подскажите что сделать?

firebird 1.5.6
IBexpert последняя версия

Миниатюры

ошибка при подключении к базе - firebird
 



0



1263 / 706 / 62

Регистрация: 21.12.2009

Сообщений: 2,255

14.05.2011, 05:30

2

Цитата
Сообщение от Максим Ширинкин
Посмотреть сообщение

file C:DBLAB.FDB is not a valid database

Каким образом вы создавали эту базу? Как она у вас появилась? Работали ли с ней до появления этого исключения? Если да, на этом рабочем месте или нет?



1



курлык-курлык

87 / 96 / 8

Регистрация: 26.11.2009

Сообщений: 396

Записей в блоге: 1

14.05.2011, 09:06

 [ТС]

3

Мне её друг дал. У него такая же версия субд как и у меня. У него работает у меня нет.
Я позже выложу файлы



0



курлык-курлык

87 / 96 / 8

Регистрация: 26.11.2009

Сообщений: 396

Записей в блоге: 1

14.05.2011, 13:37

 [ТС]

4

вот файлы и программа и файл конфигурации запихнуть его надо в C:Program FilesCommon FilesBorland SharedBDE



0



курлык-курлык

87 / 96 / 8

Регистрация: 26.11.2009

Сообщений: 396

Записей в блоге: 1

14.05.2011, 14:55

 [ТС]

5

Я вот тут на одном форуме прочитал, что такая штуковина может быть из за того что файлы просто скопированы были.
А надо через через backup/restore.
Т.е. друг мой должен бэкап сделать. А я у себя на компе ресторнуть. так получается?



0



1263 / 706 / 62

Регистрация: 21.12.2009

Сообщений: 2,255

14.05.2011, 15:30

6

Цитата
Сообщение от Максим Ширинкин
Посмотреть сообщение

может быть из за того что файлы просто скопированы были

Очень даже возможно, с высокой степенью вероятности. То, что вы выложили смотреть не буду, извините!



0



курлык-курлык

87 / 96 / 8

Регистрация: 26.11.2009

Сообщений: 396

Записей в блоге: 1

14.05.2011, 15:31

 [ТС]

7

Оказывается у меня на компе interbase стоял *facepalm*

Из за этого служба firebird не запускалась и был такой конфликт.



0



На чтение 5 мин. Просмотров 115 Опубликовано 15.12.2019

I have a problem when accessing a GDB-DataBase via the FireDAC.FB-Driver. The strange thing here is, that if I set up the connection at designtime, everything works fine with

If I try the same connection params at runtime however it gives me a [FireDAC][Phys][FB] file is not a valid database -Error.

Units FireDAC.Phys.FB FireDAC.Phys.FBDef are both included. I even tried to set all possible dll-Files as VendorLib , but it doesn’t change anything.

I know *.GDB is usually a InterBase-DataBase, but I have a FireBird-Server running, and to my understanding access via FB-Driver should work, since it does when specifying the connection at designtime.

Firebird-Server-Version is 2.5.3.26778 32-Bit

DelphiVersion is XE7

Additional Edit: ODS of the DataBase-File is 11.2 (Firebird 2.5/InterBase 7.5)

Any ideas what I’m doing wrong?

Содержание

  1. 1 Answer 1
  2. Screenshot of error message:
  3. Precise Explanation:
  4. Sample Files:

1 Answer 1

Although InterBase and Firebird have a common heritage and share a lot of terminology, they are not the same. Since Firebird 1.5, the ODS versioning has diverged. Even though Firebird 1.5 and InterBase 6.1 both have ODS 10.1, these ODS versions are different and not compatible, more so for Firebird 2.5 and InterBase 7.5 (which both have an ODS version 11.2).

So if you try to open an InterBase 7.5 database with Firebird 2.5 it will not work and Firebird will report that the database is invalid (and vice versa InterBase will report a similar error if you try to open a Firebird database).

On a technical level this is achieved in Firebird by masking the ODS version so they are distinct from the version of InterBase:

Hds_ods_version : Two bytes, unsigned. Bytes 0x12 and 0x13 on the page. The ODS major version for the database. The format of this word is the ODS major version ANDed with the Firebird flag of 0x8000. In the example below, the value is 0x800b for ODS version 11. The minor ODS version is held elsewhere in the header page — see hdr_ods_minor below.

У меня есть проблемы при доступе к GDB-DataBase через FireDAC.FB-драйвер. Странная вещь здесь, что если установить соединение при DesignTime, все отлично работает

Если я пытаюсь тем же Params соединения во время выполнения , однако это дает мне [FireDAC][Phys][FB] file is not a valid database -ошибка.

Единицы FireDAC.Phys.FB FireDAC.Phys.FBDef оба включены. Я даже попытался установить все возможные DLL-файлы , как VendorLib , но это ничего не меняет.

Я знаю * .gdb обычно InterBase-DataBase, но у меня есть ход FireBird-сервер, и мой доступ к пониманию через FB-драйвер должен работать, так как он делает при указании соединения на DesignTime.

Firebird-Server-версии 2.5.3.26778 32-Bit

DelphiVersion является XE7

Дополнительное редактирование: ODS базы данных-файла составляет 11,2 (Firebird 2.5 / InterBase 7.5)

Любые идеи, что я делаю не так?

Хотя InterBase и Firebird имеют общее наследие и разделяют много терминологии, они не то же самое . Так как Firebird 1.5, то СОД управления версиями уже разошлись. Несмотря на то, Firebird 1.5 и InterBase 6.1 оба имеют ODS 10.1, эти версии ODS различны и не совместимы, более для Firebird 2.5 и InterBase 7.5 (которые обе имеют ОРВ версии 11.2).

Так что, если вы пытаетесь открыть базу данных InterBase 7.5 с Firebird 2.5 не будет работать и Firebird сообщит , что база данных является недействительным (и наоборот InterBase сообщит подобную ошибку , если вы пытаетесь открыть базу данных Firebird).

На техническом уровне это достигается путем маскировки Firebird версии ODS таким образом, они отличаются от версии InterBase:

Hds_ods_version Два байта без знака. Байты 0x12 и 0x13 на этой странице. ODS основная версия базы данных. Формат этого слова является ODS основной версии операции AND с Firebird флагом 0x8000. В приведенном ниже примере, значение 0x800b для ODS версии 11. Меньший СОД версия удерживается в другом месте на странице заголовка — см hdr_ods_minor ниже.

When trying to attach a .MDF database in SQL Server, you see the following error message:

Attach database failed for Server ‘xxx’. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

The header for file ‘xxx.mdf’ is not a valid database file header. The FILE SIZE property is incorrect.(Micosoft SQL Server, Error:5172)

where ‘xxx.mdf’ is name of the MDF file to be attached.

Screenshot of error message:

Precise Explanation:

The data in MDF file are stored as pages, each page is 8KB. The first page is called the file header page, which contains the most important information about the whole file, such as the file signature, file size, compatibility, etc.

If the MDF file header page is damaged or corrupted, and cannot be recognized by Microsoft SQL Server, then SQL Server will think the header is not valid and report this error.

You can use our product DataNumen SQL Recovery to recover the data from the corrupt MDF file and solve this error.

Sample Files:

Sample corrupt MDF files that will cause the error:

Добрый день. Иногда возникает ситуация, что старые базы необходимо открывать с помощью нового 64х битного firebird’а. И это не получается. Возвращается ошибка TEST.GDB is not a valid database.
Используем Firebird-2.5.2.26540_0_x64.exe, gstat показывает такую информацию:

Database header page information:
Flags 0
Checksum 12345
Generation 167
Page size 1024
ODS version 10.0
Oldest transaction 164
Oldest active 165
Oldest snapshot 165
Next transaction 166
Bumped transaction 1
Sequence number 0
Next attachment ID 0
Implementation ID 16
Shadow count 0
Page buffers 0
Next header page 0
Database dialect 1
Creation date Oct 10, 2011 16:38:52
Attributes force write

Не работает как коннект к базе, так и попытка сделать backup (для последующего restore).

При этом с новыми 32х битными версиями FB всё работает нормально. Базе можно сделать b/r и дальше с ней работать.

Можно было бы пытаться делать бакап в старом FB, потом рестор в новом. Но так не всегда получается — не всегда старый FB исправен. Эти все действия происходят в инсталляторе — апдейтере программы. Хочется всё сделать автоматом, не заставляя пользователей что-то скачивать, бакапить-ресторить и т.п.

Problem:

SQL Error 5172

In this article we will know: —

  • What is SQL error 5172?
  • Reasons For «file size property is incorrect SQL Server»
  • How to Fix SQL Error 5172 (.mdf is not a valid database file header)?

Solution:

What Is SQL Error 5172?

The SQL Server stores its physical data in primary database file, which contains the data according to pages. The header information of a .mdf file is hold by first page, which is known as the header page. This page contains the important information of that database file like: file size and signature etc.While attaching the .mdf file in SQL Server, One of the most common error users encounter i:e Microsoft SQL Server Error 5172. The issue .mdf is not a valid database file header generally occurs when the header information of a .mdf file gets corrupted. Due to this the header file information got mismatched and the result of this error could be the database becomes inaccessible.

Reasons For «file size property is incorrect SQL Server»

There could be several reasons behind of header information corruption. It could be corrupt due to following reasons:

  • Bad system Shutdown
  • Improper Shutdown of Microsoft SQL Server
  • Malfunctioning of a hardware
  • Virus attacks

These corruption reasons could be result the issue file size property is incorrect SQL Server and make the database file inaccessible or user failed to attach the database file and get this SQL Server error 5172.

In order to fix this error, one can try restoring the recent backup of the database. If you have a latest copy of backup then it is the right time to use it. Sometimes, the Microsoft SQL Error 5172 arises when a higher version database file is attached to a lower version Server. So, make sure that the database file is attached with the right version to prevent such situation.

Another method to solve this database file header issue is to try SQL Database Recovery Software, if you don’t have the recent backup. The software is capable to fix the file size property of a database file and resolve the issue «mdf is not a valid database file header».

How the Tool Fix File Header Corruption In SQL Server?

Follow the Below Steps to Resolve SQL Server Error 5172:

Bottom Lines

There could be several reasons behind the header information corruption. The article describes some major issues which could be the cause of SQL Server error 5172. Also, it explains the possible recovery solution to fix the issue .mdf is not a valid database file header.

Понравилась статья? Поделить с друзьями:
  • Is not a function ошибка json
  • Is not a function javascript в чем ошибка
  • Is not a block device ошибка монтирования
  • Is mf03 5 ошибка при удалении
  • Is mf02 5 ошибка gta v