{"id":15742,"date":"2023-12-04T22:15:30","date_gmt":"2023-12-04T14:15:30","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=15742"},"modified":"2023-12-04T22:19:42","modified_gmt":"2023-12-04T14:19:42","slug":"oracle-zhong-ru-he-wen-ding-gu-ding-zhi-xing-ji","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/04\/oracle-zhong-ru-he-wen-ding-gu-ding-zhi-xing-ji\/","title":{"rendered":"Oracle \u4e2d\u5982\u4f55\u7a33\u5b9a\uff08\u56fa\u5b9a\uff09\u6267\u884c\u8ba1\uff1f"},"content":{"rendered":"<p>\u5728 Oracle \u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 &quot;Outline&quot;\uff08\u5927\u7eb2\uff09\u6216 &quot;SQL Plan Management&quot;\uff08SQL \u8ba1\u5212\u7ba1\u7406\uff09\u7b49\u65b9\u6cd5\u6765\u7a33\u5b9a\uff08\u56fa\u5b9a\uff09\u6267\u884c\u8ba1\u5212\u3002<\/p>\n<h3><a id=\"%E4%BD%BF%E7%94%A8outline%E7%A8%B3%E5%AE%9A%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92%EF%BC%9A\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u4f7f\u7528 Outline \u7a33\u5b9a\u6267\u884c\u8ba1\u5212\uff1a<\/h3>\n<ol>\n<li>\n<strong>\u751f\u6210 Outline\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 <code>DBMS_OUTLN.CREATE_OUTLINE<\/code> \u8fc7\u7a0b\u751f\u6210\u5927\u7eb2\u3002\u5927\u7eb2\u662f\u4e00\u7ec4\u63d0\u793a\uff0c\u53ef\u4ee5\u6307\u5bfc\u4f18\u5316\u5668\u9009\u62e9\u7279\u5b9a\u7684\u6267\u884c\u8ba1\u5212\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5e94\u7528 Outline\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 <code>ALTER SESSION<\/code> \u6216 <code>ALTER SYSTEM<\/code> \u547d\u4ee4\u5e94\u7528\u5927\u7eb2\uff0c\u4f7f\u4e4b\u6210\u4e3a\u4f1a\u8bdd\u6216\u7cfb\u7edf\u7ea7\u522b\u7684\u63d0\u793a\u3002<\/li>\n<li>\u4f8b\u5982\uff1a<code>ALTER SESSION SET USE_PRIVATE_OUTLINES = TRUE;<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3><a id=\"%E4%BD%BF%E7%94%A8sql-plan-management%E7%A8%B3%E5%AE%9A%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92%EF%BC%9A\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u4f7f\u7528 SQL Plan Management \u7a33\u5b9a\u6267\u884c\u8ba1\u5212\uff1a<\/h3>\n<ol>\n<li>\n<strong>\u6536\u96c6\u6267\u884c\u8ba1\u5212\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 <code>DBMS_SQLTUNE<\/code> \u5305\u4e2d\u7684 <code>CREATE_SQL_PROFILE<\/code> \u8fc7\u7a0b\uff0c\u6216\u8005\u4f7f\u7528 SQL Performance Analyzer \u5de5\u5177\uff0c\u6536\u96c6 SQL \u8bed\u53e5\u7684\u6267\u884c\u8ba1\u5212\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u521b\u5efa SQL Profile\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 <code>DBMS_SQLTUNE<\/code> \u5305\u4e2d\u7684 <code>CREATE_SQL_PROFILE<\/code> \u8fc7\u7a0b\u4e3a SQL \u8bed\u53e5\u521b\u5efa SQL Profile\uff0c\u8be5 Profile \u5305\u542b\u4e86\u5efa\u8bae\u7684\u6267\u884c\u8ba1\u5212\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u542f\u7528 SQL Plan Baseline\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 <code>DBMS_SPM<\/code> \u5305\u4e2d\u7684\u8fc7\u7a0b\uff0c\u542f\u7528 SQL Plan Baseline\uff0c\u786e\u4fdd Oracle \u5728 SQL \u8bed\u53e5\u7684\u6267\u884c\u8ba1\u5212\u4e2d\u9009\u62e9\u6700\u4f73\u7684\u8ba1\u5212\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u8fd9\u4e24\u79cd\u65b9\u6cd5\u90fd\u6709\u52a9\u4e8e\u7a33\u5b9a\u6267\u884c\u8ba1\u5212\uff0c\u4f46\u5177\u4f53\u9009\u62e9\u53d6\u51b3\u4e8e\u4f60\u7684\u9700\u6c42\u548c\u73af\u5883\u3002\u4f7f\u7528 Outline \u9700\u8981\u66f4\u591a\u7684\u624b\u52a8\u7ba1\u7406\uff0c\u800c SQL Plan Management \u5229\u7528\u81ea\u52a8\u4efb\u52a1\u8fdb\u884c\u7ba1\u7406\uff0c\u66f4\u52a0\u81ea\u52a8\u5316\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Oracle \u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 &quot;Outline&quot;\uff08\u5927\u7eb2\uff09\u6216 &quot;SQL Pla [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[120],"tags":[],"class_list":["post-15742","post","type-post","status-publish","format-standard","hentry","category-oracel"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=15742"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15742\/revisions"}],"predecessor-version":[{"id":15743,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15742\/revisions\/15743"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=15742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=15742"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=15742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}