FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.25k stars 215 forks source link

Can't do nbackup level 1 due to restrictions. RDB$BACKUP_HISTORY has reached maximum level: -1 #7471

Closed jonesarruda closed 1 year ago

jonesarruda commented 1 year ago

Good afternoon gentlemen, I have the following error when trying to backup at the NB1 level, is there a problem with History, can anyone help me?

Error: Can't do nbackup level 1 due to restrictions. RDB$BACKUP_HISTORY has reached maximum level: -1

hvlad commented 1 year ago

Please specify Firebird version and nbackup command line used. Also it is interesting to look at database header stats (gstat -h) and contents of some most recent records of RDB$BACKUP_HISTORY, say SELECT * FROM RDB$BACKUP_HISTORY ORDER BY RDB$TIMESTAMP DESC ROWS 5

jonesarruda commented 1 year ago

HQbird 2022 Last update 13-DEC-2022. I'm not running the command line, I'm doing the process through the HQbird start NB1 panel itself. The NB0 normally starts backing up the level, only the NB1 has this problem causing the error I sent in the title of the question.

hvlad commented 1 year ago

Please, ask HQBird support. The error message is not from Firebird itself.

SENikitin commented 1 year ago

Before nbackup level X, The dataguard engine (part of HQBird) check if previous backup level X-1 was done. It check the value returned bv query select first 1 RDB$BACKUP_LEVEL from RDB$BACKUP_HISTORY as r order by RDB$BACKUP_ID desc if RDB$BACKUP_HISTORY is empty or any error occured (please, inspect also dataguard log for details) then check function return -1. So, the first that need to be checked is data inside RDB$BACKUP_HISTORY. There was numeric overflow in earlier version of Firebird in that field. Or RDB$BACKUP_HISTORY may be empty (after database has been restored), but HQBird tries to perform top level backup on schedulle... Anyway you have to contact HQBird support team for detailed instruction.