Way to ensure just one connection to a DB2 database
The easiest way to do this would be to simply uncatalog and then re-catalog the database with a different name (perform this as the instance owner on the database server):


db2 uncatalog database SAMPLE
db2 catalog database SAMPLE as XXX on &lt;path&gt;

... perform maintenance activities ...
db2 uncatalog database XXX
db2 catalog database SAMPLE on &lt;path&gt;


Any user trying to connect locally on the database server, using connect to sample, will get the error:

SQL1013N  The database alias name or database name "SAMPLE" could not be found.  SQLSTATE=42705


However, for remote connections to also be unable to connect, you'll have to restart the DB2 instance.  This is required because the DB2 TCP Connection Manager (db2tcpcm) will cache the the database catalog entries, so until the EDU is restarted it will still "know" about the database.  After restarting the DB2 instance, remote connections will get the error:

SQL30061N  The database alias or database name "SAMPLE            " was not 
found at the remote node.  SQLSTATE=08004


Having to restart the instance isn't the best solution, but it works.