Commands to stop databases

The STOP DATABASE command has several options that you can use to control how the database stops.

Begin general-use programming interface information.The following examples illustrate ways to use the STOP DATABASE command:

-STOP DATABASE (*)
Stops all databases for which you have STOPDB authorization, except the Db2 directory (DSNDB01), the Db2 catalog (DSNDB06), or the Db2 work file database (called DSNDB07, except in a data sharing environment), all of which must be stopped explicitly.
-STOP DATABASE (dbname)
Stops a database and closes all of the data sets of the table spaces and index spaces in the database.
-STOP DATABASE (dbname, ...)
Stops the named databases and closes all of the table spaces and index spaces in the databases. If DSNDB01 is named in the database list, it should be last on the list because stopping the other databases requires that DSNDB01 be available.
-STOP DATABASE (dbname) SPACENAM (*)
Stops and closes all of the data sets of the table spaces and index spaces in the database. The status of the named database does not change.
-STOP DATABASE (dbname) SPACENAM (space-name, ...)
Stops and closes the data sets of the named table space or index space. The status of the named database does not change.
-STOP DATABASE (dbname) SPACENAM (space-name, ...) PART (integer)
Stops and closes the specified partition of the named table space or index space. The status of the named database does not change. If the named index space is nonpartitioned, Db2 cannot close the specified logical partition.

The data sets containing a table space are closed and deallocated by the preceding commands.End general-use programming interface information.