Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

DB2

Posted Apr 10, 2003

The DB2 System Commands - Page 3

By Marin Komadina

Here is sorted description for some of the most important database processes:

DB2 Instance Global Process

  • db2wdog -'watchdog' monitors the other processes and cleans up after abnormal terminations.
  • db2sysc -'system controller' handles startup, shutdown and other housekeeping tasks.
  • db2gds -'Generic Daemon Spawner' is responsible for spawning most DB2 daemons.
  • db2ipccm -The 'IPC Communication Manager' handles communication requests from local clients, spawning an agent for each.
  • db2tcpcm -The 'TCP/IP Communications Manager' handles TCP/IP connect requests from remote clients.
  • db2tcpdm -The 'TCP/IP Administration Manager' handles TCP/IP requests for database administration jobs.
  • db2resyn - The 'resync' handles recovery of indoubt transactions for Distributed Unit of Work (DUOW).

DB2 Instance Connect Process

  • db2agent - An 'agent' that handles all SQL processing that the application requests.>
  • db2dlock - 'Database Deadlock Detector' looks for, and resolves, deadlocks on a particular database.
  • db2loggr - 'Database Logger' handles all log I/O for a particular database.
  • db2pfchr - 'Prefetcher' allows for more efficient processing via read-ahead, big-block and parallel I/O.
  • db2pclnr - 'Page Cleaner' increases efficiency by asynchronously writing dirty pages when the CPU would otherwise be idle.
  • db2bp - DB2 CLP process, spawned for a Command Line Processor session.

db2empfa - Enable Multi-page File Allocation

The DB2 system command db2empfa is used by databases with SMS (System Managed Tablespace) tablespace when a bulk load is expected. The SMS tablespace is normally expanded on demand, one page at a time. To minimize internal overhead for the tablespace extension we can enable database multi-page file allocation. Tablespace will be extended in groups of pages or extents. For a multinode database, the db2empfa system command only affects the node upon which it is executed.

Getting the actual database configuration:

db2 => get db cfg for ARTIST 

       Database Configuration for Database ARTIST
 
 Database configuration release level                    = 0x0900
 Database release level                                  = 0x0900
 
 Database territory                                      = US
 Database code page                                      = 819
 Database code set                                       = ISO8859-1
 Database country code                                   = 1
 
...
 Multi-page file allocation enabled                      = NO

Multi-page file allocation can be enabled by running the DB2 system command db2empfa on the target database:

$ db2empfa ARTIST 

After db2empfa execution against target database, we can check the database configuration parameter Multi-page file allocation enabled for status:

db2 => get db cfg for ARTIST 

       Database Configuration for Database ARTIST
 
 Database configuration release level                    = 0x0900
 Database release level                                  = 0x0900
 
 Database territory                                      = US
 Database code page                                      = 819
 Database code set                                       = ISO8859-1
 Database country code                                   = 1
 
...
 Multi-page file allocation enabled                      = YES

Database has enabled Multi-page file allocation.

db2gov - DB2 Governor

System command db2gov is started on logical node monitors and changes the behaviour of applications that run against a database. After starting, governor first reads the configuration file after which it checks all applications against rules from configuration file. When the governor finishes checking, it sleeps for the interval specified in the configuration file. This looping is executed over and over.

Rules in the configuration file are checked against database statistics for each application. Upon discovery of an application that is outside of the predefined conditions, governor has following options:

- force the application
- change the application's priority
- change the schedule for the application

The governor writes a record of the any action to a log file, together with all errors and messages. The governor daemon is not a database application, and, therefore, does not maintain a connection to the database.

If the governor uses too much CPU, you can increase its wake-up interval to reduce its CPU usage.

Governor start command:

(db2gov START database NODENUM node-num config-filelog-file)

db2gov start artist /home/artist/gov/artist.gov.cfg artist.gov

Governor stop command:

( db2gov STOP database NODENUM node-num)

db2gov stop artist

The parameters are as follows:

  • start database -starts the governor daemon to monitor the specified database
  • nodenum node-num - specifies the database partition on which to start the governor daemon.

  • config-file - specifies the configuration file to use when monitoring the database.
  • log-file - specifies the base name of the file to which the governor writes log records. The log file is stored in the log subdirectory of the sqllib directory.
  • stop database - stops the governor daemon that is monitoring the specified database.
  • nodenum node-num -specifies the database partition on which to stop the governor daemon.

Example of governor configuration file:

interval 60;
dbname artist;
account 60;

desc "Limit all processes to 60 cpu minutes (5400 seconds) "
setlimit cpu 5400 action force;

desc "Load jobs have no limit  "
applname db2bp_s
setlimit cpu -1;

desc "Op id's - unlimited cpu "
authid oper01, oper02, dbadm 
setlimit cpu -1;

desc "Limit all processes to 120 min (7200 seconds)
idle time" 
setlimit idle 7200 action force;

desc "Op id's - unlimited idle "
authid oper01, oper02, dbadm
setlimit idle -1;


DB2 Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 



















Thanks for your registration, follow us on our social networks to keep up-to-date