{"id":342,"date":"2009-05-20T09:36:44","date_gmt":"2009-05-20T03:36:44","guid":{"rendered":"http:\/\/techsatwork.com\/blog\/?p=342"},"modified":"2016-01-07T11:31:12","modified_gmt":"2016-01-07T05:31:12","slug":"event-monitor-in-db2","status":"publish","type":"post","link":"https:\/\/techsatwork.com\/?p=342","title":{"rendered":"Event monitor in DB2"},"content":{"rendered":"<p>Event monitors are used to collect information about the database and any connected applications when specified events occur. \u00c2\u00a0An Event monitor collects various database activity using transactions. \u00c2\u00a0It can gather specific data while the even monitor is active. \u00c2\u00a0Events represent transitions in database activity: for instance, connections, deadlocks, statements, and transactions. You can define an event monitor by the type of event or events you want it to monitor. For example, a deadlock event monitor waits for a deadlock to occur; when one does, it collects information about the applications involved and the locks in contention. \u00c2\u00a0It can be used to tune performance and analyze locking issues.<\/p>\n<p>Here is a simple example for creating and formating event monitor output. First ensure the monitor switches are all turned on.<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"color: #3366ff;\">db2 create event monitor evmon1 for connections, statements write to file &lt;&#8216;path to file&#8217;&gt;<br \/>\ndb2 set event monitor evmon1 state 1<\/span><\/span><span style=\"font-size: medium;\"><span style=\"color: #3366ff;\"><br \/>\n<span style=\"color: #000080;\"> Run the SQLS \u00c2\u00a0and when all of them are completed<\/span><\/span><\/span><span style=\"font-size: medium;\"><span style=\"color: #3366ff;\"><strong><br \/>\n<\/strong> db2 flush event monitor evmon1<br \/>\ndb2 set event monitor evmon1 state 0<br \/>\ndb2evmon -db &lt;database name&gt; -evm evmon1\u00c2\u00a0&gt; evmon1.output<\/span><\/span><\/p>\n<p><span style=\"font-family: 'Courier New'; font-size: medium;\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Event monitors are used to collect information about the database and any connected applications when specified events occur. \u00c2\u00a0An Event monitor collects various database activity using transactions. \u00c2\u00a0It can gather specific data while the even monitor is active. \u00c2\u00a0Events represent transitions in database activity: for instance, connections, deadlocks, statements, and transactions. You can define an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[3],"tags":[426,213,943,427,425,429,212,428,214],"class_list":["post-342","post","type-post","status-publish","format-standard","hentry","category-db2","tag-analyzing-db2-event-monitor","tag-create-event-monitor","tag-db2","tag-db2-event-monitors","tag-db2-event-montior","tag-db2-monitors","tag-event-monitor","tag-event-monitors","tag-monitoring-db2"],"_links":{"self":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342"}],"version-history":[{"count":5,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions"}],"predecessor-version":[{"id":1542,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions\/1542"}],"wp:attachment":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}