{"id":258599,"date":"2022-12-30T09:55:57","date_gmt":"2022-12-30T01:55:57","guid":{"rendered":"https:\/\/gulass.cn\/?p=258599"},"modified":"2022-12-04T11:56:38","modified_gmt":"2022-12-04T03:56:38","slug":"sql-profile-does-not-work","status":"publish","type":"post","link":"https:\/\/gulass.cn\/sql-profile-does-not-work.html","title":{"rendered":"SQL Profile\u4e0d\u8d77\u4f5c\u7528\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5bf9\u4e8eSQL PROFILE\u548cSQL PLAN BASELINE\uff0c\u5982\u679c\u9009\u62e9\u9519\u8bef\uff0c\u5c31\u5f88\u5bb9\u6613\u5f15\u53d1\u4e0d\u53ef\u9884\u77e5\u7684\u9690\u60a3\uff0c\u56e0\u6b64\u9700\u8981\u5341\u5206\u8c28\u614e\u7684\u9009\u62e9\u3002Oracle\u5efa\u8bae\u901a\u8fc7SPM\u7684\u5efa\u8bae\u6765\u9009\u62e9\uff0c\u800c\u4e0d\u8981\u4f9d\u9760DBA\u7684\u81ea\u5df1\u5224\u65ad\u6765\u9009\u62e9\uff0c\u4ece\u800c\u907f\u514d\u9519\u8bef\u4f7f\u7528\u3002\u4e0d\u8fc7\u6211\u89c9\u5f97\u9047\u5230\u7c7b\u4f3c\u95ee\u9898\uff0c\u5f80\u5f80\u90fd\u548c\u7d22\u5f15\u8bbe\u8ba1\u6bd4\u8f83\u6df7\u4e71\u6709\u5173\uff0c\u4f18\u5316\u7d22\u5f15\u8bbe\u8ba1\u53ef\u4ee5\u4ece\u66f4\u4e0a\u6e38\u53bb\u89e3\u51b3\u6b64\u7c7b\u95ee\u9898\u3002\u200b<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u6709\u4e2a\u5ba2\u6237\u524d\u9635\u5b50\u4e00\u6761SQL\u56e0\u4e3a\u7edf\u8ba1\u4fe1\u606f\u95ee\u9898\u8d70\u9519\u6267\u884c\u8ba1\u5212\uff0c\u5bfc\u81f4CPU\u8d44\u6e90\u8017\u5c3d\uff0c\u7cfb\u7edf\u51fa\u73b0\u4e25\u91cd\u6545\u969c\uff0c\u5fc5\u987b\u4e0b\u7ebf\u90e8\u5206\u529f\u80fd\u624d\u4e34\u65f6\u89e3\u51b3\u4e86\u95ee\u9898\uff0c\u540e\u6765\u5728\u5f00\u53d1\u5546\u7684\u5c1d\u8bd5\u4e0b\u901a\u8fc7SQL PROFILE\u89e3\u51b3\u4e86\u9519\u8bef\u6267\u884c\u8ba1\u5212\u7684\u95ee\u9898\uff0c\u6062\u590d\u4e86\u7cfb\u7edf\u3002\u4e8b\u540e\u8fdc\u7a0b\u5065\u5eb7\u670d\u52a1\u4e2d\u5fc3\u3001Oracle\u539f\u5382\u90fd\u53c2\u4e0e\u4e86\u6545\u969c\u603b\u7ed3\uff0c\u90fd\u8ba4\u4e3a\u662f\u56e0\u4e3a\u7edf\u8ba1\u4fe1\u606f\u4e0d\u51c6\u5bfc\u81f4\u4e86\u6267\u884c\u8ba1\u5212\u9519\u8bef\u3002\u5f53\u65f6\u6211\u4e5f\u63d0\u51fa\u4e86\u4e00\u4e2a\u66f4\u4e3a\u5f7b\u5e95\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u5c31\u662f\u5408\u5e76USERID\u548c\u65e5\u671f\u7684\u4e24\u4e2a\u7d22\u5f15\u4e3a\u590d\u5408\u7d22\u5f15\uff0c\u4e0d\u8fc7\u56e0\u4e3a\u8be5\u8868\u592a\u5927\uff0c\u5f00\u53d1\u5546\u4e0d\u592a\u613f\u610f\u91cd\u5efa\u7d22\u5f15\uff0c\u6240\u4ee5\u5c31\u6ca1\u6709\u6267\u884c\u3002<\/p>\n

\u8fd9\u4e2a\u95ee\u9898\u4e00\u822c\u6bd4\u8f83\u591a\u7684\u51fa\u5728\u6708\u5e95\u6708\u521d\uff0c\u53ea\u8981\u4ea7\u751f\u4e86\u786c\u89e3\u6790\u5c31\u5bb9\u6613\u51fa\u95ee\u9898\u3002\u81ea\u4ece\u52a0\u4e86SQL PROFILE\u4e5f\u6d88\u505c\u4e86\u4e00\u9635\u5b50\u3002\u4e0d\u8fc7\u6628\u5929\u53c8\u51fa\u95ee\u9898\u4e86\u3002<\/p>\n

\"\"<\/p>\n

\u65e9\u4e0a\u7a81\u7136CPU\u98d9\u5347\u5230100%\uff0c\u56e0\u4e3a\u51fa\u8fc7\u7c7b\u4f3c\u95ee\u9898\uff0c\u6240\u4ee5\u5f88\u5feb\u5c31\u6000\u7591\u5230\u4e86\u8fd9\u6761SQL\u4e0a\u4e86\u3002\u505a\u4e2aAWRSQRPT\u53d1\u73b0\u786e\u5b9e\u5b58\u5728\u4e24\u4e2a\u6267\u884c\u8ba1\u5212\uff0c\u53c8\u6709SQL\u7528\u9519\u7d22\u5f15\u4e86\uff0c\u4f3c\u4e4eSQL PROFILE\u6ca1\u8d77\u4f5c\u7528\u4e86\u3002<\/p>\n

\u6545\u969c\u62a5\u5230\u8fdc\u7a0b\u5065\u5eb7\u670d\u52a1\u4e2d\u5fc3\u7684\u65f6\u5019\uff0c\u6211\u4eec\u7684\u652f\u6491\u4eba\u5458\u5efa\u8bae\u4ed6\u4eec\u7528SQL PLAN BASELINE\u56fa\u5316\u6267\u884c\u8ba1\u5212\uff0c\u5f88\u5feb\u5c31\u6062\u590d\u4e86\u7cfb\u7edf\u3002\u867d\u7136\u95ee\u9898\u89e3\u51b3\u7684\u5f88\u5feb\uff0c\u4e0d\u8fc7\u7528\u6237\u8fd8\u662f\u6709\u4e9b\u7591\u95ee\uff0c\u4e3a\u4ec0\u4e48\u4e0a\u56de\u51fa\u95ee\u9898\u65f6\u5019\uff0c\u7814\u53d1\u90e8\u95e8\u91c7\u53d6\u7684\u901a\u8fc7SQL PROFILE\u4f18\u5316\u6267\u884c\u8ba1\u5212\u7684\u7b56\u7565\u5931\u6548\u4e86\u3002<\/p>\n

\u5b9e\u9645\u4e0a\u7528\u6237\u662f\u628aSQL PROFILE\u5f53\u6210\u7ed1\u5b9a\u6267\u884c\u8ba1\u5212\u4e86\uff0c\u5176\u5b9e\u4ece\u539f\u7406\u4e0a\u8bb2\uff0cSQL PROFILE\u5e76\u4e0d\u662f\u5f3a\u884c\u7ed1\u5b9a\u6267\u884c\u8ba1\u5212\uff0c\u800c\u662f\u901a\u8fc7SPM\u5206\u6790\u53d1\u73b0\u7edf\u8ba1\u4fe1\u606f\u4e0e\u5b9e\u9645\u8fd0\u884c\u60c5\u51b5\u4e0d\u7b26\uff0c\u56e0\u6b64\u901a\u8fc7SQL PROFILE\u8bbe\u7f6e\u4e86\u4e00\u4e9bTABLE_STATS hint\uff0c\u4ece\u800c\u8ba9\u4f18\u5316\u5668\u53ef\u4ee5\u4f7f\u7528\u66f4\u4e3a\u7cbe\u51c6\u7684\u751f\u6210\u6267\u884c\u8ba1\u5212\u3002\u4e0b\u9762\u8fd9\u5f20\u56fe\u6765\u81ea\u4e8eOracle\u7684\u5b98\u65b9\u6587\u6863\uff0c\u53ef\u4ee5\u5f88\u597d\u7684\u89e3\u91caSQL PROFILE\u53d1\u6325\u4f5c\u7528\u7684\u673a\u7406\u3002<\/p>\n

\"\"<\/p>\n

\u5728SQL PROFILE\u63d0\u4f9b\u7684HINT\u4e2d\uff0c\u5e76\u6ca1\u6709\u6307\u5b9a\u6267\u884c\u8ba1\u5212\u7684\u5185\u5bb9\uff0c\u800c\u53ea\u662f\u8bbe\u5b9a\u4e86\u4e00\u4e9b\u7edf\u8ba1\u4fe1\u606f\u7684\u7ea0\u6b63\u63d0\u793a\u3002\u56e0\u6b64\u8bbe\u7f6e\u4e86SQL PROFILE\u7684SQL\u8bed\u53e5\uff0cSQL\u89e3\u6790\u7684\u65f6\u5019\uff0c\u4f1a\u4f7f\u7528PROFILE\u4e2d\u7684\u5bf9\u8c61\u7684\u7edf\u8ba1\u4fe1\u606f\u6765\u7ea0\u6b63\u6267\u884c\u8ba1\u5212\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u7075\u6d3b\uff0c\u6bd4\u5982\u67d0\u5f20\u8868\u4e0a\u7684\u7d22\u5f15\u4fee\u6539\u4e86\u3002\u8fd9\u6761SQL\u89e3\u6790\u7684\u65f6\u5019\u4f1a\u8003\u8651\u8fd9\u4e9b\u56e0\u7d20\uff0c\u9009\u62e9\u8f83\u597d\u7684\u6267\u884c\u8ba1\u5212\u3002\u4e0d\u8fc7\u4e5f\u6709\u4e0d\u597d\u7684\u5730\u65b9\uff0c\u90a3\u5c31\u662f\u67d0\u4e9b\u65f6\u5019\uff0c\u6267\u884c\u8ba1\u5212\u8fd8\u662f\u4f1a\u9519\u8bef\u3002<\/p>\n

SQL PROFILE\u662fOracle 10g\u5f15\u5165\u7684\u65b0\u529f\u80fd\uff0c\u4ece11g\u5f00\u59cb\uff0cOracle\u4e5f\u770b\u5230\u4e86SQL PROFILE\u5b58\u5728\u7684\u4e0d\u8db3\uff0c\u56e0\u6b64\u5f15\u5165\u4e86\u4e00\u4e2a\u65b0\u7684\u529f\uff0cSQL PLAN BASELINE\u3002SQL PLAN BASE LINE\u7684\u4f5c\u7528\u4e0eSQL PROFILE\u7c7b\u4f3c\uff0c\u4e0d\u8fc7\u91c7\u53d6\u7684\u65b9\u6cd5\u5b8c\u5168\u4e0d\u540c\u3002\u6309\u7167ORACLE\u5b98\u65b9\u6587\u6863\u4e0a\u7684\u8bf4\u6cd5\uff0cSQL PLAN BASELINE\u662f\u7528\u4e8e\u907f\u514d\u5b58\u5728\u95ee\u9898\u7684\u6267\u884c\u8ba1\u5212\u7684\u3002SQL PLAN BASELINE\u91c7\u53d6\u7684\u662f\u5f3a\u884c\u7ed1\u5b9a\u6267\u884c\u8ba1\u5212\u7684\u65b9\u5f0f\u3002<\/p>\n

\"\"<\/p>\n

\u4e0a\u9762\u8fd9\u5f20\u56fe\u4e5f\u6765\u81ea\u4e8eOracle\u7684\u5b98\u65b9\u6587\u6863\uff0c\u8fd9\u5f20\u56fe\u5341\u5206\u6e05\u6670\uff0c\u4ece\u4e0a\u9762\u6211\u4eec\u53ef\u4ee5\u770b\u51fa\uff0cSQL PROFILE\u662f\u7528\u4e8e\u7ea0\u6b63\u8fc7\u53bb\u9519\u8bef\u7684\u6267\u884c\u8ba1\u5212\u7684\uff0c\u4f46\u662f\u5e76\u4e0d\u9650\u5b9a\u4eca\u540e\u4e0d\u4f1a\u518d\u6b21\u4f7f\u7528\u8fd9\u4e2a\u9519\u8bef\u7684\u6267\u884c\u8ba1\u5212\u3002\u800cSQL PLAN BASELINE\u662f\u7528\u4e8e\u786e\u4fdd\u4ee5\u540e\u4e0d\u4f1a\u4f7f\u7528\u9519\u8bef\u7684\u6267\u884c\u8ba1\u5212\u7684\u3002<\/p>\n

SQL PLAN BASELINE\u662f\u4e00\u7ec4\u53ef\u63a5\u53d7\u7684\u8ba1\u5212\u3002\u6bcf\u4e2a\u8ba1\u5212\u90fd\u4f7f\u7528\u4e00\u7ec4Outline hint\u6765\u5b9e\u73b0\uff0c\u8fd9\u4e9bhint\u6307\u5b9a\u4e86\u7279\u5b9a\u7684\u8ba1\u5212\u3002\u800c\u4e0e\u4e4b\u4e0d\u540c\u7684\u662f\uff0cSQL PROFILE\u4e5f\u4f7f\u7528hint\u5b9e\u73b0\uff0c\u4f46\u8fd9\u4e9bhint\u6ca1\u6709\u6307\u5b9a\u4efb\u4f55\u7279\u5b9a\u7684\u8ba1\u5212\uff0c\u4ec5\u4ec5\u7ea0\u6b63\u4e86\u4f18\u5316\u5668\u4f30\u7b97\u6210\u672c\u65f6\u4ea7\u751f\u7684\u9519\u8bef\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n

\u56e0\u4e3aSQL PROFILE\u4e0d\u4f1a\u5c06\u4f18\u5316\u5668\u7ea6\u675f\u5230\u4efb\u4f55\u4e00\u4e2a\u8ba1\u5212\uff0c\u6240\u4ee5SQL PROFILE\u6bd4SQL PLAN BASELINE\u66f4\u7075\u6d3b\u3002\u521d\u59cb\u5316\u53c2\u6570\u548c\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u7684\u66f4\u6539\u4f7f\u4f18\u5316\u5668\u80fd\u591f\u9009\u62e9\u66f4\u597d\u7684\u8ba1\u5212\u3002\u800cSQL PLAN BASELINE\u4e00\u65e6\u8bbe\u5b9a\uff0c\u90a3\u4e48\u4eca\u540e\u8fd9\u6761SQL\u5c31\u53ea\u80fd\u4f7f\u7528\u4e00\u4e2a\u56fa\u5b9a\u7684\u6267\u884c\u8ba1\u5212\u4e86\u3002\u5f53\u67d0\u6761SQL\u6839\u636e\u7ed1\u5b9a\u53d8\u91cf\u7684\u4e0d\u540c\u4f1a\u6709\u591a\u4e2a\u4e0d\u540c\u7684\u6700\u4f18\u6267\u884c\u8ba1\u5212\u7684\u65f6\u5019\uff0cSQL PROFILE\u53ef\u4ee5\u5145\u5206\u53d1\u6325\u5176\u7075\u6d3b\u6027\u3002\u4f46\u662fSQL PROFILE\u4f1a\u6709\u4e00\u5b9a\u7684\u51fa\u9519\u7684\u53ef\u80fd\u6027\u3002<\/p>\n

SQL PLAN BASELINE\u5c31\u7b80\u5355\u7c97\u66b4\u7684\u591a\u4e86\uff0c\u5b83\u662f\u5f3a\u5236\u6307\u5b9a\u6267\u884c\u8ba1\u5212\u3002\u8fd9\u5bf9\u4e8e\u67d0\u6761SQL\u53ea\u6709\u4e00\u4e2a\u552f\u4e00\u7684\u6700\u4f18\u6267\u884c\u8ba1\u5212\u7684\u65f6\u5019\u662f\u6700\u4e3a\u6709\u6548\u7684\u3002\u4e0d\u8fc7\u5b83\u7684\u7f3a\u9677\u662f\u7f3a\u4e4f\u7075\u6d3b\u6027\u3002<\/p>\n

\u5bf9\u4e8eSQL PROFILE\u548cSQL PLAN BASELINE\uff0c\u5982\u679c\u9009\u62e9\u9519\u8bef\uff0c\u5c31\u5f88\u5bb9\u6613\u5f15\u53d1\u4e0d\u53ef\u9884\u77e5\u7684\u9690\u60a3\uff0c\u56e0\u6b64\u9700\u8981\u5341\u5206\u8c28\u614e\u7684\u9009\u62e9\u3002Oracle\u5efa\u8bae\u901a\u8fc7SPM\u7684\u5efa\u8bae\u6765\u9009\u62e9\uff0c\u800c\u4e0d\u8981\u4f9d\u9760DBA\u7684\u81ea\u5df1\u5224\u65ad\u6765\u9009\u62e9\uff0c\u4ece\u800c\u907f\u514d\u9519\u8bef\u4f7f\u7528\u3002\u4e0d\u8fc7\u6211\u89c9\u5f97\u9047\u5230\u7c7b\u4f3c\u95ee\u9898\uff0c\u5f80\u5f80\u90fd\u548c\u7d22\u5f15\u8bbe\u8ba1\u6bd4\u8f83\u6df7\u4e71\u6709\u5173\uff0c\u4f18\u5316\u7d22\u5f15\u8bbe\u8ba1\u53ef\u4ee5\u4ece\u66f4\u4e0a\u6e38\u53bb\u89e3\u51b3\u6b64\u7c7b\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6709\u4e2a\u5ba2\u6237\u524d\u9635\u5b50\u4e00\u6761SQL\u56e0\u4e3a\u7edf\u8ba1\u4fe1\u606f\u95ee\u9898\u8d70\u9519\u6267\u884c\u8ba1\u5212\uff0c\u5bfc\u81f4CPU\u8d44\u6e90\u8017\u5c3d\uff0c\u7cfb\u7edf\u51fa\u73b0\u4e25\u91cd\u6545\u969c\uff0c\u5fc5\u987b\u4e0b\u7ebf\u90e8\u5206\u529f\u80fd\u624d […]<\/p>\n","protected":false},"author":1898,"featured_media":258603,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[963],"class_list":["post-258599","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread","tag-sql-profile"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/258599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1898"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=258599"}],"version-history":[{"count":1,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/258599\/revisions"}],"predecessor-version":[{"id":258604,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/258599\/revisions\/258604"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/258603"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=258599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=258599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=258599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}