How to unlock nbackup lock without reverting the database

45 views
Skip to first unread message

ryousuke hayami

unread,
Jun 4, 2026, 5:30:22 AM (9 days ago) Jun 4
to firebird-support

Hello,

I am using Firebird 5. I have an fdb file that was locked with nbackup, and I also have the delta file. After the lock, I performed some maintenance on the tables, and the number of tables has changed.

When I run nbackup -f <FDB Path>, the FDB is restored to the state before the lock. Is there any way to release the lock while keeping the current state of the tables?

Regards,

Hayami

Pavel Cisar

unread,
Jun 4, 2026, 5:37:40 AM (9 days ago) Jun 4
to firebird...@googlegroups.com
Hi,

"Locking" the database means that all changes (to db pages) are
redirected from main database file(s) to delta file. "Unlocking" means
that content of the delta file is applied back to main database file(s).

So, in your case, all maintenance operations you performed were written
into delta file, and unlocking it will just merge your changes into main
database file. You will not lose anything (database is NOT reverted to
state before lock).

best regards
Pavel Cisar
IBPhoenix

Dne 04. 06. 26 v 11:30 ryousuke hayami napsal(a):

Mark Rotteveel

unread,
Jun 4, 2026, 5:47:13 AM (9 days ago) Jun 4
to firebird...@googlegroups.com
The use of nbackup -f doesn't unlock and merge the delta, it's the fixup
operation, which will unlock the database *without* merging (e.g. it's
for use after restoring a backup, or after a file copy where you do not
have the delta file). In other words, you explicitly asked nbackup to
ignore the delta (i.e. threw away the changes since the lock).

You need to unlock the database with nbackup -UN (short for -unlock).

See also
https://firebirdsql.org/file/documentation/html/en/firebirddocs/nbackup/firebird-nbackup.html#nbackup-lock-unlock

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Jun 4, 2026, 5:48:40 AM (9 days ago) Jun 4
to firebird...@googlegroups.com
On 04-06-2026 11:37, Pavel Cisar wrote:
> Hi,
>
> "Locking" the database means that all changes (to db pages) are
> redirected from main database file(s) to delta file. "Unlocking" means
> that content of the delta file is applied back to main database file(s).
>
> So, in your case, all maintenance operations you performed were written
> into delta file, and unlocking it will just merge your changes into main
> database file. You will not lose anything (database is NOT reverted to
> state before lock).


No, it isn't merging the delta, because the OP used nbackup -f (fixup),
not nbackup -un (unlock). So, the database *is* reverted to the state
before lock.

Mark
--
Mark Rotteveel

Pavel Cisar

unread,
Jun 4, 2026, 7:12:19 AM (9 days ago) Jun 4
to firebird...@googlegroups.com
Hi Mark,

You are certainly right about the -f switch. I didn't noticed it at
first as it didn't occurred to me that someone would confuse these two.
The nbackup guide
(https://www.firebirdsql.org/file/documentation/html/en/firebirddocs/nbackup/firebird-nbackup.html#nbackup-functions-params)
is quite clear about their difference.

best regards
Pavel Cisar
IBPhoenix

Dne 04. 06. 26 v 11:48 'Mark Rotteveel' via firebird-support napsal(a):

Mark Rotteveel

unread,
Jun 4, 2026, 7:16:28 AM (9 days ago) Jun 4
to firebird...@googlegroups.com
On 04-06-2026 13:12, Pavel Cisar wrote:
> Hi Mark,
>
> You are certainly right about the -f switch. I didn't noticed it at
> first as it didn't occurred to me that someone would confuse these two.
> The nbackup guide (https://www.firebirdsql.org/file/documentation/html/
> en/firebirddocs/nbackup/firebird-nbackup.html#nbackup-functions-params)
> is quite clear about their difference.


I found the wording a bit fuzzy (or easy to miss to implications), so I
have pushed an update to make it more explicit. I'm not sure if you
already see it, as we have pretty aggressive caching for docs, and
visibility could depend to which CloudFlare POP your requests is routed.

Mark
--
Mark Rotteveel

ryousuke hayami

unread,
Jun 4, 2026, 8:12:54 PM (8 days ago) Jun 4
to firebird-support
Thank you.

I tried running -un to apply the *.delta file, but it resulted in an error.
Is it not possible to apply changes to table definitions?

nbackup -u SYSDBA -p <pass> -un <database>

[
PROBLEM ON "end backup".
unsuccessful metadata update
-ALTER DATABASE failed
-no permission for ALTER access to DATABASE
SQLCODE:-607
]

ryousuke hayami

unread,
Jun 5, 2026, 6:21:57 AM (8 days ago) Jun 5
to firebird-support
Hi,

> nbackup -u SYSDBA -p <pass> -un <database>

Even though it kept throwing errors before, at some point it suddenly started working. I have no idea why, but I’ll just accept it as it is.

regards,
hayami

2026年6月5日金曜日 9:12:54 UTC+9 ryousuke hayami:
Reply all
Reply to author
Forward
0 new messages