Nbackup locking database

34 views
Skip to first unread message

Ertan Küçükoglu

unread,
Aug 17, 2025, 7:31:07 PMAug 17
to firebird...@googlegroups.com
Hello,

I am using nbackup as following in a powershell script

&'C:\Program Files\Firebird\Firebird_5_0\nbackup.exe' -B 1 C:\DB\DB.FDB C:\BACKUPDB\db_$hour.nbk -USER SYSDBA -PASS <some_password_here>

When nbackup is active, applications cannot connect to the database.
Is it possible to use the service manager for the same and the database will not be locked to new connection and CRUD operations?
Since usage is slightly different for the manager, I couldn't find the correct command line for testing.

Thanks & Regards,
Ertan

Dimitry Sibiryakov

unread,
Aug 18, 2025, 5:14:43 AMAug 18
to firebird...@googlegroups.com
Ertan Küçükoglu wrote 18.08.2025 1:30:
> When nbackup is active, applications cannot connect to the database.

Let me guess: error message is "database file already used by another
process"? It is because you uses embedded connection.

> Is it possible to use the service manager for the same and the database will not
> be locked to new connection and CRUD operations?

Yes. Utility is named fbsvcmgr but it won't help with exclusive lock in
embedded mode.

--
WBR, SD.

Ertan Küçükoglu

unread,
Aug 18, 2025, 5:27:13 AMAug 18
to firebird...@googlegroups.com

'Dimitry Sibiryakov' via firebird-support <firebird...@googlegroups.com>, 18 Ağu 2025 Pzt, 12:14 tarihinde şunu yazdı:
Ertan Küçükoglu wrote 18.08.2025 1:30:
> When nbackup is active, applications cannot connect to the database.

   Let me guess: error message is "database file already used by another
process"? It is because you uses embedded connection. 

I haven't had the error for a while now. It just happens randomly. But it was something like "cannot create file" if my memory serves me right.


> Is it possible to use the service manager for the same and the database will not
> be locked to new connection and CRUD operations?

   Yes. Utility is named fbsvcmgr but it won't help with exclusive lock in
embedded mode.

Do you mean this the way nbackup works, always locking the database during backup?
I thought the service manager could connect over TCP/IP and not the embedded mode.

Dimitry Sibiryakov

unread,
Aug 18, 2025, 5:30:36 AMAug 18
to firebird...@googlegroups.com
Ertan Küçükoglu wrote 18.08.2025 11:26:
> Do you mean this the way nbackup works, always locking the database during backup?

No, this is the way ANY embedded connection works if mode is "Super".

> I thought the service manager could connect over TCP/IP and not the embedded mode.

Yes, it can connect via TCP/IP as well as nbackup can. But your connection
string make embedded mode preferable. Force TCP with "localhost:C:\DB\DB.FDB".

--
WBR, SD.

Mark Rotteveel

unread,
Aug 18, 2025, 5:43:10 AMAug 18
to firebird...@googlegroups.com
Or given the OP is using Windows, use XNET (xnet://C:\DB\DB.FDB).

Mark
--
Mark Rotteveel

Ertan Küçükoglu

unread,
Aug 18, 2025, 5:44:28 AMAug 18
to firebird...@googlegroups.com
'Dimitry Sibiryakov' via firebird-support <firebird...@googlegroups.com>, 18 Ağu 2025 Pzt, 12:30 tarihinde şunu yazdı:
   Yes, it can connect via TCP/IP as well as nbackup can. But your connection
string make embedded mode preferable. Force TCP with "localhost:C:\DB\DB.FDB".

My full version:
PS C:\BackupDB> &'C:\Program Files\Firebird\Firebird_5_0\nbackup.exe' -Z
Physical Backup Manager version WI-V5.0.3.1683 Firebird 5.0

Using "127.0.0.1:C:\DB\DB.FDB" and I get below error
[
PROBLEM ON "nbackup needs local access to database file".
SQLCODE:-999

Using "localhost:C:\DB\DB.FDB" works and takes a backup.

Is this a known limitation that I need to use domain/alias?

Dimitry Sibiryakov

unread,
Aug 18, 2025, 5:47:58 AMAug 18
to firebird...@googlegroups.com
'Mark Rotteveel' via firebird-support wrote 18.08.2025 11:43:
> Or given the OP is using Windows, use XNET (xnet://C:\DB\DB.FDB).

My memory may fail again, but I heard that nbackup cannot parse URL-style
connection strings.

--
WBR, SD.

Mark Rotteveel

unread,
Aug 18, 2025, 5:52:01 AMAug 18
to firebird...@googlegroups.com

Ertan Küçükoglu

unread,
Aug 18, 2025, 6:06:08 AMAug 18
to firebird...@googlegroups.com
'Mark Rotteveel' via firebird-support <firebird...@googlegroups.com>, 18 Ağu 2025 Pzt, 12:52 tarihinde şunu yazdı:
Yes, I tried it about 4 months ago. Once I figured that I could use the nbackup command line the way I wanted, I stopped checking it.
BTW, nbackup works fine using the "localhost:" prefix and I can use it as long as it fixes the problem.
Reply all
Reply to author
Forward
0 new messages