Subject | Fixing corrupted indexes without restoring |
---|---|
Author | Maya Opperman |
Post date | 2010-06-09T16:10:38Z |
Ann wrote:
I just want to double check that the following is safe to do, and won't
result in users being able to post duplicate keys, if something goes
wrong with reactivating an index for some odd reason:
(For Firebird 1.5)
SET TERM !! ;
EXECUTE BLOCK AS
DECLARE VARIABLE stmt VARCHAR(1000);
BEGIN
for select 'ALTER INDEX '||rdb$index_name ||' ACTIVE;'
from rdb$indices
into :stmt
do EXECUTE STATEMENT :stmt;
for select 'ALTER INDEX '||rdb$index_name ||' ACTIVE;'
from rdb$indices
into :stmt
do EXECUTE STATEMENT :stmt;
END!!
SET TERM ; !!
>... And yes, deactivating and reactivating will fix all of those.Horray, wonderful news!
> ... Ifjust
> you think your indexes are causing problems as they age, you could
> rebuild some of them each night rather than doing a full restore ofOK I've been reading up on online FAQ's and Helen's brilliant book, but
> the database.
> Deactivate and reactivate will do it.
I just want to double check that the following is safe to do, and won't
result in users being able to post duplicate keys, if something goes
wrong with reactivating an index for some odd reason:
(For Firebird 1.5)
SET TERM !! ;
EXECUTE BLOCK AS
DECLARE VARIABLE stmt VARCHAR(1000);
BEGIN
for select 'ALTER INDEX '||rdb$index_name ||' ACTIVE;'
from rdb$indices
into :stmt
do EXECUTE STATEMENT :stmt;
for select 'ALTER INDEX '||rdb$index_name ||' ACTIVE;'
from rdb$indices
into :stmt
do EXECUTE STATEMENT :stmt;
END!!
SET TERM ; !!