use_stored_outlines为true,optimizer_use_sql_plan_baselines为true时,当为SQL语句选择执行计划时,stored outline的优先级比SQL执行计划基线高。如果在default目录中存在可以用于SQL语句的stored outline,那么数据库会使用stored outline,否则数据库使用SQL执行计划基线。
use_stored_outlines为category,optimizer_use_sql_plan_baselines为true时,当为SQL语句选择执行计划时,stored outline的优先级比SQL执行计划基线高。如果指定目录或default目录中存在可以用于SQL语句的stored outline,那么数据库会使用stored outline。否则,数据库会使用SQL执行计划基线。然而,如果stored outline有migrated属性,那么数据库不会使用outline,如果存在SQL执行计划基线,那么数据库会使用SQL执行计划基线。
在完成stored outline迁移后将数据库置于合适的状态:
1.检查迁移结果,看SQL执行计划基线是否已经创建,确保执行计划被启用与接受:
SQL> select sql_handle,plan_name,origin,enabled,accepted,fixed,module from dba_sql_plan_baselines;
SQL_HANDLE PLAN_NAME ORIGIN ENABLED ACCEPTED FIXED MODULE
------------------------------ ------------------------------ -------------- ------- -------- ----- --------------------------------
SQL_d0cb53f0573bcb74 SQL_PLAN_d1kumy1bmrkvnae69e7ae AUTO-CAPTURE YES YES NO emagent_SQL_oracle_database
SQL_9c0d7998b1d28680 SQL_PLAN_9s3btm2sx51n074830d3a AUTO-CAPTURE YES YES NO PL/SQL Developer
SQL_91430157076ba9df SQL_PLAN_92hs1aw3qrafzb96d21b9 AUTO-CAPTURE YES YES NO JDBC Thin Client
SQL_fbd80d3a7daa592f SQL_PLAN_grq0d79yunq9g3517892f AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_c9327c795e035d87 SQL_PLAN_ckcmwg5g06rc70298c760 AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_773b254f11d733b0 SQL_PLAN_7fft59w8xfcxh7d2358ba AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_952e0dafe13297d3 SQL_PLAN_9abhdpzhm55ymff175d6b AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_5bea1aec47de5c1d SQL_PLAN_5ruhuxj3xwr0x3517892f AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_11489cc82e27c733 SQL_PLAN_12k4wt0r2gjtmf1c17b40 AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_da9311fb2fec8c40 SQL_PLAN_dp4sjzcryt320849be660 AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_2097b7cb694841d0 SQL_PLAN_215xrtdnnhhfh35e87e58 AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_df059c6821f89598 SQL_PLAN_dy1cwd0hzj5cs35e87e58 AUTO-CAPTURE YES YES NO emagent_SQL_rac_database
SQL_94a4564ac1318120 SQL_PLAN_9992q9b0m30902f8b24ae AUTO-CAPTURE YES YES NO
SQL_fc093754bbae13fe SQL_PLAN_gs29rakxuw4zy37db554f AUTO-CAPTURE YES YES NO
SQL_2fd9b3dc9d848e02 SQL_PLAN_2zqdmvkfs93h25179cde9 AUTO-CAPTURE YES YES NO
SQL_73b82c249b7d0843 SQL_PLAN_77f1c4kdru223ebdc4e78 AUTO-CAPTURE YES YES NO
SQL_6184e8ed31386bf0 SQL_PLAN_63178xnsmhuzh561aa499 AUTO-CAPTURE YES YES NO
SQL_c42198d1d5f324f5 SQL_PLAN_c88csu7az697pebdc4e78 AUTO-CAPTURE YES YES NO
SQL_674112d2daaadf76 SQL_PLAN_6fh8kubdaprvq83c346df AUTO-CAPTURE YES YES NO
SQL_ffa1f1f91c5bca64 SQL_PLAN_gz8gjz4f5rkm4f59a06ad AUTO-CAPTURE YES YES NO
SQL_af180c8ff9a1d861 SQL_PLAN_ay60cjzwu3q3182cd7aee AUTO-CAPTURE YES YES NO
SQL_3ba02daa5cc73416 SQL_PLAN_3r81dp9fcfd0q94b64494 AUTO-CAPTURE YES YES NO
SQL_9cc94d4239925ef4 SQL_PLAN_9tkad88wt4rrn5976b5eb AUTO-CAPTURE YES YES NO
SQL_1dc6cbd35acb4efd SQL_PLAN_1vjqbuddcqmrx5d4b54d5 AUTO-CAPTURE YES YES NO
SQL_9ed410d70ee4f2fe SQL_PLAN_9xp0huw7f9wry2f8b24ae AUTO-CAPTURE YES YES NO
SQL_f7a25d7938972912 SQL_PLAN_gg8kxg4w9fa8kebdc4e78 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_90cda4f1c4064ca9 SQL_PLAN_91md4y720cm5924d38443 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_c42ff7e665ca18ec SQL_PLAN_c8bzrwtkwn67c55df0880 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_a56d8c52cbac8dc5 SQL_PLAN_aavccab5ut3f5a9b3d668 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_35a61a655e37564d SQL_PLAN_3b9hucpg3fpkd5454b1ea AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_ac3326a11f142cac SQL_PLAN_asct6n4gj8b5c76def5aa AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_581db5ae5093f1d2 SQL_PLAN_5h7dppt897wfk15aad75e AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_2531d59ec295a26c SQL_PLAN_2acfpmv19b8mc6943321d AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_09070338bc78471e SQL_PLAN_0k1s372y7hjsyebdc4e78 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_8bd89c2a8626630d SQL_PLAN_8rq4w5a32cssdd7a28287 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_c99cfd0ca0ec6d27 SQL_PLAN_cm77x1khfsv97e0d1d869 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_1178b3f40ee9079d SQL_PLAN_12y5myh7fk1wx7fa68824 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_30c826839bd031c7 SQL_PLAN_31k16hfdx0cf7ebdc4e78 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_75642813e87d55ba SQL_PLAN_7at182gn7upduc9e4a408 AUTO-CAPTURE YES NO NO SEVERITY EVALUATION
SQL_75642813e87d55ba SQL_PLAN_7at182gn7updu4d0fe611 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_0398f5dac9a26bd2 SQL_PLAN_0767pvb4u4uykaa9fb8f2 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_5bf2fdd320991dc8 SQL_PLAN_5rwrxuch9k7f815aad75e AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_faff45acb48c010c SQL_PLAN_gpzu5pku8s08c3b4f0583 AUTO-CAPTURE YES NO NO SEVERITY EVALUATION
SQL_faff45acb48c010c SQL_PLAN_gpzu5pku8s08c0a771b57 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_0edbf315864797cd SQL_PLAN_0xqzm2q34g5ydf06d473d AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_6807bab99db0361a SQL_PLAN_6h1xur6fv0dhu2e8a86b7 AUTO-CAPTURE YES YES NO PL/SQL Developer
SQL_1a45242d50349a41 SQL_PLAN_1nj945p8396k1c9e4a408 AUTO-CAPTURE YES NO NO SEVERITY EVALUATION
SQL_1a45242d50349a41 SQL_PLAN_1nj945p8396k14d0fe611 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_4c66704928a28228 SQL_PLAN_4stmh94na50j86943321d AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_7757ffeb83333a7e SQL_PLAN_7fpzzxf1m6fmy68d74995 AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_17c90a44687b6622 SQL_PLAN_1gk8a8jn7qtj26943321d AUTO-CAPTURE YES YES NO SEVERITY EVALUATION
SQL_6d5efcdbb0af4493 SQL_PLAN_6urrwvfsayj4m4efadb75 AUTO-CAPTURE YES YES NO
SQL_2c0bedfc971b5441 SQL_PLAN_2s2zdzkbjqp212f8b24ae AUTO-CAPTURE YES YES NO OEM.BoundedPool
SQL_fc7e68bc886477c5 SQL_PLAN_gszm8rk468xy5f4b84801 AUTO-CAPTURE YES YES NO OEM.BoundedPool
SQL_9425c7639bc97782 SQL_PLAN_989f7cfdwkxw245768591 AUTO-CAPTURE YES YES NO OEM.BoundedPool
SQL_1205bbc63c6b2eeb SQL_PLAN_141dvssy6qbrb47a21cb4 AUTO-CAPTURE YES YES NO OEM.BoundedPool
SQL_1367e948428a55f2 SQL_PLAN_16tz99118npgk7a54464c AUTO-CAPTURE YES YES NO emagent_SQL_oracle_database
SQL_a47e7f9f186b16f8 SQL_PLAN_a8zmzmwc6q5rs799d6e65 AUTO-CAPTURE YES YES NO emagent_SQL_oracle_database
SQL_03d675f2172c4dff SQL_PLAN_07pmpy8bksmgz6d032274 AUTO-CAPTURE YES YES NO emagent_SQL_oracle_database
59 rows selected