Subject Re: [ib-support] Lock Table
Author Helen Borrie
At 03:27 PM 10-05-02 +0300, Ibrahim Bulut wrote:
>Hi,
>
>I want to lock a table.
>Which Transaction I Must Use.
>
>Before I start to rebuild database,
>I want to lock all of the tables.
>After rebuild finished, unlock all of the tables.

I'm not sure whether this is two separate questions, or a single question
with confusion about what "locking a table" means...

If you want exclusive access in order to perform metadata changes, then log
in as SYSDBA or the owner of the database, and perform a shutdown using the
gfix utility. To find out how to do this, see the IB 6 documentation for
gfix in the Operations Guide.

>While I am rebuilding, noboy musn't select, insert, update, delete from my
>application or another application.

Once you have exclusive access, nobody else can log in until you terminate
the shutdown.

A warning, though: if you have other users who are already logged in as
SYSDBA or the database owner at the time you set the shutdown, their work
will be allowed to continue. The best bet if this is your case would be to
send everyone to the park for the afternoon and change the locks on the doors.

If you were talking about preventing others from accessing certain tables
during a transaction, you can start a transaction with a RESERVING clause,
and reserve a list of tables for exclusive access.

-- Helen

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________