Subject | Re: [firebird-support] attempt to store duplicate value in unique index "RDB$INDEX_2" |
---|---|
Author | Helen Borrie |
Post date | 2008-02-18T01:34:45Z |
At 10:06 AM 18/02/2008, you wrote:
select
rdb$relation_name,
rdb$field_name
from rdb$relation_fields
where rdb$field_source = 'RDB$285'
and try to extract the actual definition of those columns.
Tip: The browser in IB_SQL will help you find this easily. Check the "System Inf." and "Domain Inf." boxes and inspect the Source tab.
What turns up will determine how you fix. Any differences will lead to clues about what was hacked and how it can be unhacked. Can't recommend one thing or another at this point...
./heLen
>Using Firebird 2.0.3 restore of a databseRDB$INDEX_2 is the unique index on RDB$FIELDS.RDB$FIELD_NAME. This field is either the name of a user-created domain or a system-generated name for a domain created for a column you defined somewhere without a domain. In this case it looks like the latter.
>that was backed up in Firebird 1.5 I get
>thte following:
>
>gbak:restoring domain RDB$284
>gbak:restoring domain RDB$285
>ERROR: attempt to store duplicate value (visible to active
>transactions) in unique index "RDB$INDEX_2"
>How can this happenUsually by someone poking stuff directly into the system tables as a hack for some mistake, without a mind to the dependencies. It might also have occurred as a result of some bad DDL script being allowed to run through to the end regardless of errors en route...needle-in-haystack stuff.
> and how can we fix it?Forensics. Track back in the original database in to find out what fields in the database are using that domain:
select
rdb$relation_name,
rdb$field_name
from rdb$relation_fields
where rdb$field_source = 'RDB$285'
and try to extract the actual definition of those columns.
Tip: The browser in IB_SQL will help you find this easily. Check the "System Inf." and "Domain Inf." boxes and inspect the Source tab.
What turns up will determine how you fix. Any differences will lead to clues about what was hacked and how it can be unhacked. Can't recommend one thing or another at this point...
> ( P.S. This is really important I have posted a messageWell, it's not exactly *normal* and there's not much to go on...you haven't mentioned, for example, whether you tried gfix -validate and got anything meaningful from it.
> about this 2 weeks ago and got no responce )
./heLen