Search code examples
backupfirebirdlocked

Firebird nbackup: CreateFile (open) problem when there are active connections


I/O error during "CreateFile (open)" operation for file: ...
The process cannot access the file 'file path' because it is being used by another process
SQLCODE:-902

I got this when I try to make backup of my DB.

The problem is when my app is connected to Firebird DB, when all connections are killed, it works fine.

Why is my Firebird server locking the file? I want to make backups when people are working.


Solution

  • Firebird server is locking database file if configured to work in "superserver" mode. This prevent any other instance of Firebird engine, including embedded ones, from access to the file.

    You must use remote connection string for nbackup to let it connect the database using already run Firebird server instance instead of using embedded mode.