{"id":387,"date":"2009-09-04T11:59:34","date_gmt":"2009-09-04T08:59:34","guid":{"rendered":"http:\/\/blog.yavor.info\/?p=387"},"modified":"2009-09-04T12:02:16","modified_gmt":"2009-09-04T09:02:16","slug":"11g-kill-session-on-other-node","status":"publish","type":"post","link":"http:\/\/blog.yavor.info\/?p=387","title":{"rendered":"11g kill session on other node"},"content":{"rendered":"<p>\u0415\u0434\u043d\u0430 \u043e\u0442 \u043c\u0430\u043b\u043a\u0438\u0442\u0435, \u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0438 \u0431\u043b\u0430\u0433\u0438\u043d\u043a\u0438 \u0432 11.1 (release one!) \u0435 \u043d\u043e\u0432\u0438\u044f\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0430 ALTER SYSTEM KILL SESSION. \u041e\u0441\u0432\u0435\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0438\u0442\u0435 SID \u0438 SERIAL, \u0432\u0435\u0447\u0435 \u0438\u043c\u0430 \u0442\u0440\u0435\u0442\u0438, \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u044a\u0440, \u0432 \u043a\u043e\u0439\u0442\u043e \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0437\u0430\u0434\u0430\u0434\u0435 instance id. \u0422\u043e\u0432\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0432\u0430 \u0434\u0430 \u0441\u0435 \u043f\u0440\u0435\u043a\u044a\u0441\u0432\u0430\u0442 \u0441\u0435\u0441\u0438\u0438 \u043d\u0430 &#8222;\u0434\u0440\u0443\u0433&#8220; instance. <\/p>\n<p>\u0421\u043f\u043e\u0440\u0435\u0434 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0442\u0430 \u043d\u0435\u0449\u0430\u0442\u0430 \u0441\u0442\u043e\u044f\u0442 \u0442\u0430\u043a\u0430:<\/p>\n<blockquote><p><strong>KILL SESSION Clause <\/strong><\/p>\n<p>The KILL SESSION clause lets you mark a session as terminated, roll back ongoing transactions, release all session locks, and partially recover session resources. To use this clause, your instance must have the database open. Your session and the session to be terminated must be on the same instance unless you specify integer3.You must identify the session with the following values from the V$SESSION view:<\/p>\n<p>&#8211; For integer1, specify the value of the SID column.<\/p>\n<p>&#8211; For integer2, specify the value of the SERIAL# column.<\/p>\n<p>&#8211; For the optional integer3, specify the ID of the instance where the target session to be killed exists. You can find the instance ID by querying the GV$ tables.<\/p><\/blockquote>\n<p>\u0422\u0443\u043a, \u043e\u0431\u0430\u0447\u0435, \u043d\u0435 \u0435 \u0446\u044f\u043b\u0430\u0442\u0430 \u0438\u0441\u0442\u0438\u043d\u0430. \u0415\u0442\u043e \u043a\u0430\u043a\u0432\u043e \u0441\u0435 \u0441\u043b\u0443\u0447\u0432\u0430 \u0430\u043a\u043e \u0441\u043b\u0435\u0434\u0432\u0430\u0448 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0442\u0430:<\/p>\n<pre lang=\"plsql\">\r\nSQL> select instance_number from v$instance;\r\n \r\nINSTANCE_NUMBER\r\n---------------\r\n              1\r\n \r\nSQL> select inst_id, sid, serial#\r\n  2    from gv$session\r\n  3   where username = 'YAVOR'\r\n  4     and program not like '%PZ99%';\r\n \r\n   INST_ID        SID    SERIAL#\r\n---------- ---------- ----------\r\n         1         12      29935\r\n         1        587       2564\r\n         1       1153       6987\r\n         1       1715       1807\r\n         2        583        494\r\n\r\nSQL> alter system kill session '583, 494, 2';\r\n \r\nalter system kill session '583, 494, 2'\r\n\r\nORA-00026: missing or invalid session ID\r\n<\/pre>\n<p>\u0418\u0437\u0440\u0435\u0447\u0435\u043d\u0438\u0435\u0442\u043e <em>&#8222;You can find the instance ID by querying the GV$ tables&#8220;<\/em> \u043d\u0435 \u043d\u043e\u0441\u0438 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f. \u0422\u0443\u043a \u043d\u044f\u043a\u043e\u0439 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0438 \u043f\u043e\u043c\u0438\u0441\u043b\u0438, \u0447\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u0442\u043e \u043d\u0430 \u0433\u0440\u0435\u0448\u043a\u0430 ORA-00026 \u0432 \u0441\u044a\u0449\u0430\u0442\u0430 \u0442\u0430\u0437\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0449\u0435 \u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e. \u0415\u0442\u043e \u043a\u043e\u043b\u043a\u043e \u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e:<\/p>\n<blockquote><p>ORA-00026: missing or invalid session ID<br \/>\n<strong>Cause:<\/strong> Missing or invalid session ID string for ALTER SYSTEM KILL SESSION.<br \/>\n<strong>Action:<\/strong> Retry with a valid session ID.<\/p><\/blockquote>\n<p>\u0427\u043e\u0432\u0435\u043a \u0432\u0435\u0434\u043d\u0430\u0433\u0430 \u0441\u0435 \u0441\u0435\u0449\u0430 \u043a\u0430\u043a\u044a\u0432 \u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u0430\u043b\u0438 \ud83d\ude42<\/p>\n<p>\u0427\u0430\u043a \u043c\u0435 \u0435 \u044f\u0434 \u043a\u0430\u043a \u043d\u0435 \u043c\u0438 \u0431\u043b\u0435\u0441\u043d\u0430 \u0432\u0435\u0434\u043d\u0430\u0433\u0430: \u0441\u043b\u0435\u0434\u0432\u0430\u0439\u043a\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043e\u0442 \u043f\u044a\u0440\u0432\u0438\u0442\u0435 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u044a\u0440\u0430 (SID \u0438 Serial#), \u0441\u044a\u0432\u0441\u0435\u043c \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0435, \u0447\u0435 \u0442\u0440\u0435\u0442\u0438\u044f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u044a\u0440 \u0441\u0435 \u0437\u0430\u0434\u0430\u0432\u0430 \u0441 @ (\u043a\u043b\u044c\u043e\u043c\u0431\u0430\/\u043c\u0430\u0439\u043c\u0443\u043d\u043a\u0430). \u041d\u044f\u043c\u0430 \u043d\u0443\u0436\u0434\u0430 \u0442\u043e\u0432\u0430 \u0434\u0430 \u0441\u0435 \u043f\u0438\u0448\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0442\u0430 &#8211; \u0442\u043e \u0435 \u0442\u043e\u043b\u043a\u043e\u0432\u0430 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043e&#8230;<\/p>\n<pre lang=\"plsql\">\r\nSQL> alter system kill session '583,494,@2';\r\n \r\nalter system kill session '583,494,@2'\r\n \r\nORA-00031: session marked for kill\r\n \r\nSQL> select inst_id, sid, serial#\r\n  2    from gv$session\r\n  3   where username = 'YAVOR'\r\n  4     and program not like '%PZ99%';\r\n \r\n   INST_ID        SID    SERIAL#\r\n---------- ---------- ----------\r\n         1         12      29935\r\n         1        587       2564\r\n         1       1153       6987\r\n         1       1715       1807\r\n\r\n<\/pre>\n<p><em><strong>P.S.:<\/strong> \u0418 \u0432 11.2 \u0435 \u0442\u0430\u043a\u0430<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0415\u0434\u043d\u0430 \u043e\u0442 \u043c\u0430\u043b\u043a\u0438\u0442\u0435, \u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0438 \u0431\u043b\u0430\u0433\u0438\u043d\u043a\u0438 \u0432 11.1 (release one!) \u0435 \u043d\u043e\u0432\u0438\u044f\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0430 ALTER SYSTEM KILL SESSION. \u041e\u0441\u0432\u0435\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0438\u0442\u0435 SID \u0438 SERIAL, \u0432\u0435\u0447\u0435 \u0438\u043c\u0430 \u0442\u0440\u0435\u0442\u0438, \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u044a\u0440, \u0432 \u043a\u043e\u0439\u0442\u043e \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0437\u0430\u0434\u0430\u0434\u0435 instance id. \u0422\u043e\u0432\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0432\u0430 \u0434\u0430 \u0441\u0435 \u043f\u0440\u0435\u043a\u044a\u0441\u0432\u0430\u0442 \u0441\u0435\u0441\u0438\u0438 \u043d\u0430 &#8222;\u0434\u0440\u0443\u0433&#8220; instance. <\/p>\n<p>\u0421\u043f\u043e\u0440\u0435\u0434 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0442\u0430 \u043d\u0435\u0449\u0430\u0442\u0430 \u0441\u0442\u043e\u044f\u0442 \u0442\u0430\u043a\u0430:<\/p>\n<blockquote><p><strong>KILL SESSION Clause <\/strong><\/p>\n<p>The KILL SESSION clause lets you mark a session as terminated, roll back ongoing transactions, release all session locks, and partially recover session resources. To use this clause, your instance must have the database open. Your session and the session to be terminated must be on the same instance unless you specify integer3.You must identify the session with the following values from the V$SESSION view:<br \/>\n<br \/>\n&#8211; For integer1, specify the value of the SID column.<br \/>\n<br \/>\n&#8211; For integer2, specify the value of the SERIAL# column.<br \/>\n<br \/>\n&#8211; For the optional integer3, specify the ID of the instance where the target session to be killed exists. You can find the instance ID by querying the GV$ tables.<\/p><\/blockquote>\n<p>\n\u0422\u0443\u043a, \u043e\u0431\u0430\u0447\u0435, \u043d\u0435 \u0435 \u0446\u044f\u043b\u0430\u0442\u0430 \u0438\u0441\u0442\u0438\u043d\u0430.<br \/>\n<br \/>\n<a href=\"http:\/\/blog.yavor.info\/?p=387\">A\u043a\u043e \u0442\u0438 \u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0435\u0442\u0438 \u043d\u0430\u0442\u0430\u0442\u044a\u043a&#8230;<\/a>) <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/posts\/387"}],"collection":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=387"}],"version-history":[{"count":0,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/posts\/387\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}