nbackup Problems glad for any help

37 views
Skip to first unread message

Winfried Bernartz

unread,
Aug 4, 2022, 8:12:48 AMAug 4
to firebird-support
Hi, i try to backup a fdb with nbackup.exe

what i tried to do:

nbackup.exe  -L   test.fdb  -user Testuser -pass Testpass
Problem on "begin bakcup".
unsuccessful metadata update
-Alter database failed
-Database already in the physical backup mode
SQLCDE: -607

copy test.fdb  testback.fdb

nbackup.exe -UN test.fdb
Problem on "attach database".
I/O Error during "createfile (open)" operation for file "test.fdb
-Error while trying to open file
-Der Prozesskann nicht auf die Datei zugreifen, d sie von einer anderen Prozess verwendet wird.
SQLCode: -902

So what can or must i do to resolve that problem?
Thanks a lot for any help    Werner

Mark Rotteveel

unread,
Aug 4, 2022, 8:19:28 AMAug 4
to firebird...@googlegroups.com
The option -UN doesn't exist. -U is expected to be followed by a user
name, and unlocking a database is -N <database>, so try:

nbackup.exe -U Testuser -N test.fdb

However, the error suggests that the database is already in use (e.g. by
the Firebird server process). As an alternative, connect to the database
with ISQL (or another query tool) and execute ALTER DATABASE END BACKUP

Mark
--
Mark Rotteveel

Vlad Khorsun

unread,
Aug 4, 2022, 8:39:37 AMAug 4
to firebird-support
On Thursday, 4 August 2022 at 15:12:48 UTC+3 winfried... wrote:
Hi, i try to backup a fdb with nbackup.exe

what i tried to do:

nbackup.exe  -L   test.fdb  -user Testuser -pass Testpass
Problem on "begin bakcup".
unsuccessful metadata update
-Alter database failed
-Database already in the physical backup mode
SQLCDE: -607
 

copy test.fdb  testback.fdb

nbackup.exe -UN test.fdb
Problem on "attach database".
I/O Error during "createfile (open)" operation for file "test.fdb
-Error while trying to open file
-Der Prozesskann nicht auf die Datei zugreifen, d sie von einer anderen Prozess verwendet wird.
SQLCode: -902

The error message above in english is:
-The process cannot access the file because it is being used by another process.

Avoid use of non-english messages, please.

Looks like test.fdb is opened by non Firebird process or you have a problem with local (XNET) access.
 

So what can or must i do to resolve that problem?
 
  Try
isql xnet://test.fdb

if it fails, try

isql inet://test.fdb .

On success, run in isql 

ALTER DATABASE END BACKUP;

Good luck,
Vlad

PS always show Firebird version and OS you use. Above I assume you uses fb3 or fb4 on Windows

Vlad Khorsun

unread,
Aug 4, 2022, 8:42:13 AMAug 4
to firebird-support
 
> nbackup.exe -UN test.fdb
> Problem on "attach database".
> I/O Error during "createfile (open)" operation for file "test.fdb
> -Error while trying to open file
> -Der Prozesskann nicht auf die Datei zugreifen, d sie von einer anderen
> Prozess verwendet wird.
> SQLCode: -902
>
> So what can or must i do to resolve that problem?

The option -UN doesn't exist.

  Since fb3, -UNLOCK is shortened to -UN, not -N as it was before.

Regards,
Vlad

Mark Rotteveel

unread,
Aug 4, 2022, 8:50:13 AMAug 4
to firebird...@googlegroups.com
This doesn't seem to have been documented in the Firebird 3.0 release
notes, nor has it been updated in the documentation
(https://www.firebirdsql.org/file/documentation/html/en/firebirddocs/nbackup/firebird-nbackup.html).

In fact, Firebird 4.0 release notes still reference -N as such, see
https://www.firebirdsql.org/file/documentation/release_notes/html/en/4_0/rlsnotes40.html#rnfb40-replication-setup-replica-create

Mark
--
Mark Rotteveel

Vlad Khorsun

unread,
Aug 4, 2022, 9:05:30 AMAug 4
to firebird-support
  It was done as part of  CORE-2541 

  Actually, since than both -N and -UN can be used to unlock database, and nbackup say it explicitly:

Usage: nbackup <options>
exclusive options are:
  -L(OCK) <database>                     Lock database for filesystem copy
  -UN(LOCK) <database>                   Unlock previously locked database
...
Notes:
  <database> may specify database alias.
  Incremental backups of multi-file databases are not supported yet.
  "stdout" may be used as a value of <filename> for -B option.
  Option -S(IZE) only is valid together with -L(OCK).
  For historical reasons, -N is equivalent to -UN(LOCK)
  and -T is equivalent to -NOD(BTRIGGERS).

Regards,
Vlad

Winfried Bernartz

unread,
Aug 5, 2022, 6:12:33 AMAug 5
to firebird-support
So just thanks a lot for many of you trying to help me!

I just try to detail it:

First problem:

nbackup.exe  -L   test.fdb  -user Testuser -pass Testpass
Problem on "begin backup".
unsuccessful metadata update
-Alter database failed
-Database already in the physical backup mode
SQLCDE: -607

So that looks like  fdb   wasnt unlocked before

Now i think my frist try shoulb be to unlock the fdb:

nbackup.exe -UN test.fdb
Problem on "attach database".
I/O Error during "createfile (open)" operation for file "test.fdb
-Error while trying to open file
-The process cannot access the file because it is being used by another process.
SQLCode: -902

But now i cant understand this, because  just before firebird says  fdb is already in backup mode?
But if it is in the backup mode, how can it be used by another process? In this case firebird uses the test.fdb.delta and not the fdb and waits for the unlock to join the delta and the fdb  or am i completely wrong?

Would be really great if somebody has an additional hint for me

Thanks a lot in advance
Werner

Mark Rotteveel

unread,
Aug 5, 2022, 6:27:46 AMAug 5
to firebird...@googlegroups.com
On 05-08-2022 12:12, Winfried Bernartz wrote:
> So just thanks a lot for many of you trying to help me!
>
> I just try to detail it:
>
> First problem:
>
> nbackup.exe  -L   test.fdb  -user Testuser -pass Testpass
> Problem on "begin backup".
> unsuccessful metadata update
> -Alter database failed
> *-Database already in the physical backup mode*
> SQLCDE: -607
>
> So that looks like  fdb   wasnt unlocked before
>
> Now i think my frist try shoulb be to unlock the fdb:
>
> nbackup.exe -UN test.fdb
> Problem on "attach database".
> I/O Error during "createfile (open)" operation for file "test.fdb
> -Error while trying to open file
> *-The process cannot access the file because it is being used by another
> process.*
> SQLCode: -902
>
> But now i cant understand this, because  just before firebird says  fdb
> is already in backup mode?
> But if it is in the backup mode, how can it be used by another process?
> In this case firebird uses the test.fdb.delta and not the fdb and waits
> for the unlock to join the delta and the fdb  or am i completely wrong?
>
> Would be really great if somebody has an additional hint for me

Have you tried connecting to the database with ISQL and executing ALTER
DATABASE END BACKUP, as I suggested in one of my earlier replies?

Also, I'm not sure why you locked the database, but if you did it so
some external program could backup the database, it is possible it still
has a file handle open to the database.

Otherwise, you need to use a tool suitable for your OS to find out which
process has a file handle open.

E.g. for Linux:
https://superuser.com/questions/97844/how-can-i-determine-what-process-has-a-file-open-in-linux

For Windows:
https://serverfault.com/questions/1966/how-do-you-find-what-process-is-holding-a-file-open-in-windows

Mark
--
Mark Rotteveel

Winfried Bernartz

unread,
Aug 8, 2022, 3:35:21 AMAug 8
to firebird-support
So  once again many many thnaks for your help to everybody!

In conclusion it was a problem with the lack of user permittion to the db

so the only process was firebird server itself. And that there was still a firebird db with "delta". So i realized that first  i have to use the command
nbackup.exe -UN test.fdb   -user Testuser -pass Testpass      

Then the delta fdb disappered and now 
nbackup.exe  -L   test.fdb  -user Testuser -pass Testpass
copy test.fdb  testback.fdb
nbackup.exe -UN test.fdb -user Testuser -pass Testpass

works fine!

So great community here, thanks again

Werner
Reply all
Reply to author
Forward
0 new messages