Subject Re: [firebird-support] Re: Accessing Database in External HDD
Author Helen Borrie
>--- In, "Mustafa ÂȘimÂșek"
><mussimsek@...> wrote:
>> Hi,
>> One of my customer buy an external lacie HDD with ethernet. He plud
>> this device his local network with adsl modem. He can access Hdd over
>> Tcp/ip and he can use this device mapping drive Z from windows.
>> We use firevbird 2.0. He want to transfer fdb file this external drive
>> and use from this external hdd. But firebird doesn't access this
>> database in external HDD. i try these connection strings:
>> "z:\data\test.fdb"
>> "\data\test.fdb"
>> "\data\test.fdb" (customer ip)
>> "\data\test.fdb" (external Hdd ip)
>> we receive "unavaible database" error.

At 09:10 AM 9/06/2008, Adam wrote:

>You can't do this.
>A database must physically reside on the SAME hardware as the engine.
>The locks used by the engine to protect itself against corruption do
>not work reliably on a network drive.

Actually, Adam, while that's almost correct for the way the OP has it set up, but that's not the whole of the answer. I am attaching to databases on external eSATA and USB-connected IDE drives without problems...although there are good reasons NOT to do this in a production environment.

The problem here is not that the drive is external, but that it is wired abd configured as a network storage device AND the OP is trying to connect to a MAPPED device. And, on Windows, enabling RemoteFileOpenAbility parameter won't override the inbuilt protection against connecting to non-local storage. (It allows NFS locations to be accessed on POSIX but it is highly NOT RECOMMENDED unless the database is a read-only database!)

The IP address in a Firebird connection is (and can only be) the IP address of the Firebird server.

>> How can i connect? is there require any settings on adsl modem?

Forget the modem - take the Ethernet cable off the drive, roll it up and put it away in a drawer. If it is possible to connect your external drive's data interface (SATA, IDE) *physically* to the host machine that is running the Firebird server then this is what you need to do:

First, delete all references in the network to any mappings or shares that exist for the drive. It should not be available anywhere on the network as a shared device.

Now, do whatever you need to do to mount the external drive on the Firebird host machine. (That depends on Windows versions, drivers, interfaces, power supply, etc., etc.)

Once it is established, go into the Windows disk management tool and assign an unused drive designator to it, if Windows has not already done it. (You can modify the automatic assignment to be Z if you like; from drive D onward, Windows just does its automatic assignments in alphabetical order, and it doesn't care if there are gaps). For external drives, I use the letters near the end of the alphabet and I also assign distinctive volume labels, like LA_CIE_SATA1.

Exit from the drive management tool and use the normal filesystem navigation facilities to view the filesystem on the external drive. Because it is a local device that just happens to be physically located outside the case, it should look in every way like an internal hard drive (just as a USB stick or a digital camera can attach to a database on a SD card in your camera if you want to be really original!).

Now, why did I say "there are good reasons NOT to do this in a production environment"? Well, at least in my environment, my external drives - whether SATA or USB - need external power to get spinning and keep spinning. The 7200 rpm eSATA drives are fast enough; the USB drives are *horribly* slow. So - at least from my experience - the external drive needs to be SATA driven AND on an external power supply that is UPS-protected, to be considered both useful and reliable. I have not tested the performance on a real, multi-user site so, at a minimum, one would want to thrash it hard under trial conditions before regarding it as more than a theoretical option.