Stops the specified database.
Scope
In an MPP system, this API deactivates the specified database on all nodes in the system. If one or more of these nodes encounters an error, a warning is returned. The database will be successfully deactivated on some nodes, but may remain activated on the nodes encountering the error.
Note: | If it is the coordinator node or the catalog node that encounters the error, the API returns a negative sqlcode, and the database will not be reactivated on any node on which it was deactivated. |
Authorization
One of the following:
Required Connection
None. Applications invoking DEACTIVATE DATABASE cannot have any existing database connections.
Version
sqlenv.h
C API Syntax
/* File: sqlenv.h */ /* API: Deactivate Database */ /* ... */ SQL_API_RC SQL_API_FN sqle_deactivate_db ( char * pDbAlias, char * pUserName, char * pPassword, void * pReserved, struct sqlca * pSqlca); /* ... */ |
Generic API Syntax
/* File: sqlenv.h */ /* API: Deactivate Database */ /* ... */ SQL_API_RC SQL_API_FN sqlg_deactivate_db ( unsigned short DbAliasLen, unsigned short UserNameLen, unsigned short PasswordLen, char * pDbAlias, char * pUserName, char * pPassword, void * pReserved, struct sqlca * pSqlca); /* ... */ |
API Parameters
REXX API Syntax
This API can be called from REXX through the SQLDB2 interface. See How the API Descriptions are Organized, or the Application Development Guide. For a description of the syntax, see the Command Reference.
Usage Notes
Databases initialized by ACTIVATE DATABASE can only be shut down by DEACTIVATE DATABASE. sqlepstp - Stop Database Manager automatically stops all activated databases before stopping the database manager. If a database was initialized by ACTIVATE DATABASE, the last DB2 CONNECT RESET statement (counter equal 0) will not shut down the database; DEACTIVATE DATABASE must be used.
See Also
sqle_activate_db - Activate Database.