Database system integration with Windows Management Instrumentation

The snapshot monitors can be accessed by Windows Management Instrumentation (WMI) by means of performance counters and using the built-in PerfMon provider.

The profile registry variables can be accessed by WMI by using the built-in Registry provider.

The WMI Software Development Kit (WMI SDK) includes several built-in providers:

  • PerfMon provider
  • Registry event provider
  • Registry provider
  • Windows event log provider
  • Win32 provider
  • WDM provider

Database errors in the Event Logs can be accessed by WMI by using the built-in Windows Event Log provider.

The database system has a WMI Administration provider, and sample WMI script files, to access the following managed objects:

  1. Instances of the database server including those instances that are distributed. The following operations can be done:
    • Enumerate instances
    • Configure database manager parameters
    • Start/stop/query the status of the database server service
    • Setup or establish communication
  2. Databases. The following operations can be done:
    • Enumerate databases
    • Configure database parameters
    • Create/drop databases
    • Backup/restore/roll forward databases

You will need to register the WMI provider with the system before running WMI applications. Registration is done by entering the following commands:

  • mofcomp %DB2PATH%\bin\db2wmi.mof

    This command loads the definition of the database WMI schema into the system.

  • regsvr %DB2PATH%\bin\db2wmi.dll

    This command registers the database WMI provider COM DLL with Windows.

In both commands, %DB2PATH% is the path where the database is installed, and db2wmi.mof is the .MOF file that contains the WMI schema definition.

There are several benefits to integrating with the WMI infrastructure:

  1. You are able to easily write scripts to manage database servers in a Windows-based environment using the WMI provided tool. Sample Visual Basic scripts are provided to carry out simple tasks such as listing instances, creating and dropping databases, and updating configuration parameters. These sample scripts are included in the Db2® Application Development for Windows product.
  2. You can create powerful management applications that perform many tasks using WMI. The tasks could include:
    • Displaying system information
    • Monitoring database performance
    • Monitoring database system resource consumption
    By monitoring both system events and database events through this type of management application, you can manage the database better.
  3. You can use existing COM and Visual Basic programming knowledge and skills. By providing a COM or Visual Basic interface, your programmers can save time when developing enterprise management applications.