﻿{"id":1414,"date":"2019-01-16T15:17:01","date_gmt":"2019-01-16T07:17:01","guid":{"rendered":"http:\/\/www.llku.com\/?p=1414"},"modified":"2019-01-30T14:48:18","modified_gmt":"2019-01-30T06:48:18","slug":"sql-tuning-health-check-script-sqlhc-%e6%96%87%e6%a1%a3-id-1366133-1","status":"publish","type":"post","link":"https:\/\/www.llku.com\/?p=1414","title":{"rendered":"SQL Tuning Health-Check Script (SQLHC)  (\u6587\u6863 ID 1366133.1)"},"content":{"rendered":"<form action=\"\/epmos\/faces\/DocumentDisplay?_adf.ctrl-state=8nwetzsju_1287&amp;id=1366133.1\" id=\"f1\" method=\"POST\" name=\"f1\">\n<p>\n\t\tApplies to:&nbsp;<br \/>\n\t\tOracle Database &#8211; Personal Edition &#8211; Version 10.2.0.1 and later<br \/>\n\t\tOracle Database &#8211; Enterprise Edition &#8211; Version 10.2.0.1 and later<br \/>\n\t\tOracle Database &#8211; Standard Edition &#8211; Version 10.2.0.1 and later<br \/>\n\t\tOracle Database Products &gt; Oracle Database Suite &gt; Oracle Database<br \/>\n\t\tInformation in this document applies to any platform.\n\t<\/p>\n<p>\n\t\tPurpose&nbsp;\n\t<\/p>\n<p>\n\t\tDownload the SQL Tuning Health-Check Script\n\t<\/p>\n<p>\n\t\tSQL Health Check\n\t<\/p>\n<p>\n\t\tDownload the SQLHC Script Here (.zip archive).\n\t<\/p>\n<p>\n\t\t&nbsp;\n\t<\/p>\n<p>\n\t\tWhat is the SQL Tuning Health-Check Script (SQLHC)?\n\t<\/p>\n<p>\n\t\tThe SQL Tuning Health-Check Script is a tool developed by the Oracle Server Technologies Center of Expertise. The tool, also known as SQLHC, is used to check the environment in which a single SQL Statement runs, checking Cost-based Optimizer (CBO) statistics, schema object metadata, configuration parameters and other elements that may influence the performance of the one SQL being analyzed.\n\t<\/p>\n<p>\n\t\tLicensing (SQLHC requires no license and is FREE)\n\t<\/p>\n<p>\n\t\tAs in the title of this section, SQLHC requires no license and is FREE.&nbsp;<br \/>\n\t\tSince SQLHC can use information from AWR reports if the Diagnostic or Tuning pack are installed, it asks if these packs are licensed at your site. For more details refer to the licensing section in the SQLHC FAQ:\n\t<\/p>\n<p>\n\t\tDocument 1454160.1 FAQ: SQL Health Check (SQLHC) Frequently Asked Questions<br \/>\n\t\t&nbsp;\n\t<\/p>\n<p>\n\t\tOverview of the SQL Tuning Health-Check Script\n\t<\/p>\n<p>\n\t\tAn overview video about SQLHC is available here :\n\t<\/p>\n<p>\n\t\tDocument 1455583.1 SQL Tuning Health-Check Script (SQLHC) Video\n\t<\/p>\n<p>\n\t\t<br \/>\n\t\tThe intention of SQLHC is to allow users to avoid SQL Performance from being affected by avoidable problems by ensuring that the environment that an individual SQL runs in is sound.\n\t<\/p>\n<p>\n\t\tIt does this while leaving &quot;no database footprint&quot; ensuring it can be run on all systems.\n\t<\/p>\n<p>\n\t\tWhen executed for one SQL_ID, this script generates an HTML report with the results of a set of health-checks around the one SQL statement provided. You can find the SQL_ID of a statement from an AWR or ASH report or you can select it from the database using the V$SQL view. See:\n\t<\/p>\n<p>\n\t\tDocument 1627387.1 How to Determine the SQL_ID for a SQL Statement\n\t<\/p>\n<p>\n\t\tHealth-checks are performed over:<br \/>\n\t\t&bull;CBO Statistics for schema objects accessed by the one SQL statement being analyzed<br \/>\n\t\t&bull;CBO Parameters<br \/>\n\t\t&bull;CBO System Statistics<br \/>\n\t\t&bull;CBO Data Dictionary Statistics<br \/>\n\t\t&bull;CBO Fixed-objects Statistics\n\t<\/p>\n<p>\n\t\tNOTE: A webcast has been recorded entitled: &quot;How to Improve SQL Performance with the New Health Check Tool?&quot;.\n\t<\/p>\n<p>\n\t\tThis can be found, along with many other recorded webcasts, here:\n\t<\/p>\n<p>\n\t\tDocument 740964.1 Advisor Webcast Archived Recordings\n\t<\/p>\n<p>\n\t\tA FAQ for the SQL Healthcheck script (SQLHC) can be found here:\n\t<\/p>\n<p>\n\t\t<br \/>\n\t\tDocument 1417774.1 FAQ: SQLHC HealthCheck Frequently Asked Questions\n\t<\/p>\n<p>\n\t\tAdditionally, we welcome any additional health-checks that you may suggest. If any specific health-checks are needed and not covered by this script, then as long as the health-check can be produced with a SQL Command (leaving no database footprint ) then these can be implemented in future versions.\n\t<\/p>\n<p>\n\t\tPlease add comments to this Document for any desired additions.<br \/>\n\t\t&nbsp;\n\t<\/p>\n<p>\n\t\tBest Practices\n\t<\/p>\n<p>\n\t\tPro-Active Problem Avoidance and Diagnostic Collection\n\t<\/p>\n<p>\n\t\tAlthough some problems may be unforeseen, in many cases problems may be avoidable if signs are detected early enough. Additionally, if an issue does occur, it is no use collecting information about that issue after the event. SQLHC is one of the tools that support recommend for collecting such diagnostics. For information on suggested uses, other proactive preparations and diagnostics, see:\n\t<\/p>\n<p>\n\t\tDocument 1482811.1 Best Practices: Proactively Avoiding Database and Query Performance Issues<br \/>\n\t\tDocument 1477599.1 Best Practices Around Data Collection For Performance Issues\n\t<\/p>\n<p>\n\t\tAsk Questions, Get Help, And Share Your Experiences With This Article\n\t<\/p>\n<p>\n\t\tWould you like to explore this topic further with other Oracle Customers, Oracle Employees, and Industry Experts?\n\t<\/p>\n<p>\n\t\tClick here to join the discussion where you can ask questions, get help from others, and share your experiences with this specific article.<br \/>\n\t\tDiscover discussions about other articles and helpful subjects by clicking here to access the main My Oracle Support Community page for Database Tuning.\n\t<\/p>\n<p>\n\t\tRequirements\n\t<\/p>\n<p>\n\t\tExecute this script from SQL*Plus connecting as SYS, DBA or a user with access to Data Dictionary views.\n\t<\/p>\n<p>\n\t\tNOTE: The script ADDS NO OBJECTS TO THE DATABASE. It simply reports and advises on existing objects\n\t<\/p>\n<p>\n\t\tConfiguring\n\t<\/p>\n<p>\n\t\tThere is no configuration required.\n\t<\/p>\n<p>\n\t\tInstructions<br \/>\n\t\t1.Login to the database server and set the environment used by the Database Instance<br \/>\n\t\t2.Download the &quot;sqlhc.zip&quot; archive file and extract the contents to a suitable directory\/folder<br \/>\n\t\t3.Connect into SQL*Plus as SYS, a DBA account, or a user with access to Data Dictionary views and simply execute the &quot;sqlhc.sql&quot; script. It will request to enter two parameters:\n\t<\/p>\n<p>\n\t\ti.Oracle Pack License (Tuning, Diagnostics or None) [T|D|N] (required)<br \/>\n\t\tIf site has both Tuning and Diagnostics licenses then specify T (Oracle Tuning pack includes Oracle Diagnostics)\n\t<\/p>\n<p>\n\t\t<br \/>\n\t\tii.A valid SQL_ID for the SQL to be analyzed. &nbsp;\n\t<\/p>\n<p>\n\t\t<br \/>\n\t\tFor Example:\n\t<\/p>\n<p>\n\t\t# sqlplus \/ as sysdba<br \/>\n\t\tSQL&gt; START sqlhc.sql T djkbyr8vkc64h\n\t<\/p>\n<p>\n\t\t<strong>#SQLHC\u62a5\u544a\u8bf4\u660e<\/strong>\n\t<\/p>\n<p>\n\t\t1_health_check.html<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Observations:\u663e\u793ahealth-checks\u8f93\u51fa\u7684\u53ef\u80fd\u5b58\u5728\u95ee\u9898\u7684\u9879\u76ee,\u786e\u8ba4\u662f\u5426\u9700\u8981\u66f4\u6539.\u4f8b\u5982:\u5bf9\u8c61\u7edf\u8ba1\u4fe1\u606f\u8fc7\u65e7<br \/>\n\t\t&nbsp;&nbsp;&nbsp; SQL Text:\u8981\u68c0\u67e5\u7684sql\u6587\u672c<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Tables Summary:\u663e\u793a\u76f8\u5173\u8868\u7684\u7edf\u8ba1\u4fe1\u606f\u5927\u6982<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Indexes Summary:\u663e\u793a\u76f8\u5173\u7d22\u5f15\u7684\u7edf\u8ba1\u4fe1\u606f\u5927\u6982<br \/>\n\t\t2_diagnostics.html<br \/>\n\t\t&nbsp;&nbsp;&nbsp; SQL Text:\u8981\u68c0\u67e5\u7684sql\u6587\u672c<br \/>\n\t\t&nbsp;&nbsp;&nbsp; SQL Plan Baselines (DBA_SQL_PLAN_BASELINES):DBA_SQL_PLAN_BASELINES\u4e2d\u6b64sql\u7684plan history<br \/>\n\t\t&nbsp;&nbsp;&nbsp; SQL Profiles (DBA_SQL_PROFILES):DBA_SQL_PROFILES\u4e2d\u6b64sql\u7684profiles<br \/>\n\t\t&nbsp;&nbsp;&nbsp; SQL Patches (DBA_SQL_PATCHES):DBA_SQL_PATCHES\u4e2d\u6b64sql\u7684\u76f8\u5173patches<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Cursor Sharing and Reason:GV$SQL_SHARED_CURSOR\u662f\u6b64sql\u7684cursor sharing<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Cursor Sharing List:GV$SQL_SHARED_CURSOR\u4e2d\u6b64sql\u7684cursor sharing<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Current Plans Summary (GV$SQL):GV$SQL\u4e2d\u6b64sql\u7684\u5e73\u5747\u6d88\u8017<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Current SQL Statistics (GV$SQL):GV$SQL\u4e2d\u6b64sql\u7684\u6d88\u8017<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Historical Plans Summary (DBA_HIST_SQLSTAT):DBA_HIST_SQLSTAT\u4e2d\u6b64sql\u7684\u5386\u53f2\u5e73\u5747\u6d88\u8017<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Historical SQL Statistics &#8211; Delta (DBA_HIST_SQLSTAT):DBA_HIST_SQLSTAT\u4e2d\u6b64sql\u7684\u5386\u53f2\u6d88\u8017<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Historical SQL Statistics &#8211; Total (DBA_HIST_SQLSTAT):DBA_HIST_SQLSTAT\u4e2d\u6b64sql\u7684\u5386\u53f2\u6d88\u8017<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Active Session History by Plan (GV$ACTIVE_SESSION_HISTORY):GV$ACTIVE_SESSION_HISTORY\u4e2d\u6b64sql\u7684session state\u7edf\u8ba1<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Active Session History by Plan Line (GV$ACTIVE_SESSION_HISTORY):GV$ACTIVE_SESSION_HISTORY\u4e2d\u6b64sql\u7684plan line\u7edf\u8ba1<br \/>\n\t\t&nbsp;&nbsp;&nbsp; AWR Active Session History by Plan (DBA_HIST_ACTIVE_SESS_HISTORY):DBA_HIST_ACTIVE_SESS_HISTORY\u4e2d\u6b64sql\u7684session state\u7edf\u8ba1<br \/>\n\t\t&nbsp;&nbsp;&nbsp; AWR Active Session History by Plan Line (DBA_HIST_ACTIVE_SESS_HISTORY):DBA_HIST_ACTIVE_SESS_HISTORY\u4e2d\u6b64sql\u7684plan line\u7edf\u8ba1<br \/>\n\t\t&nbsp;&nbsp;&nbsp; DBMS_STATS System Preferences:DBMS_STATS\u7cfb\u7edf\u53c2\u6570<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Tables:\u8868\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; DBMS_STATS Table Preferences:DBMS_STATS\u8868\u53c2\u6570<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Table Columns:\u5217\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Table Partitions:\u8868\u5206\u533a\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Table Constraints:\u8868\u4e0a\u7684\u7ea6\u675f\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Tables Statistics Versions:\u8868\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Indexes:\u7d22\u5f15\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Index Columns:\u7d22\u5f15\u5217\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Index Partitions:\u7d22\u5f15\u5206\u533a\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Indexes Statistics Versions:\u7d22\u5f15\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\n\t\t&nbsp;&nbsp;&nbsp; System Parameters with Non-Default or Modified Values:GV$SYSTEM_PARAMETER2\u4e2disdefault = &#39;FALSE&#39; OR ismodified != &#39;FALSE&#39;\u7684\u53c2\u6570<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Instance Parameters:V$SYSTEM_PARAMETER2\u4e2d\u7684\u7cfb\u7edf\u53c2\u6570<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Metadata:\u8868\u548c\u7d22\u5f15\u7684\u5efa\u7acb\u8bed\u53e5<br \/>\n\t\t3_execution_plans.html<br \/>\n\t\t&nbsp;&nbsp;&nbsp; SQL Text:\u8981\u68c0\u67e5\u7684sql\u6587\u672c<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Current Execution Plans (last execution):\u6309child cursor\u663e\u793a\u6b64sql\u7684\u5185\u5b58\u4e2d\u7684\u6267\u884c\u8ba1\u5212<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Current Execution Plans (all executions):\u6309child cursor\u663e\u793a\u6b64sql\u7684\u5185\u5b58\u4e2d\u7684\u6267\u884c\u8ba1\u5212<br \/>\n\t\t&nbsp;&nbsp;&nbsp; Historical Execution Plans:\u6309child cursor\u663e\u793a\u6b64sql\u7684awr\u7684\u6267\u884c\u8ba1\u5212<br \/>\n\t\t4_sql_detail.html<br \/>\n\t\t&nbsp;&nbsp; &nbsp;\u56fe\u5f62\u5316\u663e\u793asql\u7684\u8fd0\u884c\u7edf\u8ba1<br \/>\n\t\t5_sql_monitor.zip<br \/>\n\t\t&nbsp;&nbsp; &nbsp;\u56fe\u5f62\u5316\u663e\u793asql\u7684\u76d1\u63a7\u4fe1\u606f<br \/>\n\t\t6_10053_trace_from_cursor.trc<br \/>\n\t\t&nbsp;&nbsp; &nbsp;\u663e\u793asql\u768410053\u8ddf\u8e2a\u6587\u4ef6<br \/>\n\t\t8_sqldx.zip<br \/>\n\t\t&nbsp;&nbsp; &nbsp;sql health check\u6570\u636e\u6765\u6e90<br \/>\n\t\t9_log.zip<br \/>\n\t\t&nbsp;&nbsp; &nbsp;sql health check\u751f\u6210\u65e5\u5fd7<!--EndFragment-->\n\t<\/p>\n<p data-spm-anchor-id=\"a2c4e.11153940.blogcont283499.i7.676c7f37tpGU9s\">\n\t\t\u5bf9\u4e8eSQLHC\uff08SQL Health Check\uff0cSQL\u6027\u80fd\u5065\u5eb7\u68c0\u67e5\u811a\u672c\uff09\u5de5\u5177\uff0cMos\u6587\u68631626277.1\u6709\u975e\u5e38\u8be6\u7ec6\u7684\u4ecb\u7ecd\u3002SQLHC\u662fOracle Server Technologies Center of Expertise\u5f00\u53d1\u7684\u4e00\u4e2a\u5de5\u5177\u3002SQLHC\u7528\u4e8e\u68c0\u67e5\u5355\u6761SQL\u8bed\u53e5\u8fd0\u884c\u7684\u73af\u5883\uff0c\u5305\u62ec\u57fa\u4e8e\u6210\u672c\u7684\u4f18\u5316\u5668\uff08CBO\uff09\u7684\u7edf\u8ba1\u6570\u636e\uff0c\u7528\u6237\u5bf9\u8c61\u7684\u5143\u6570\u636e\u5b9a\u4e49\uff0c\u914d\u7f6e\u53c2\u6570\u548c\u5176\u5b83\u53ef\u80fd\u5f71\u54cd\u5230\u76ee\u6807SQL\u6027\u80fd\u7684\u56e0\u7d20\u3002SQLHC\u548cSQLT\u5de5\u5177\u4e00\u6837\uff0c\u672c\u8eab\u90fd\u662f\u514d\u8d39\u7684\uff0c\u4e0d\u9700\u8981\u4efb\u4f55\u8bb8\u53ef\u8bc1\uff08License\uff09\u3002\u5f53\u5bf9\u67d0\u4e00\u4e2aSQL_ID\u8fd0\u884cSQLHC\u540e\uff0c\u8be5\u811a\u672c\u4f1a\u751f\u6210\u4e00\u7cfb\u5217\u9488\u5bf9\u8be5SQL\u8bed\u53e5\u5065\u5eb7\u68c0\u67e5\u7684\u4e00\u4efdHTML\u62a5\u544a\u3002SQLHC\u4f1a\u68c0\u67e5\u7684\u5185\u5bb9\u5305\u62ec\uff1a\u2460\u3000\u5f85\u5206\u6790\u7684\u5355\u6761SQL\u6d89\u53ca\u7684\u7528\u6237\u5bf9\u8c61\u7684CBO\u7edf\u8ba1\u4fe1\u606f\uff1b\u2461\u3000CBO\u53c2\u6570\uff1b\u2462\u3000CBO\u7cfb\u7edf\u7edf\u8ba1\u4fe1\u606f\uff1b\u2463\u3000CBO\u6570\u636e\u5b57\u5178\u7edf\u8ba1\u4fe1\u606f\uff1b\u2464\u3000CBO\u56fa\u5b9a\u5bf9\u8c61\uff08Fixed-Objects\uff09\u7edf\u8ba1\u4fe1\u606f\u3002\n\t<\/p>\n<p>\n\t\tSQLHC\u8fd0\u884c\u65f6\u4e0d\u4f1a\u5728\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4efb\u4f55\u5bf9\u8c61\uff08&ldquo;\u6570\u636e\u5e93\u4e2d\u4e0d\u7559\u8db3\u8ff9&rdquo;\uff09\uff0c\u5b83\u53ea\u662f\u5bf9\u5df2\u6709\u7684\u5bf9\u8c61\u63d0\u4f9b\u62a5\u544a\u548c\u5efa\u8bae\uff0c\u53ef\u4ee5\u786e\u4fdd\u5b83\u5728\u6240\u6709\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002SQLHC\u7684\u811a\u672c\u9700\u8981\u4ee5SYS\u3001DBA\u6216\u8005\u80fd\u8bbf\u95ee\u6570\u636e\u5b57\u5178\u89c6\u56fe\u7684\u7528\u6237\u901a\u8fc7SQL*Plus\u8fde\u63a5\u8fd0\u884c\u3002SQLHC\u4e00\u5171\u5305\u542b3\u4e2a\u811a\u672c\uff0c\u5206\u522b\u4e3asqlhc.sql\u3001sqldx.sql\u548csqlhcxec.sql\uff0c\u5176\u4e2dsqlhc.sql\u91cc\u8fb9\u4f1a\u8c03\u7528sqldx.sql\u811a\u672c\u3002sqlhcxec.sql\u662f\u5355\u72ec\u6267\u884c\u7684\uff0c\u4e0d\u8fc7\u8be5\u811a\u672c\u9700\u8981\u8f93\u5165\u4e00\u4e2a\u811a\u672c\u6587\u4ef6\u4f5c\u4e3a\u5165\u53c2\uff0c\u800c\u4e14\u8be5\u811a\u672c\u6587\u4ef6\u53ef\u4ee5\u5305\u542b\u7ed1\u5b9a\u53d8\u91cf\u3002\n\t<\/p>\n<p>\n\t\t\u672c\u5730\u6d4b\u8bd5\uff1ahttp:\/\/blog.itpub.net\/28539951\/viewspace-2100920\/\n\t<\/p>\n<p>\n\t\tSQL \u6027\u80fd\u5065\u5eb7\u68c0\u67e5\u811a\u672c (SQLHC) (\u6587\u6863 ID 1626277.1)\n\t<\/p>\n<p>\n\t\t\u8868\u6536\u96c6\u4fe1\u606f\uff08\u9632\u6b62\u8fc7\u65e7\u4fe1\u606f\uff09\uff1a\n\t<\/p>\n<p>\n\t\tbegin<br \/>\n\t\t&nbsp; fnd_stats.GATHER_TABLE_STATS(&#39;SYS&#39;, &#39;TAB$&#39;);<br \/>\n\t\tend;\n\t<\/p>\n<p>\n\t\tEBS\u7cfb\u7edf\u6570\u636e\u5e93\u7edf\u8ba1\u4fe1\u606f\u6536\u96c6\u603b\u7ed3- gather_schema_stats [final]_ITPUB\u535a\u5ba2 <!--[if lt IE 9]>\n    <script src=\"https:\/\/oss.maxcdn.com\/html5shiv\/3.7.2\/html5shiv.min.js\"><\/script>\n    <script src=\"https:\/\/oss.maxcdn.com\/respond\/1.4.2\/respond.min.js\"><\/script>\n    <![endif]--><script src=\"https:\/\/hm.baidu.com\/hm.js?5016281862f595e78ffa42f085ea0f49\"><\/script><script src=\"http:\/\/push.zhanzhang.baidu.com\/push.js\"><\/script><script src=\"http:\/\/blog.itpub.net\/js\/jquery.js\"><\/script><script src=\"http:\/\/blog.itpub.net\/js\/base.js?v1.2\"><\/script><script src=\"http:\/\/blog.itpub.net\/layui\/layui.js\"><\/script><script src=\"http:\/\/blog.itpub.net\/js\/jquery.placeholder.min.js\" type=\"text\/javascript\"><\/script><script src=\"http:\/\/bdimg.share.baidu.com\/static\/api\/js\/share.js?v=89860593.js?cdnversion=429895\"><\/script> <!--StartFragment-->\n\t<\/p>\n<p>\n\t\t\u5206\u6790\u4e00\u4e2aSCEHMA (EBS\u7cfb\u7edf) :<br \/>\n\t\texec&nbsp; fnd_stats.GATHER_TABLE_STATS(&#39;PA&#39;);\n\t<\/p>\n<p>\n\t\t\u5206\u6790\u4e00\u4e2aSCEHMA (\u4e00\u822c\u7cfb\u7edf) :<br \/>\n\t\texec dbms_stats.gather_schema_stats(<br \/>\n\t\t\u3000\u3000ownname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; &#39;HRM&#39;,<br \/>\n\t\t\u3000\u3000options&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; &#39;GATHER AUTO&#39;,<br \/>\n\t\t\u3000\u3000estimate_percent =&gt; dbms_stats.auto_sample_size,<br \/>\n\t\t\u3000\u3000method_opt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; &#39;for all columns size repeat&#39;, &#8212; \u7a33\u5b9a\u540e\u63a8\u8350repeat<br \/>\n\t\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cascade&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt;TRUE,<br \/>\n\t\t\u3000\u3000degree&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 12<br \/>\n\t\t&nbsp;&nbsp;&nbsp; )\n\t<\/p>\n<p>\n\t\t&#8211;\u4e00\u5929\u5185\u6267\u884c\u7684sql\n\t<\/p>\n<p>\n\t\tselect a.*,b.*<br \/>\n\t\t&nbsp; from v$sqltext a, v$session b<br \/>\n\t\t&nbsp;where a.sql_id = b.sql_id<br \/>\n\t\t&nbsp; &nbsp;and b.logon_time between sysdate &#8211; 1 and sysdate;\n\t<\/p>\n<p>\n\t\t&nbsp;\n\t<\/p>\n<p>\n\t\tselect * from dba_hist_active_sess_history t;\n\t<\/p>\n<p>\n\t\t\u6269\u5c55\uff1a\n\t<\/p>\n<p>\n\t\tAll About the SQLT Diagnostic Tool (\u6587\u6863 ID 215187.1)\n\t<\/p>\n<p>\n\t\t<!--EndFragment-->\n\t<\/p>\n<\/form>\n<style afrres=\"true\" type=\"text\/css\">\ninput::-webkit-input-placeholder {\n                    color: #737373;\n                    font-style: italic;\n                    opacity: 1;\n            }\n            input::-moz-placeholder {\n                    color: #737373;\n                    font-style: italic;\n                    opacity: 1;\n            }\n            input:-moz-placeholder {   \/* Older versions of Firefox *\/\n                    color: #737373;\n                    font-style: italic;\n                    opacity: 1;\n            }\n            input:-ms-input-placeholder {\n                    color: #737373;\n                    font-style: italic;\n                    opacity: 1;\n            }<\/style>\n","protected":false},"excerpt":{"rendered":"<p>Applies to:&nbsp; Oracle Database &#8211; Personal Edit &hellip; <a href=\"https:\/\/www.llku.com\/?p=1414\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">SQL Tuning Health-Check Script (SQLHC)  (\u6587\u6863 ID 1366133.1)<\/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":[31,73],"tags":[229],"_links":{"self":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/1414"}],"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=1414"}],"version-history":[{"count":14,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/1414\/revisions"}],"predecessor-version":[{"id":1444,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/1414\/revisions\/1444"}],"wp:attachment":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}