{"id":392,"date":"2009-07-14T02:46:39","date_gmt":"2009-07-13T20:46:39","guid":{"rendered":"http:\/\/techsatwork.com\/blog\/?p=392"},"modified":"2016-01-07T11:31:11","modified_gmt":"2016-01-07T05:31:11","slug":"what-if-db2stop-fails","status":"publish","type":"post","link":"https:\/\/techsatwork.com\/?p=392","title":{"rendered":"What if db2stop fails ?!?"},"content":{"rendered":"<p>Don&#8217;t tell me you haven&#8217;t had db2stop fail on you.\u00c2\u00a0 Once in a while db2stop would hang especially if you have a hung thread.\u00c2\u00a0 If haven&#8217;t forced the &#8220;hung&#8221; thread off the database before you stop db2, db2stop will wait indefinitely. In such cases IBM has db2stop force , but what if that fails. Well you can do these :<\/p>\n<p>1.\u00c2\u00a0 Issue <em><span style=\"color: #3366ff;\">kill -9<\/span><\/em> on all the db2sysc process. This will crash db2 immediately.<\/p>\n<p>2. Then do\u00c2\u00a0 <em><span style=\"color: #3366ff;\">ipclean &lt;instance id&gt;<\/span><\/em> .\u00c2\u00a0 This will removeDB2 engine and client&#8217;s IPC resources.<\/p>\n<p>3. Now you need to clean up the inter-process segments for defunct \/ db2 processes, for this you can issue :<\/p>\n<p>\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 <em><span style=\"color: #3366ff;\">ipcs -a | grep &lt;instance id&gt; | awk &#8216;{print &#8220;ipcrm -&#8220;$1&#8221; &#8220;$2}&#8217; | \/bin\/csh<\/span><\/em><\/p>\n<p>These would clean up all the resources allocated to db2.<\/p>\n<p>You also do <em><span style=\"color: #3366ff;\">db2_kill<\/span><\/em> to kill db2 and its allegedly do all the above. In DB2 V9 WSE you can issue <em><span style=\"color: #3366ff;\">db2nkill<\/span><\/em>\u00c2\u00a0 instead of db2_kill.<\/p>\n<p>You can start up db2 by issuing db2start\u00c2\u00a0 . Be real careful before you issue kill -9 command on db2sysc or db2_kill,\u00c2\u00a0 use it as a last option. Its will render all the database to be inconsistent if it has inflight transaction during the &#8220;kill&#8221;.\u00c2\u00a0 It will attempt to do a crash recovery when it starts backup, but you will risk all the inflight transactions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Don&#8217;t tell me you haven&#8217;t had db2stop fail on you.\u00c2\u00a0 Once in a while db2stop would hang especially if you have a hung thread.\u00c2\u00a0 If haven&#8217;t forced the &#8220;hung&#8221; thread off the database before you stop db2, db2stop will wait indefinitely. In such cases IBM has db2stop force , but what if that fails. Well [&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":[943,240,237,152,236,239,238],"class_list":["post-392","post","type-post","status-publish","format-standard","hentry","category-db2","tag-db2","tag-db2-crash","tag-db2nkill","tag-db2stop","tag-db2_kill","tag-ipclean","tag-ipcs"],"_links":{"self":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/392","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=392"}],"version-history":[{"count":1,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":393,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions\/393"}],"wp:attachment":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}