Subject Re: [ib-support] Help. Need to add a foreign key, but "object is in use" error in single-user mode.
Author Paul Reeves
Andrew Guts wrote:
> Hello, IB support.
>
> 1. Database shutdown
> 2. Connect as SYSDBA
> 3. alter table tab2 add Field5 smallint references Table1 (Field1)
> --- Unsuccessful metadata update object TABLE1 is in use -----
> 4. Verify the connections: one user connected (me)
>
> What is wrong? Help me please.
>

There is no such thing as single-user mode. Shutdown only stops
non-SYSDBA attachments. When a database has been shut-down SYSDBA is
still allowed to open an unlimited number of connections. Presumably the
engine is still caching metadata from previous connections, hence the error.

You need to stop the server and then connect as SYSDBA to make this kind
of change.


Paul
--

Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird and InterBase