
{"id":1383,"date":"2022-03-08T19:33:54","date_gmt":"2022-03-08T11:33:54","guid":{"rendered":"http:\/\/dba.qishuo.xin\/?p=1383"},"modified":"2022-12-14T17:18:07","modified_gmt":"2022-12-14T09:18:07","slug":"ora-12516tns%e7%9b%91%e5%90%ac%e7%a8%8b%e5%ba%8f%e6%89%be%e4%b8%8d%e5%88%b0%e7%ac%a6%e5%90%88%e5%8d%8f%e8%ae%ae%e5%a0%86%e6%a0%88%e8%a6%81%e6%b1%82%e7%9a%84%e5%8f%af%e7%94%a8%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"http:\/\/dba.qishuo.xin\/?p=1383","title":{"rendered":"ORA-12516:TNS:\u76d1\u542c\u7a0b\u5e8f\u627e\u4e0d\u5230\u7b26\u5408\u534f\u8bae\u5806\u6808\u8981\u6c42\u7684\u53ef\u7528\u5904\u7406\u7a0b\u5e8f"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-6a32f58c8479f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a32f58c8479f\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#1_%E9%97%AE%E9%A2%98%E7%AE%80%E8%BF%B0\" >1. \u95ee\u9898\u7b80\u8ff0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#2_%E6%8A%A5%E9%94%99%E4%BF%A1%E6%81%AF\" >2. \u62a5\u9519\u4fe1\u606f<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#21_%E6%8A%A5%E9%94%99%E5%86%85%E5%AE%B9\" >2.1. \u62a5\u9519\u5185\u5bb9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#22_%E6%8A%A5%E9%94%99%E6%88%AA%E5%9B%BE\" >2.2. \u62a5\u9519\u622a\u56fe<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#3_%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90\" >3. \u95ee\u9898\u5206\u6790<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#31_%E9%94%99%E8%AF%AF%E8%A7%A3%E9%87%8A\" >3.1. \u9519\u8bef\u89e3\u91ca<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#32_%E5%88%86%E6%9E%90%E9%97%AE%E9%A2%98\" >3.2. \u5206\u6790\u95ee\u9898<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#4_%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3\" >4. \u95ee\u9898\u89e3\u51b3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#5_%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93\" >5. \u95ee\u9898\u603b\u7ed3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#6_%E5%85%B6%E4%BB%96%E6%89%A9%E5%B1%95%E7%8E%B0%E8%B1%A1\" >6. \u5176\u4ed6\u6269\u5c55\u73b0\u8c61<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#%E9%99%84%E5%BD%95%EF%BC%9A%E5%85%B3%E8%81%94%E6%88%96%E5%8F%82%E8%80%83%E6%96%87%E6%A1%A3\" >\u9644\u5f55\uff1a\u5173\u8054\u6216\u53c2\u8003\u6587\u6863<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"http:\/\/dba.qishuo.xin\/?p=1383\/#A_%E5%85%B3%E8%81%94%E7%9A%84%E6%96%87%E6%A1%A3\" >A. \u5173\u8054\u7684\u6587\u6863<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"1_%E9%97%AE%E9%A2%98%E7%AE%80%E8%BF%B0\"><\/span>1. \u95ee\u9898\u7b80\u8ff0<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5728PL\/SQL\u4e2d\u6253\u5f00\u65b0\u7a97\u53e3\uff0c\u5e76\u6267\u884cSQL\u8bed\u53e5\u65f6\u62a5 ORA-12516\u9519\u8bef<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_%E6%8A%A5%E9%94%99%E4%BF%A1%E6%81%AF\"><\/span>2. \u62a5\u9519\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"21_%E6%8A%A5%E9%94%99%E5%86%85%E5%AE%B9\"><\/span>2.1. \u62a5\u9519\u5185\u5bb9<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li>\n<p>\u4e2d\u6587<br \/>\nTNS:\u76d1\u542c\u7a0b\u5e8f\u627e\u4e0d\u5230\u7b26\u5408\u534f\u8bae\u5806\u6808\u8981\u6c42\u7684\u53ef\u7528\u5904\u7406\u7a0b\u5e8f\u3002<\/p>\n<\/li>\n<li>\n<p>\u82f1\u6587<br \/>\nTNS:listener could not find available handler with matching protocol stack<\/p>\n<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"22_%E6%8A%A5%E9%94%99%E6%88%AA%E5%9B%BE\"><\/span>2.2. \u62a5\u9519\u622a\u56fe<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/03\/wp_editor_md_57f401cc8c0e04839440e74c3a4ca4cd.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/03\/wp_editor_md_57f401cc8c0e04839440e74c3a4ca4cd.jpg\" alt=\"\" \/><\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90\"><\/span>3. \u95ee\u9898\u5206\u6790<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"31_%E9%94%99%E8%AF%AF%E8%A7%A3%E9%87%8A\"><\/span>3.1. \u9519\u8bef\u89e3\u91ca<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-shell\">[oracle@dbtest ~]$ oerr ora 12516\n12516, 00000, &quot;TNS:listener could not find available handler with matching protocol stack&quot;\n\/\/ *Cause: None of the known and available service handlers for the given \n\/\/ SERVICE_NAME support the client&#039;s protocol stack: transport, session, \n\/\/ and presentation protocols.\n\/\/ *Action: Check to make sure that the service handlers (e.g. dispatchers) \n\/\/ for the given SERVICE_NAME are registered with the listener, are accepting \n\/\/ connections, and that they are properly configured to support the desired \n\/\/ protocols.<\/code><\/pre>\n<p><strong><span style='color:red'>\u51fa\u73b0\u8be5\u9519\u8bef\u65f6\uff0c\u8bf4\u660e\u6570\u636e\u5e93\u7684\u8fde\u63a5\u8fbe\u5230\u4e86\u8bbe\u5b9a\u7684\u4e0a\u9650\uff0c\u4e0d\u5141\u8bb8\u65b0\u7684\u4f1a\u8bdd\u521b\u5efa\u8fde\u63a5\u3002<\/span><\/strong><\/p>\n<h4><span class=\"ez-toc-section\" id=\"32_%E5%88%86%E6%9E%90%E9%97%AE%E9%A2%98\"><\/span>3.2. \u5206\u6790\u95ee\u9898<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li>(1) \u53d6\u5f97\u6570\u636e\u5e93\u8fdb\u7a0b\u6570\u7684\u4e0a\u9650<\/li>\n<\/ul>\n<pre><code class=\"language-sql\">SELECT value\n  FROM v$parameter a\n WHERE a.name = &#039;processes&#039;;<\/code><\/pre>\n<ul>\n<li>(2) \u67e5\u770b\u5f53\u524d\u6570\u636e\u5e93\u5df2\u8fde\u63a5\u7684\u4f1a\u8bdd\u6570<\/li>\n<\/ul>\n<pre><code class=\"language-sql\">SELECT COUNT(*)\n  FROM v$process;<\/code><\/pre>\n<ul>\n<li>(3) \u6309\u7528\u6237\u7edf\u8ba1\u5df2\u8fde\u63a5\u7684\u4f1a\u8bdd\u6570<\/li>\n<\/ul>\n<pre><code class=\"language-sql\">SELECT b.username,b.machine,b.program, COUNT(*)\n  FROM v$process a\n  LEFT JOIN v$session b ON a.addr = b.paddr\n GROUP BY b.username,b.machine,b.program\n ORDER BY 4 DESC;<\/code><\/pre>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/03\/wp_editor_md_2dad04ef3448f01f5b6d930328186387.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/03\/wp_editor_md_2dad04ef3448f01f5b6d930328186387.jpg\" alt=\"\" \/><\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3\"><\/span>4. \u95ee\u9898\u89e3\u51b3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>(1) \u589e\u52a0\u6570\u636e\u5e93\u7684\u8fdb\u7a0b\u4e0a\u9650\uff0c\u4f46\u9700\u8981\u91cd\u542f\u6570\u636e\u5e93<\/li>\n<\/ul>\n<pre><code class=\"language-sql\">alter system set processes=800 scope=spfile;\n# \u91cd\u542f\u6570\u636e\u5e93\uff0c\u4f7f\u66f4\u6539\u751f\u6548<\/code><\/pre>\n<ul>\n<li>(2) \u901a\u77e5\u8fde\u63a5\u4e0d\u5f53\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u7981\u6b62\u5176\u8fde\u63a5<\/li>\n<\/ul>\n<pre><code class=\"language-sql\">revoke connect from user_name;<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"5_%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93\"><\/span>5. \u95ee\u9898\u603b\u7ed3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ORA-12516\u9519\u8bef\u4e00\u822c\u662f\u7531\u4e8e\u6570\u636e\u5e93\u7684\u5f53\u524d\u4f1a\u8bdd\u6570\u4e0d\u6ee1\u8db3\u9020\u6210\u7684\uff0c\u53ef\u4ee5\u89c6\u4e1a\u52a1\u9700\u8981\u589e\u52a0processes\u548csessions\u53c2\u6570\u7684\u5927\u5c0f\uff0c\u8fd9\u4e8c\u8005\u7684\u5173\u7cfb\u662f\uff1a<\/p>\n<p>\u5728Oracle11g\u4e2d\u4e3a\uff1a<code>sessions = (1.1 * processes + 5)<\/code><br \/>\n\u5728Oracle12c\u4e2d\u4e3a\uff1a<code>sessions = (1.5 * PROCESSES) + 22<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_%E5%85%B6%E4%BB%96%E6%89%A9%E5%B1%95%E7%8E%B0%E8%B1%A1\"><\/span>6. \u5176\u4ed6\u6269\u5c55\u73b0\u8c61<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>\u6570\u636e\u5e93\u5f02\u5e38\u505c\u673a\u540e\uff0c\u670d\u52a1\u5668\u65f6\u95f4\u5f02\u5e38\uff0c\u5bfc\u81f4\u8fde\u63a5\u4e5f\u62a5 ORA-12516 \u9519\u8bef\uff0c\u91cd\u542f\u4e86\u76d1\u542c\u540e\u89e3\u51b3\u95ee\u9898\u3002<\/strong><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E9%99%84%E5%BD%95%EF%BC%9A%E5%85%B3%E8%81%94%E6%88%96%E5%8F%82%E8%80%83%E6%96%87%E6%A1%A3\"><\/span>\u9644\u5f55\uff1a\u5173\u8054\u6216\u53c2\u8003\u6587\u6863<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"A_%E5%85%B3%E8%81%94%E7%9A%84%E6%96%87%E6%A1%A3\"><\/span>A. \u5173\u8054\u7684\u6587\u6863<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u6e05\u7406Oracle\u76d1\u542c\u65e5\u5fd7\uff1a<a target=\"_blank\" href=\"http:\/\/dba.qishuo.xin\/?p=411\">http:\/\/dba.qishuo.xin\/?p=411<\/a><br \/>\n\u4f7f\u7528\u811a\u672c\u5206\u6790Oracle listener\u65e5\u5fd7\uff1a<a target=\"_blank\" href=\"http:\/\/dba.qishuo.xin\/?p=417\">http:\/\/dba.qishuo.xin\/?p=417<\/a><br \/>\nOracle \u4f7f\u7528 SCANs \u662f\u5982\u4f55\u521b\u5efa\u6570\u636e\u5e93\u8fde\u63a5\uff1a<a target=\"_blank\" href=\"http:\/\/dba.qishuo.xin\/?p=1755\">http:\/\/dba.qishuo.xin\/?p=1755<\/a><br \/>\nOracle RAC \u4fee\u6539\u4fa6\u542c (listener)\u7aef\u53e3\uff1a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u95ee\u9898\u7b80\u8ff0 \u5728PL\/SQL\u4e2d\u6253\u5f00\u65b0\u7a97\u53e3\uff0c\u5e76\u6267\u884c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,2],"tags":[188,16],"class_list":{"0":"post-1383","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-oracle","8":"tag-ora-12516","9":"tag-oracle"},"_links":{"self":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/1383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1383"}],"version-history":[{"count":9,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/1383\/revisions"}],"predecessor-version":[{"id":2468,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/1383\/revisions\/2468"}],"wp:attachment":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1383"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}