How to open the database in exclusive mode?
To use the database in exclusive mode, you first need to shutdown the database (using gfix or some other tool). Firebird 2.0 offers various shutdown modes (single-user, single-connection, multiple connection, etc.) as explained in Firebird 2 release notes.
Nice way of doing it would be to gracefully disconnect all users, use gfix to bring the database into single-user mode (using -shutdown switch) and then connect as SYSDBA or owner. This new connection would have exclusive access to the database. If you cannot disconnect the users gracefully, you can force the disconnection using -force parameter to gfix.
For example, to shutdown all connections and only allow a single connection to a database, you would use a command like this:
gfix -shut single -force 0 database.fdb
To allow multiple connections from a SYSDBA/owner of the database, use the multi option:
gfix -shut multi -force 0 database.fdb
Note that you cannot go from single to multi mode using -shut parameter. The -shut parameter can only be used to increase the constraints. To reduce the constraints, you need to use the -online switch. For example, to go from single to multi mode, use:
gfix -online multi database.fdb
To bring the database fully online, just use the -online switch without any parameters:
gfix -online database.fdb
When bringing database online from single-user mode, you first need to disconnect the exclusive connection, because gfix cannot access the database, since it is treated as a second connection in this case.