Ошибка подключения к базе данных unavailable database

I have a Firebird 2.0 database running on a remote Windows XP PC.
Using the ADO.net connection provider, I configure the connection as follows:

Dim x As New FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder
x.Database = "[hostname]:FileShare:/db/REMOTE_SVR.FDB"
x.UserID = "SYSDBA"
x.Password = "masterkey"

Dim y As New FirebirdSql.Data.FirebirdClient.FbConnection(x.ConnectionString)
y.Open()

Attempting to open the connection raises an FbException, with the message «unavailable database».

Downloading the ODBC drivers and attempting to connect with those settings produces the same error message.

I have copied the database file to my development environment and verified that I can connect to x.Database = "c:\testdb\REMOTE_SVR.FDB" with these settings (with a local install of Firebird 2.0 Server).

I have confirmed that the Firebird 2.0 Server is running on the remote PC. The fileshare in which the DB is located doesn’t require any login or permissions.

I’m probably doing something dumb, but I’m out of ideas.

asked Aug 12, 2016 at 10:41

Frosty840's user avatar

0

Firebird will — by default — not open database files that are located on a network share. The file must be on a physical disk of the server. This is done to protect the database against corruption from incorrect or insufficient locking of the file (eg when accessed by multiple Firebird server processes from different machines).

So you need to move the database to one of the real drives of the machine that hosts the Firebird server process.

answered Aug 12, 2016 at 11:32

Mark Rotteveel's user avatar

Mark RotteveelMark Rotteveel

101k193 gold badges141 silver badges199 bronze badges

9

My answer is not about setup connection using ADO.net, but I still try to answer how to connect to remote FDB from Windows.

  1. In firebird.conf set RemoteFileOpenAbility to 1. This parameter will allow your DBMS connect to DB located in remote folder. Also check that Redirection parameter is set to 0 or is commented with #.

  2. Download PSTools from https://learn.microsoft.com/en-us/sysinternals/downloads/psexec, unpack it.

  3. From PSTools folder via CMD (started as admin) execute psexec -i -s cmd.exe, accept agreement.

  4. In popped-up CMD’s window execute whoami to check that you are now identified as nt authority\system.

  5. In that window execute such command:

net use z: \\123.111.111.111\my_share /persistent:yes, where z is a network drive letter, you want to assign, and 123.111.111.111\my_share is an address of your network share. If the command executed successfully you will see new network drive in the Explorer.

If you got System error 58, try to execute command with specifying user/password in quotes like:

net use z: \\123.111.111.111\my_share /persistent:yes /user:"your username" "your password"

If in the future you will need to disconnect that network drive, perform step 3, then execute net use z: /delete. Or just reboot OS.

  1. Now you can launch your client (ibexpert, dbeaver, etc.) and connect to remote FDB file:
  • Server name: localhost
  • FDB file path: Z:/path_to_FDB/some_db.FDB

answered Mar 11 at 16:42

Kyo's user avatar

evil0o

5 / 5 / 2

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

Сообщений: 200

1

14.03.2013, 00:18. Показов 40902. Ответов 10

Метки нет (Все метки)


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

пытаюсь подключиться к базе данных интербейс
выскакивает unavailable database(в скрине) и лог ошибок
такое чувство что проблема случайным образом вылезает. так как на лабах часть компьютеров работает нормально а часть с unavailable database.

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[407A5D7B]{ibxpress140.bpl} Ib.IBDataBaseError + $2FF
[40788DE3]{ibxpress140.bpl} Ibdatabase.TIBDatabase.DoConnect + $267
[5067F09D]{dbrtl140.bpl} DB.TCustomConnection.SetConnected (Line 3158, "DB.pas" + 8) + $4
[500516EE]{rtl140.bpl  } TypInfo.SetOrdProp (Line 1723, "TypInfo.pas" + 27) + $0
[20DA5FF2]{designide140.bpl} DesignEditors.TPropertyEditor.SetOrdValue (Line 841, "DesignEditors.pas" + 2) + $E
[20DEB0FD]{designide140.bpl} VCLEditors.TBooleanProperty.MouseUp (Line 1838, "VCLEditors.pas" + 5) + $10
[20EBFF05]{vclide140.bpl} PropBox.TCustomPropListBox.ItemMouseUp (Line 1625, "propbox.pas" + 16) + $1B
[20EC00FB]{vclide140.bpl} PropBox.TCustomPropListBox.MouseUp (Line 1690, "propbox.pas" + 1) + $D
[50296810]{vcl140.bpl  } Controls.TControl.DoMouseUp (Line 7306, "Controls.pas" + 2) + $28
[5029688C]{vcl140.bpl  } Controls.TControl.WMLButtonUp (Line 7319, "Controls.pas" + 9) + $6
[20EC5740]{vclide140.bpl} IDEInspListBox.TInspListBox.WMLButtonUp (Line 1615, "IDEInspListBox.pas" + 3) + $4
[50295E70]{vcl140.bpl  } Controls.TControl.WndProc (Line 7062, "Controls.pas" + 91) + $6
[50299FCB]{vcl140.bpl  } Controls.TWinControl.IsControlMouseMsg (Line 9596, "Controls.pas" + 1) + $9
[5029A738]{vcl140.bpl  } Controls.TWinControl.WndProc (Line 9819, "Controls.pas" + 144) + $6
[501F06D4]{vcl140.bpl  } StdCtrls.TCustomListBox.WndProc (Line 6117, "StdCtrls.pas" + 37) + $4
[50299DD8]{vcl140.bpl  } Controls.TWinControl.MainWndProc (Line 9540, "Controls.pas" + 3) + $6
[50076408]{rtl140.bpl  } Classes.StdWndProc (Line 13015, "Classes.pas" + 8) + $0
[502C8775]{vcl140.bpl  } Forms.TApplication.ProcessMessage (Line 9760, "Forms.pas" + 30) + $1
[502C87BA]{vcl140.bpl  } Forms.TApplication.HandleMessage (Line 9790, "Forms.pas" + 1) + $4
[502C8AE5]{vcl140.bpl  } Forms.TApplication.Run (Line 9927, "Forms.pas" + 26) + $3
[004369AE]{bds.exe     } bds.bds (Line 200, "" + 8) + $FFFB

Миниатюры

Unavailable database при подключении БД к IBDatabase
 



0



5 / 5 / 2

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

Сообщений: 200

14.03.2013, 00:28

 [ТС]

2

решил проблему адрес к бд должен иметь вид localhost:c:\dir\data.gdb

Добавлено через 42 секунды
да и вообще кому интересно http://www.ibase.ru/ibfaq.htm#unavail

Добавлено через 3 минуты
Но как сделать чтоб в одной папке с программой?



0



arni

912 / 877 / 62

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

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

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

14.03.2013, 08:33

3

Цитата
Сообщение от evil0o
Посмотреть сообщение

Но как сделать чтоб в одной папке с программой?

а если так?

Код

localhost:data.gdb

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

Delphi
1
'localhost:'+ExtractFilePath(Application.Exename)+'data.gdb'



2



0 / 0 / 0

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

Сообщений: 101

06.04.2013, 17:41

4

Люди помогите! Я не могу подключитца к базе данных, пишетца — unavailabe database. Подскажите пожалуйста, где выставить путь к базе данных? У меня она хранитца вот тут — C:\files\datab\example.gdb



0



9 / 9 / 5

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

Сообщений: 147

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

13.06.2013, 21:26

5

изменил путь на localhost:c:\Users\Rino256\Documents\fb_proj\BDAVTO.FDB. Выдает ошибку connection reject by remote interface . Файрвол я отрубил. Подскажите где еще может быть проблема???



0



912 / 877 / 62

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

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

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

13.06.2013, 22:28

6

algoritm256,

Цитата
Сообщение от kdv

остановите ФБ как сервис
откройте консоль (cmd) с правами администратора
в консоли запустите из папки bin
fbserver -a
разблокируйте его в выпавшем сообщении firewall
если у вас не стандартный брандмауэр windows, сделайте то же самое (разблокируйте) в брандмауэре вашего антивируса.

Добавлено через 1 минуту
Если не поможет:
— ищите на компьютере все библиотеки gds32.dll и fbclient.dll и удаляйте левые;
— приведите последние записи лога firebird.log



0



9 / 9 / 5

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

Сообщений: 147

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

14.06.2013, 13:48

7

Левые библиотеки грохнул, однако ошибка вылетает. Фаерволл вообще отключил, а антивира нет

Вот лог firebird

Код

COMP (Client)	Fri Jun 14 11:24:45 2013
	Guardian starting: "C:\Program Files\Firebird\Firebird_2_5\bin\fbserver.exe"



COMP (Server)	Fri Jun 14 11:25:35 2013
	SERVER/process_packet: connection rejected for RINO256.-1.-1


COMP (Server)	Fri Jun 14 15:45:13 2013
	SERVER/process_packet: connection rejected for RINO256.-1.-1



0



912 / 877 / 62

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

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

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

14.06.2013, 14:21

8

algoritm256,
т.е. пробовали как выше в цитате остановить службу и запустить сервер как приложение?
а можно полностью строку подключения увидеть?



0



9 / 9 / 5

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

Сообщений: 147

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

14.06.2013, 17:56

9

да, я всегда ее запускаю как приложение.

Цитата
Сообщение от arni
Посмотреть сообщение

algoritm256,
а можно полностью строку подключения увидеть?

Простите пожалуйста, я вас не совсем понял. Строка подключения- это там где вводят логин и пароль или в логах что-то такое??



0



9 / 9 / 5

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

Сообщений: 147

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

15.06.2013, 13:52

10

Кажется проблема с коннектом решена: конектился не через FireBird, а через InterBase, но вылетает вот такая ошибка (на скрине). Может я не правильно понял, но походу структура базы не поддерживается или я ошибаюсь??

Миниатюры

Unavailable database при подключении БД к IBDatabase
 



0



912 / 877 / 62

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

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

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

15.06.2013, 15:47

11

да, зоопарк разных серверов: база созданая в одном, не будет открываться совершенно другим.
чтобы понять где-что можно почитать статью Версии ODS.



1



I have a Firebird 2.0 database running on a remote Windows XP PC.
Using the ADO.net connection provider, I configure the connection as follows:

Dim x As New FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder
x.Database = "[hostname]:FileShare:/db/REMOTE_SVR.FDB"
x.UserID = "SYSDBA"
x.Password = "masterkey"

Dim y As New FirebirdSql.Data.FirebirdClient.FbConnection(x.ConnectionString)
y.Open()

Attempting to open the connection raises an FbException, with the message «unavailable database».

Downloading the ODBC drivers and attempting to connect with those settings produces the same error message.

I have copied the database file to my development environment and verified that I can connect to x.Database = "c:\testdb\REMOTE_SVR.FDB" with these settings (with a local install of Firebird 2.0 Server).

I have confirmed that the Firebird 2.0 Server is running on the remote PC. The fileshare in which the DB is located doesn’t require any login or permissions.

I’m probably doing something dumb, but I’m out of ideas.

asked Aug 12, 2016 at 10:41

Frosty840's user avatar

0

Firebird will — by default — not open database files that are located on a network share. The file must be on a physical disk of the server. This is done to protect the database against corruption from incorrect or insufficient locking of the file (eg when accessed by multiple Firebird server processes from different machines).

So you need to move the database to one of the real drives of the machine that hosts the Firebird server process.

answered Aug 12, 2016 at 11:32

Mark Rotteveel's user avatar

Mark RotteveelMark Rotteveel

101k193 gold badges141 silver badges199 bronze badges

9

My answer is not about setup connection using ADO.net, but I still try to answer how to connect to remote FDB from Windows.

  1. In firebird.conf set RemoteFileOpenAbility to 1. This parameter will allow your DBMS connect to DB located in remote folder. Also check that Redirection parameter is set to 0 or is commented with #.

  2. Download PSTools from https://learn.microsoft.com/en-us/sysinternals/downloads/psexec, unpack it.

  3. From PSTools folder via CMD (started as admin) execute psexec -i -s cmd.exe, accept agreement.

  4. In popped-up CMD’s window execute whoami to check that you are now identified as nt authority\system.

  5. In that window execute such command:

net use z: \\123.111.111.111\my_share /persistent:yes, where z is a network drive letter, you want to assign, and 123.111.111.111\my_share is an address of your network share. If the command executed successfully you will see new network drive in the Explorer.

If you got System error 58, try to execute command with specifying user/password in quotes like:

net use z: \\123.111.111.111\my_share /persistent:yes /user:"your username" "your password"

If in the future you will need to disconnect that network drive, perform step 3, then execute net use z: /delete. Or just reboot OS.

  1. Now you can launch your client (ibexpert, dbeaver, etc.) and connect to remote FDB file:
  • Server name: localhost
  • FDB file path: Z:/path_to_FDB/some_db.FDB

answered Mar 11 at 16:42

Kyo's user avatar

qubasesx писал(а):Если в свойстве DatabaseName написать 192.168.0.5:C:\Elektroizolator\BASE.FDB (свой ip и ПОЛНЫЙ (важно) адрес к exe-шнику
то всё чудесным образом начинает работать (проверено на 3-х компьютерах). Идиотизм если задуматься, но работает)))
Little_Roo, благодарю за мысль!

Вообще-то Птица позволяет коннетиться к нерасшаренной базе — чем я у себя в гимназии и пользуюсь — строка коннекта выводится (для директора и завуча) — а пионЭры базочку не…и не видят…. (вот я сволочь какая учительская :shock: )

qubasesx писал(а):Little_Roo писал(а):А может проще, и надежнее, убрать IBConnection и перейти на Zeos ?
А правда будет надёжнее? Я просто думал, что раз компонента до сих пор поставляется в лазаре, то она самая надёжная? Нет?

Насчет того, что до сих пор поставляется….хорошие, простые, понятные, надежные…до поры…жигули….
А вот если Вы хотите озаботиться некоем проектом, да над сетью (где клиентов явно >1), то ip, zeos, …» …и ради бога, не читайте советских газет…»(С)(профессор Преображенский)
В догонку —
при работе с Птицей — на локальной (своей машине) устанавливать ТОЛЬКО коннект TCP/IP
В путях — либо
localhost:{ваш путь к базе}
либо
127.0.0.1:{ваш путь к базе}

Да, совсем забыл, что было мне непонятно —
Ваша база локальная ? Тобишь каждая копия ея располагается на компах, чье число > 1 и редактирование доступно юзеру данного компа и не доступно остальным, или же эта база доступна по сети клиентам, и тогда появляется термин многопользовательский доступ… Или….???

Перейти к содержимому

На днях столкнулся с проблемой, старый builder 6-ой не хотел открывать мою firebird (2.1) базу данных. Я пытался открыть с помощью InterBase и ловил ошибку “unavailable database”.

С помощью утилиты ibexpert база данных открывалась и всё было хорошо.

Решение:

Вобщем файл gds32.dll, который старый builder 6 кладёт в system32 (или SysWow64) является, видимо, старьем, которое не может открыть мою базу данных. Я взял свой gds32.dll и закинул его в syswow64 (или в system32 если у вас х32) и заменил вместо того gds32.dll, теперь всё ок.

Итак, если у вас builder не открывает базу данных firebird fdb и вы получаете ошибку unavailable database, то попробуйте положить свой (если нету, то мой) gds32.dll в папку system32, или syswow64. Я на всякий случай этот файл и в папку bin (builder’а) положил, там где его exe-шник. Зато работает. :-)

Мой gds32.dll

https://yadi.sk/d/koFn01b0gG6jU

Всё работает, ура:

fdb builder

fdb builder

Буду благодарен, если поделитесь:

—>

Понравилась статья? Поделить с друзьями:
  • Ошибка повторения одинакового слова
  • Ошибка подключения к базе данных ms sql
  • Ошибка повара 7 букв сканворд
  • Ошибка подписания недопустимые данные 0x8007000d
  • Ошибка подушки безопасности шкода октавия тур а4