DB/2 LUW – Stopping DB2 Subsystem ( On MS Windows )

Background

On MS Windows, the first databases were simple database files such as DBase, Clipper, Paradox, Foxpro, Access, etc.

With the advent of the Client Servers architecture,  databases that started in the Unix area started moving down stream.

Prudent

It is prudent to take time and better understand how each database management system prefers to be shut-down.

In this exercise we will start tackling IBM’s DB2 LUW on MS Windows.

Outline

  1. List Db2 Instances
    • db2ilist
  2. List / Set Environment Variable
    • set db2
  3. List Connected Applications
    • CLI
      • db2 list applications
    • metadata
      • SYSIBMADM.APPLICATIONS
  4. Terminate Database Applications
    • db2 force application all
  5. DB2 Terminate
    • db2 terminate
  6. Stop License Daemon
    • db2licd -end
  7. Issue db2stop
    • db2stop
  8. db2diag
    • Review db2 log files

Steps

List Db2 Instances ( db2ilist )

Syntax


db2ilist

Sample


db2ilist

Output

db2ilist_20180912_0238PM.PNG

List / Set Environment Variable ( set db2 )

Syntax


set [environment-variable]

Sample


set db2

Output

envvar_set_20180912_0422PM.PNG

List Applications

CLI

db2 list applications
Syntax

db2 list applications

Sample

db2 list applications

Output
Output – “No Data Was Returned”
Image

db2ListApplications_20180913_0648AM.PNG

Textual

SQL1611W No data was returned by Database System Monitor.

Output – “List Applications #1”

Image
Textual

listApplications.20180913.0822AM.PNG


Auth Id Application Appl. Application Id DB # of
Name Handle Name Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
DADENIJI db2jcc_applica 462 10.11.203.114.63024.180913144347 SAMPLE 1

List Applications ( Using SYSIBMADM.APPLICATIONS )

SYSIBMADM.APPLICATIONS

Sample

SELECT 

          tblApp.AGENT_ID           AS "agentID"
        , tblApp.AUTHID             AS "authID"
        , tblApp.TPMON_CLIENT_APP   AS "clientApp"
        , tblApp.APPL_NAME          AS "Application"
        , tblApp.DB_NAME            AS "database"
        , tblApp.APPL_STATUS        AS "appStatus"
        , tblApp.CLIENT_PROTOCOL    AS "clientProtocol"
        , tblApp.CLIENT_NNAME       AS "clientName"
        , tblApp.NUM_ASSOC_AGENTS   AS "#ofAgents"
--      , tblApp.*

FROM   SYSIBMADM.APPLICATIONS tblApp

WHERE
        (

            ( tblApp.TPMON_CLIENT_APP IS NOT NULL )

        )

Output

SYSIBMADM.APPLICATIONS.20180913.1123AM..PNG

Terminate Application

Syntax


db2 force application ( appl-id-1, appl-id-2, appl-id-3, ...., appl-id=n)

Sample

Sample – Specific Application ID

db2 force application ( 462 )

Output

db2forceapplication_01.20180913.1134AM.PNG

Sample – All Applications

db2 force application all

DB2 Terminate

Syntax


db2 terminate

Sample


db2 terminate

Output

db2terminate_20180913_1137AM.PNG

db2stop

Syntax


db2stop

Sample


db2stop

Output

db2stop.20180913.1139AM

db2licd

Syntax


db2licd

Sample


db2licd -end

Output

db2licd.stop.20180913.1143AM.PNG

db2diag

Syntax


db2diag

Sample


db2diag

Output

Output – 01

db2diag_20180912_0432PM.PNG

Output – 02

db2diag_20180913_1146AM.PNG

References

  1. IBM
    • IBM Knowledge Center
      •  Home > Db2 11.1 > Database fundamentals > Applying fix packs > Applying fix packs in Db2 database environments > Preparing to install a fix pack
        • Stopping all Db2 processes (Linux and UNIX)
          Link
      • Home > Tivoli Storage Productivity Center 5.2.6 > Administering > Administering DB2
        • Manually stopping DB2 on Windows
          Link