当前位置: 首页 > 调优 > 正文

Migrating Stored Outlines to SQL Plan Baselines

测试环境:11.2.0.3.0

 

欢迎大家加入ORACLE超级群:17115662 免费解决各种ORACLE问题,以后BLOG将迁移到http://www.htz.pw

 

1,创建一个Outline

SQL> create outline outline_test on select count(*) from scott.test where owner=’SCOTT’;

 

Outline created.

2,开始迁移

SQL> var rpt clob;

SQL> set serveroutput on;

SQL> exec :rpt := dbms_spm.migrate_stored_outline(attribute_name => ‘CATEGORY’, attribute_value => ‘DEFAULT’);

 

PL/SQL procedure successfully completed.

 

3,迁移后,确认是否迁移成功

SQL> select name,migrated from dba_outlines;

 

NAME                          MIGRATED

—————————– ————

OUTLINE_TEST                  MIGRATED

 

这里可以发现migrated已经标记为migrated,下次迁移的时候就不会再迁移了。

 

SQL> @sql_spm.sql

SQL> set echo off

 

                                                                             ENABLE:ACCTPE

                                                                             FIXED                         PARSING         CREATED

SQL_HANDLE                     PLAN_NAME                      ORIGIN         AUTOPURGE                COST SCHEMA          MODIFIED          SQL_TEXT

—————————— —————————— ————– ——————– ——– ————— —————– ————————————————–

SQL_2f030a70eeeec40f           OUTLINE_TEST                   STORED-OUTLINE YES.YES.NO.NO               8 SYS             11-23 05.11-23 05 select count(*) from scott.test where owner=’SCOTT

                                                                                                                                            

本文固定链接: http://www.htz.pw/2014/06/26/migrating-stored-outlines-to-sql-plan-baselines.html | 认真就输

该日志由 huangtingzhong 于2014年06月26日发表在 调优 分类下, 通告目前不可用,你可以至底部留下评论。
原创文章转载请注明: Migrating Stored Outlines to SQL Plan Baselines | 认真就输