Refuse connection during restore (IB 5.6)
Do future versions of IB prevent connections during the restore (gbak -r)
process? In 5.6 the following sequence produces serious problems:
1. shut down database (gfix -shut...)
2. back up database (gbak -b...)
3. restore database (gbak -r...)
4. before restore is finished, connect to database (isql...) as non-SYSDBA
user.
First of all, I think it's sloppy that even though the database is shut
down, a non-SYSDBA user can connect. The connection is refused after the
restore is complete, but during the restore process no connections are
refused.
Secondly, allowing a connection at all to a restoring database (whether shut
down or not, whether SYSDBA or not) is rediculous since the db can't be in a
known good state at that time. In fact, the following error message results
when a connection is made during the restore process:
gbak: cannot commit index RDB$FOREIGN10
gbak: ERROR: unsuccessful metadata update
gbak: ERROR: object <tablename> is in use
gbak: ERROR: action cancelled by trigger (3) to preserve data integrity
gbak: ERROR: Cannot deactivate primary index
gbak: Exiting before completion due to errors
This has the net effect of making foreign key constraints (which are really
indexes) inactive. Unfortunately a metadata extraction does not indicate
whether constraints (indexes) are active or not. Obviously using the
database at this point is problematic because there is no referential
integrity.
What I'm asking for is this:
1. Denial of any connection by any user during the restore process.
2. Report on state of indexes in metadata extraction (active or inactive).
3. Exclusive lock on *.gdb file while in use to prevent copying (and
corrupting). (I know this doesn't relate to this posting, but I've
mentioned it in previous posts and thought I'd put another plug in for it).
Are any of these features implemented or planned for implementation in IB 6
or 7?
thanks,
Paul J. Mills