[firebird-support] GBAK - validation error for column X, value "*** null ***"

2015-05-14 Thread Josef Kokeš j.ko...@apatykaservis.cz [firebird-support]
Hi!

What would be a proper way of dealing with GBAK restore error 
'validation error for column X, value "*** null ***"'? This error 
appears in one table, where X is the primary key. The database is 
Firebird 2.5.4 in the superserver mode.

1) How do I properly restore this backup? Neither -INACTIVE nor 
-NO_VALIDITY (nor both at the same time) help, the restore stops as soon 
as the first error is encountered. -ONE_AT_A_TIME gets me to the end of 
table data, but then I get another error at the "restoring privilege for 
user Y" "action cancelled by trigger (3) to preserve data integrity" 
"table/procedure has non-SQL security class defined".

2) Why doesn't GBAK complain during backup? I would expect that if a 
backup is successfully made, I will be able to restore it.

Thanks,

Josef


Re: [firebird-support] GBAK - validation error for column X, value "*** null ***"

2015-05-15 Thread Alexey Kovyazin a...@ib-aid.com [firebird-support]

Hi Josef,

Such error is the consequence of the corruption - in the original 
database there was a NULL in the field (most likely, all fields in that 
record are NULL).

gbak does not check constraints when reading.

The best way to fix it is to find record with NULLs in the original 
database and delete it, then repeat backup/restore.

If you don't have original records, it can be a problem.
Try to restore database till the privileges error and then pump data 
from partially restored database to the new empty database with the same 
structure - you can use free tool IBDataPump for it.
If problems continue, you can export data using our proprietary 
IBBackupSurgeon tool (http://ib-aid.com/en/ibbackupsurgeon/), which can 
export data on low-level.


Regards,
Alexey Kovyazin
IBSurgeon




Hi!

What would be a proper way of dealing with GBAK restore error
'validation error for column X, value "*** null ***"'? This error
appears in one table, where X is the primary key. The database is
Firebird 2.5.4 in the superserver mode.

1) How do I properly restore this backup? Neither -INACTIVE nor
-NO_VALIDITY (nor both at the same time) help, the restore stops as soon
as the first error is encountered. -ONE_AT_A_TIME gets me to the end of
table data, but then I get another error at the "restoring privilege for
user Y" "action cancelled by trigger (3) to preserve data integrity"
"table/procedure has non-SQL security class defined".

2) Why doesn't GBAK complain during backup? I would expect that if a
backup is successfully made, I will be able to restore it.

Thanks,

Josef






Re: [firebird-support] GBAK - validation error for column X, value "*** null ***"

2015-05-15 Thread Josef Kokeš j.ko...@apatykaservis.cz [firebird-support]
Hi!

Thanks for the answer. Luckily, I still have the FDB file, so I can get 
rid of the bad records easily. What has me concerned is, what if I only 
had the backup? Your trick with pumping seems plausible, I will have to 
give it a try. IBBackupSurgeon looks promising, too.

Josef

On 15.5.2015 9:14, Alexey Kovyazin a...@ib-aid.com [firebird-support] wrote:
>
> Hi Josef,
>
> Such error is the consequence of the corruption - in the original 
> database there was a NULL in the field (most likely, all fields in 
> that record are NULL).
> gbak does not check constraints when reading.
>
> The best way to fix it is to find record with NULLs in the original 
> database and delete it, then repeat backup/restore.
> If you don't have original records, it can be a problem.
> Try to restore database till the privileges error and then pump data 
> from partially restored database to the new empty database with the 
> same structure - you can use free tool IBDataPump for it.
> If problems continue, you can export data using our proprietary 
> IBBackupSurgeon tool (http://ib-aid.com/en/ibbackupsurgeon/), which 
> can export data on low-level.
>
> Regards,
> Alexey Kovyazin
> IBSurgeon



Re: [firebird-support] GBAK - validation error for column X, value "*** null ***"

2015-05-23 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
If you only have a backup and the backup is corrupted then  very bad
news.

The best politic is always to do a backup/restore cycle inmediatly. So, if
an error is detected when the backup is being restored you can take actions
at that right moment.

If your operating system is Windows, you can open a command window and
write:

*GBAK -b -user SYSDBA -password masterkey MyDataBase.FDB stdout | GBAK
-user SYSDBA -password masterkey -r stdin MyRestoredDatabase.FDB*

Any error will be inmediatly detected.

And, if you can read Spanish, the following page has more info about this
subject:

https://firebird21.wordpress.com/2013/03/05/backup-y-restauracion-al-mismo-tiempo/

Greetings.

Walter.


On Fri, May 15, 2015 at 4:41 AM, Josef Kokeš j.ko...@apatykaservis.cz
[firebird-support]  wrote:

>
>
> Hi!
>
> Thanks for the answer. Luckily, I still have the FDB file, so I can get
> rid of the bad records easily. What has me concerned is, what if I only
> had the backup? Your trick with pumping seems plausible, I will have to
> give it a try. IBBackupSurgeon looks promising, too.
>
> Josef
>
> On 15.5.2015 9:14, Alexey Kovyazin a...@ib-aid.com [firebird-support] wrote:
> >
> > Hi Josef,
> >
> > Such error is the consequence of the corruption - in the original
> > database there was a NULL in the field (most likely, all fields in
> > that record are NULL).
> > gbak does not check constraints when reading.
> >
> > The best way to fix it is to find record with NULLs in the original
> > database and delete it, then repeat backup/restore.
> > If you don't have original records, it can be a problem.
> > Try to restore database till the privileges error and then pump data
> > from partially restored database to the new empty database with the
> > same structure - you can use free tool IBDataPump for it.
> > If problems continue, you can export data using our proprietary
> > IBBackupSurgeon tool (http://ib-aid.com/en/ibbackupsurgeon/), which
> > can export data on low-level.
> >
> > Regards,
> > Alexey Kovyazin
> > IBSurgeon
>
>  
>