{"id":1389,"date":"2018-02-02T09:59:03","date_gmt":"2018-02-02T01:59:03","guid":{"rendered":"http:\/\/www.821121.com\/?p=1389"},"modified":"2021-02-02T10:02:01","modified_gmt":"2021-02-02T02:02:01","slug":"oradebug","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=1389","title":{"rendered":"oradebug"},"content":{"rendered":"<p>Shared_Pool \u662f Oracle SGA\u4e2d\u6700\u590d\u6742\u7684\u4e00\u90e8\u5206\uff0c\u5728\u5206\u6790\u5f88\u591a library cache \u95ee\u9898\u65f6\uff0c\u7ecf\u5e38\u4f1a\u7528\u5230\u8f6c\u50a8\u547d\u4ee4\u3002<\/p>\n<p>oradebug dump library_cache \u7684\u5e38\u7528\u7ea7\u522b\u5305\u62ec (\u6ce8\u610f\uff0c\u4e00\u5b9a\u8981\u6d4b\u8bd5\u4e4b\u540e\u518d\u91c7\u7528\uff0c\u8981\u5148\u770b\u770b library cache \u5927\u5c0f\uff0c\u5982\u679c\u5e93\u7f13\u5b58\u975e\u5e38\u5927\uff0c\u8fd9\u4e2a\u8f6c\u50a8\u7684\u65e5\u5fd7\u53ef\u80fd\u4f1a\u662f Huge \u7684)\uff1a<\/p>\n<p>\u7b49\u7ea71\uff1a\u5173\u952e\u7ed3\u6784\u7684\u7edf\u8ba1\u6c47\u603b\u4fe1\u606f<\/p>\n<p>\u7b49\u7ea72\uff1aHASH CHAIN \u4fe1\u606f<\/p>\n<p>\u7b49\u7ea74\uff1a\u6301\u6709\u5bf9\u8c61\u7ed3\u6784 Bucket \u4fe1\u606f\uff0c\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u5bf9\u8c61\u7684lock,pin,mutex\u4fe1\u606f\u3002<\/p>\n<p>\u7b49\u7ea78\uff1aLevel 4 + \u76f8\u5173\u6570\u636e\u5757<\/p>\n<p>\u7b49\u7ea716\uff1aLevel 8 + \u6bcf\u4e2a\u5bf9\u8c61\u7684 Heap \u4fe1\u606f<\/p>\n<p>\u7b49\u7ea732\uff1aLevel 16 + \u5b8c\u6574\u7684 Heap DUMP<\/p>\n<p>\u4f7f\u7528 oradebug \u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u8f6c\u50a8 library_cache \u4fe1\u606f\uff0c\u793a\u8303\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-sql\">[oracle12c@cat1 ~]$ sqlplus \/ as sysdba\n\nSQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 31 10:17:00 2018\n\nCopyright (c) 1982, 2016, Oracle. All rights reserved.\n\nConnected to:\n\nOracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production\n\nSQL&gt; oradebug setmypid\n\nStatement processed.\n\nSQL&gt; oradebug dump library_cache 1;\n\nStatement processed.\n\nSQL&gt; select value from v$diag_info where name like &#039;Defa%&#039;;\n\nVALUE\n\n--------------------------------------------------------------------------------\n\n\/oracle12c\/db\/diag\/rdbms\/enmo12c\/enmo12c\/trace\/enmo12c_ora_7277.trc\n\nSQL&gt; !\n\n[oracle12c@cat1 ~]$ cat \/oracle12c\/db\/diag\/rdbms\/enmo12c\/enmo12c\/trace\/enmo12c_ora_7277.trc\n\nTrace file \/oracle12c\/db\/diag\/rdbms\/enmo12c\/enmo12c\/trace\/enmo12c_ora_7277.trc\n\nOracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production\n\nBuild label: RDBMS_12.2.0.1.0_LINUX.X64_170125\n\nORACLE_HOME: \/u01\/oracle12c\/db\/product\/12.2.0\/dbhome_1\n\nSystem name: Linux\n\nNode name: enmotech\n\nRelease: 3.10.0-514.6.2.el7.x86_64\n\nVersion: #1 SMP Thu Feb 23 03:04:39 UTC 2017\n\nMachine: x86_64\n\nInstance name: enmo12c\n\nRedo thread mounted by this instance: 1\n\nOracle process number: 8\n\nUnix process pid: 7277, image: oracle@enmotech (TNS V1-V3)\n\n*** 2018-07-31T10:17:07.023214+08:00 (CDB$ROOT(1))\n\n*** SESSION ID:(982.48265) 2018-07-31T10:17:07.023262+08:00\n\n*** CLIENT ID:() 2018-07-31T10:17:07.023270+08:00\n\n*** SERVICE NAME:(SYS$USERS) 2018-07-31T10:17:07.023277+08:00\n\n*** MODULE NAME:(sqlplus@enmotech (TNS V1-V3)) 2018-07-31T10:17:07.023285+08:00\n\n*** ACTION NAME:() 2018-07-31T10:17:07.023292+08:00\n\n*** CLIENT DRIVER:(SQL*PLUS) 2018-07-31T10:17:07.023298+08:00\n\n*** CONTAINER ID:(1) 2018-07-31T10:17:07.023305+08:00\n\nProcessing Oradebug command &#039;setmypid&#039;\n\n*** 2018-07-31T10:17:07.023346+08:00 (CDB$ROOT(1))\n\nOradebug command &#039;setmypid&#039; console output: &lt;none&gt;\n\n*** 2018-07-31T10:17:13.956173+08:00 (CDB$ROOT(1))\n\nProcessing Oradebug command &#039;dump library_cache 1&#039;\n\nLIBRARY CACHE DUMP\n\nLIBRARY CACHE STATISTICS:\n\nnamespace gets hit ratio pins hit ratio reloads invalids\n\n-------------- --------- --------- --------- --------- ---------- ----------\n\nSQL AREA 1217773 0.891 21268193 0.985 55850 35229\n\nTABLE\/PROCEDURE 881146 0.961 2039858 0.909 76152 0\n\nBODY 192474 0.993 289193 0.994 348 0\n\nTRIGGER 61079 0.986 61077 0.986 2 1\n\nINDEX 152995 0.979 139263 0.816 12489 0\n\nCLUSTER 20622 0.992 20963 0.992 0 0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Shared_Pool \u662f Oracle SGA\u4e2d<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18],"tags":[],"class_list":["post-1389","post","type-post","status-publish","format-standard","hentry","category-oracle-10g","category-oracle-11g"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1389"}],"version-history":[{"count":1,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1389\/revisions"}],"predecessor-version":[{"id":1390,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1389\/revisions\/1390"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1389"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}