Subject Re: Firebird restoration problem
Author Adam
--- In firebird-support@yahoogroups.com, "robertgilland"
<robert_gilland@...> wrote:
>
> We have a database that will not restore.
>
> We have the GDB which we back up to a GBK then when trying to
restore
> the database we get the below error.
>
>
> gbak: restoring index RDB$PRIMARY270
> attempt to store duplicate value (visible to active transactions)
in
> unique index "RDB$PRIMARY252"
>
> How can we initially identify the problem.
> We would like our system to automatically fix itself up.
> Has anyone ever done this?
>
> Regards,
>
> Robert.
>

Lookup the table to which the index refers to.

Make sure no-one else is connected.

SELECT *
FROM MYTABLE A
JOIN MYTABLE B ON (A.ID+0 = B.ID+0 AND A.RDB$DB_KEY <> B.RDB$DB_KEY)

This will tell you the records that are duplicated. Delete one of
them, or give it a unique PK value.

Adam