﻿{"id":1581,"date":"2019-05-17T17:39:06","date_gmt":"2019-05-17T09:39:06","guid":{"rendered":"http:\/\/www.llku.com\/?p=1581"},"modified":"2019-05-17T17:40:06","modified_gmt":"2019-05-17T09:40:06","slug":"%e5%85%b3%e4%ba%8eoracle%e7%9a%84vprocess-%e5%92%8cvsession-%e5%88%b0%e8%be%be%e6%9c%80%e5%a4%a7%e8%bf%9e%e6%8e%a5%e9%99%90%e5%88%b6%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.llku.com\/?p=1581","title":{"rendered":"\u5173\u4e8eORACLE\u7684v$process \u548cv$session \u5230\u8fbe\u6700\u5927\u8fde\u63a5\u9650\u5236\u7684\u95ee\u9898"},"content":{"rendered":"<div id=\"mainBox\" class=\"container clearfix\">\n<p>ORA-12520\uff1aTNS:\u76d1\u542c\u7a0b\u5e8f\u65e0\u6cd5\u4e3a\u8bf7\u6c42\u7684\u670d\u52a1\u5668\u7c7b\u578b\u627e\u5230\u53ef\u7528\u7684\u5904\u7406\u7a0b\u5e8f<\/p>\n<div class=\"blog-content-box\">\n<article class=\"baidu_pl\">\n<div id=\"article_content\" class=\"article_content clearfix csdn-tracking-statistics\" data-mod=\"popu_307\" data-pid=\"blog\" data-dsm=\"post\">\n<div id=\"content_views\" class=\"htmledit_views\">\n<p>oracle\u8fd9\u4e2a\u9519\u8bef\u7684\u610f\u601d\u662f\u00a0 \u6570\u636e\u5e93\u7684\u8fde\u63a5\u6570\u8fbe\u5230\u6700\u5927\u503c\u9650\u5236\u3002<\/p>\n<p><strong>\u4e00\u3001\u5173\u4e8e<\/strong><strong>v$process <\/strong><strong>\u548c<\/strong><strong>v$session<\/strong><strong>\u7684\u57fa\u672c\u77e5\u8bc6<\/strong><br \/>\nOracle\u6570\u636e\u5e93\u4e2dSession\u548cConnection\u7684\u533a\u522b\u3002<br \/>\n\u5728Oracle\u7684\u5b98\u65b9\u6587\u6863\u4e0a\uff0c\u5bf9Session\u548cConnection\u662f\u8fd9\u6837\u89e3\u91ca\u7684\uff1a<br \/>\n<strong>\u00a0 Connection:<\/strong> Communicate pathway between a client process and an Oracle database instance.<\/p>\n<p><strong>\u8fde\u63a5<\/strong>\uff1a\u4e00\u4e2a\u5ba2\u6237\u7aef\u8fdb\u7a0b\u548cOracle\u6570\u636e\u5e93\u5b9e\u4f8b\u4e4b\u95f4\u7684\u901a\u4fe1\u94fe\u8def\u3002<\/p>\n<p><strong>Session: <\/strong>A logical entity in the database instance memory that represnts the state of a current user login to a database. A single connection can have 0, 1 or more sessions established on it.<br \/>\n<strong>\u4f1a\u8bdd\uff1a<\/strong>\u7528\u4e8e\u5c55\u793a\u5f53\u524d\u767b\u5f55\u5230\u6570\u636e\u5e93\u7528\u6237\u7684\u72b6\u6001\u7684\u6570\u636e\u5e93\u5b9e\u4f8b\u5185\u5b58\u4e2d\u7684\u4e00\u4e2a\u903b\u8f91\u5b9e\u4f53\u3002\u4e00\u4e2a\u5355\u72ec\u7684\u8fde\u63a5\u53ef\u4ee5\u67090\uff0c1\uff0c\u6216\u8005\u66f4\u591a\u7684\u4f1a\u8bdd\u3002<\/p>\n<p>Connection\u5e76\u4e0d\u662f\u76f4\u63a5\u5efa\u7acb\u5728\u7528\u6237\u8fdb\u7a0b\u548c\u6570\u636e\u5e93\u5b9e\u4f8b\u4e4b\u95f4\u7684\u3002\u800c\u662f\u5728\u7528\u6237\u8fdb\u7a0b\u548cServer Process\uff08\u670d\u52a1\u5668\u8fdb\u7a0b\uff09\u4e4b\u95f4\u7684\uff0c\u56e0\u6b64\u6709\u4e00\u4e2aConnection\u5c31\u4e00\u5b9a\u4f1a\u6709\u4e00\u4e2a\u7528\u6237\u8fdb\u7a0b\u548c\u4e00\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u3002\u4f46\u4e0d\u4e00\u5b9a\u4f1a\u5b58\u5728Session\u3002\u6bd4\u5982\uff0c\u5982\u679c\u9700\u8981\u5c06\u4e1c\u897f\u4eceA\u8fd0\u5230B\uff0cConnection\u53ef\u4ee5\u770b\u6210\u662f\u4e00\u5ea7\u201c\u6865\u201d\uff0c\u800c\u5361\u8f66\u628a\u4e1c\u897f\u4eceA\u8fd0\u5230B\u540e\u5e76\u8fd4\u56deA\uff0c\u8fd9\u5c31\u662fSession\u3002\u6240\u4ee5\uff0c\u53ea\u8981\u4e0d\u65ad\u5f00\u8fde\u63a5\uff0c\u968f\u65f6\u90fd\u53ef\u4ee5\u5728\u8fd9\u4e2a\u8fde\u63a5\u4e0a\u521b\u5efa\u51fa\u4f1a\u8bdd\u3002<\/p>\n<p><strong>\u4e8c\u3001\u67e5\u770b<\/strong><strong>v$process <\/strong><strong>\u548c<\/strong><strong>v$session<\/strong><strong>\u7684\u57fa\u672c\u4fe1\u606f<\/strong><br \/>\n\u67e5\u8be2\u8d44\u6e90\u9650\u5236\u7684\u89c6\u56fe\u7684\u8bed\u6cd5\uff1a<\/p>\n<p>select * from v$resource_limit;<\/p>\n<p>select * from v$process;<\/p>\n<p>select * from v$session;<\/p>\n<p>select * from v$session t where t.STATUS=&#8217;ACTIVE&#8221;;<\/p>\n<p>process\u548csession\u53c2\u6570\u6700\u5927\u503c\u4f30\u7b97\u65b9\u6cd5<br \/>\nselect round(sum(pga_used_mem)\/1024\/1024,0) total_used_M, round(sum(pga_used_mem)\/count(1)\/1024\/1024,0) avg_used_M,<br \/>\nround(sum(pga_alloc_mem)\/1024\/1024,0) total_alloc_M, round(sum(pga_alloc_mem)\/count(1)\/1024\/1024,0) avg_alloc_M from v$process;<\/p>\n<p><strong>\u4e09\u3001\u91ca\u653e\u8d44\u6e90<\/strong><br \/>\n\u5728sqlnet.ora\u6587\u4ef6\u4e2d\u8bbe\u7f6eexpire_time \u53c2\u6570\u3002<br \/>\n\u53ef\u4ee5\u4f7f\u7528EXPIRE_TIME\u53c2\u6570\u95f4\u6b47\u68c0\u67e5\u5f02\u5e38session\u5e76\u91ca\u653eprocess\u3002<br \/>\n\u5b98\u65b9\u8bf4\u660e\uff1aSQLNET.EXPIRE_TIME<br \/>\nPurpose<br \/>\nUse parameter SQLNET.EXPIRE_TIME to specify a the time interval, in minutes, to send a probe to verify that client\/server connections are active. Setting a value greater than 0 ensures that connections are not left open indefinitely, due to an abnormal client termination. If the probe finds a terminated connection, or a connection that is no longer in use, it returns an error, causing the server process to exit. This parameter is primarily intended for the database server, which typically handles multiple connections at any one time.<br \/>\nLimitations on using this terminated connection detection feature are:<br \/>\nIt is not allowed on bequeathed connections.<br \/>\nThough very small, a probe packet generates additional traffic that may downgrade network performance.<br \/>\nDepending on which operating system is in use, the server may need to perform additional processing to distinguish the connection probing event from other events that occur. This can also result in degraded network performance.<\/p>\n<p>Recommended Value<br \/>\n10<br \/>\nExample<br \/>\nSQLNET.EXPIRE_TIME=10<\/p>\n<p>\u8fd9\u91cc\u8bbe\u7f6e\u662f10\u5206\u949f\uff0c\u6bcf10\u5206\u949fOracle\u4f1a\u786e\u8ba4\u6240\u6709session\u5ba2\u6237\u7aef\u8fde\u63a5\u662f\u5426\u6b63\u5e38\uff0c\u5bf9\u4e8e\u4e0d\u6b63\u5e38\u7684session\uff0coracle\u4f1a\u6e05\u7406process\u3002<\/p>\n<p><strong>\u540c\u65f6\uff0c\u6269\u5927\u6700\u5927\u8fde\u63a5\u6570\uff0c\u540c\u65f6<\/strong><strong>Session<\/strong><strong>\u81ea\u52a8\u8ddf\u7740\u6269\u5927\u3002<\/strong><\/p>\n<p>&#8211;\u4fee\u6539\u6700\u5927\u8fde\u63a5\u6570:<\/p>\n<p>alter system set processes = 500 scope = spfile;<\/p>\n<p>\u91cd\u542f\u6570\u636e\u5e93\uff1a<\/p>\n<p>cmd :sqlplus sys\/passw@databasename as sysdba<\/p>\n<p>\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<p>shutdown immediate;\u2014\u2014\u5173\u95ed\u6570\u636e\u5e93\uff0c\u5927\u6982\u9700\u8981\u4e00\u4e2a\u5c0f\u65f6<\/p>\n<p>startup;&#8211;\u91cd\u542f\u6570\u636e\u5e93\uff0c\u5927\u6982\u51e0\u5206\u949f\u3002<\/p>\n<p>\u91cd\u542f\u4e4b\u540e\uff1a<\/p>\n<p>select count(*) from v$process \u00a0 \u00a0\u2014\u2014\u4ece298\u53d8\u6210132<\/p>\n<p>select count(*) from v$session \u00a0 \u00a0\u2014\u2014\u4ece104\u53d8\u621038<\/p>\n<p>\u4f46\u662f\uff0c\u5728ArcGIS Portal \u91cc\u9762\u6253\u5f00\u4e00\u4e2a\u9875\u9762\uff0c\u8c03\u7528\u4e86SDE\u56fe\u5c42\uff0c<\/p>\n<p>\u4e0a\u9762\u7684\u8fde\u63a5\u6570\u5b57\u90fd\u589e\u52a0\uff0c\u90a3\u4e48\u5c31\u7b97\u8bbe\u7f6e\u4e3a\u6700\u5927500\uff0c\u4e5f\u652f\u6491\u4e0d\u6765\u591a\u5c11\u7528\u6237\u4f7f\u7528\u7684\uff01\uff01\uff01\uff01\uff1f\uff1f\uff1f\uff1f<\/p>\n<p>&#8211;\u67e5\u770b\u5f53\u524d\u6709\u54ea\u4e9b\u7528\u6237\u6b63\u5728\u4f7f\u7528\u6570\u636e<\/p>\n<p>SELECT osuser, a.username,cpu_time\/executions\/1000000||&#8217;s&#8217;,b.sql_text,machine<\/p>\n<p>from v$session a, v$sqlarea b<\/p>\n<p>where a.sql_address =b.address order by cpu_time;<\/p>\n<p>\u2014\u2014\u5728ArcGIS Portal \u91cc\u9762\u6253\u5f00\u4e00\u4e2a\u9875\u9762\uff0c\u8c03\u7528\u4e86SDE\u56fe\u5c42\uff0c\u901a\u8fc7\u4ee5\u4e0a\u8bed\u53e5\uff0c\u53ef\u4ee5\u770b\u5230SDE\u7528\u6237\u7684\u8fde\u63a5\u4fe1\u606f\u3002<\/p>\n<p>\u5c31\u7b97\u5173\u95ed\u4e86\u6d4f\u89c8\u5668\uff0c\u4e00\u6bb5\u65f6\u95f4\u4f9d\u7136\u53ef\u4ee5\u770b\u5230\u8fd9\u4e9b\u4fe1\u606f\uff0c\u534a\u4e2a\u5c0f\u65f6\u540e\uff0cSDE\u7684\u8fde\u63a5\u624d\u6d88\u5931\u3002<\/p>\n<p>\u2014\u2014\u67e5\u8be2\u6570\u636e\u5e93\u6709\u6ca1\u6709\u6b7b\u9501\uff0cno row selected \u8bf4\u660e\u6ca1\u6709\u6b7b\u9501\u3002<\/p>\n<p>select * from v$locked_object<\/p>\n<\/div>\n<\/div>\n<\/article>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ORA-12520\uff1aTNS:\u76d1\u542c\u7a0b\u5e8f\u65e0\u6cd5\u4e3a\u8bf7\u6c42\u7684\u670d\u52a1\u5668\u7c7b\u578b\u627e\u5230\u53ef\u7528\u7684\u5904\u7406\u7a0b\u5e8f oracle\u8fd9\u4e2a\u9519\u8bef\u7684\u610f\u601d\u662f\u00a0  &hellip; <a href=\"https:\/\/www.llku.com\/?p=1581\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u5173\u4e8eORACLE\u7684v$process \u548cv$session \u5230\u8fbe\u6700\u5927\u8fde\u63a5\u9650\u5236\u7684\u95ee\u9898<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[68],"tags":[249],"_links":{"self":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/1581"}],"collection":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1581"}],"version-history":[{"count":3,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/1581\/revisions"}],"predecessor-version":[{"id":1584,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/1581\/revisions\/1584"}],"wp:attachment":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}