profile

简介: SQL> declare 2 v_hints sys.sqlprof_attr; 3 begin 4 v_hints:=sys.sqlprof_attr('full(test)'); 5 dbms_sqltune.

SQL> declare
2 v_hints sys.sqlprof_attr;
3 begin
4 v_hints:=sys.sqlprof_attr('full(test)');
5 dbms_sqltune.import_sql_profile('select * from ovsee.test where id =1',
6 v_hints,'SQLPROFILE_NAME1',force_match=>true);
7 end;
8 /

PL/SQL procedure successfully completed.

SQL> set autotrace trace explain;
SQL> select * from ovsee.test where id =1;

Execution Plan

Plan hash value: 3230054581



| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time |



| 0 | SELECT STATEMENT | | 1 | 35 | 1 (0)|
00:00:01 |

| 1 | TABLE ACCESS BY INDEX ROWID| TEST | 1 | 35 | 1 (0)|
00:00:01 |

|* 2 | INDEX RANGE SCAN | IDX_TEST_ID | 1 | | 1 (0)|
00:00:01 |



Predicate Information (identified by operation id):

2 - access("ID"=1)

Note

  • dynamic sampling used for this statement (level=2)
  • SQL profile "SQLPROFILE_NAME1" used for this statement

SQL> select /+full(test)/ * from ovsee.test where id =1;

no rows selected

SQL> select * from table(dbms_xplan.display_cursor(null,null,'outline'));

PLAN_TABLE_OUTPUT

SQL_ID gh3h5nq2zcw7d, child number 0

select /+full(test)/ * from ovsee.test where id =1

Plan hash value: 217508114


| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

| 0 | SELECT STATEMENT | | | | 2 (100)| |

|* 1 | TABLE ACCESS FULL| TEST | 1 | 35 | 2 (0)| 00:00:01 |

Outline Data

/*+

  BEGIN_OUTLINE_DATA
  IGNORE_OPTIM_EMBEDDED_HINTS
  OPTIMIZER_FEATURES_ENABLE('11.2.0.4')
  DB_VERSION('11.2.0.4')
  OPT_PARAM('_b_tree_bitmap_plans' 'false')
  ALL_ROWS
  OUTLINE_LEAF(@"SEL$1")
  FULL(@"SEL$1" "TEST"@"SEL$1")
  END_OUTLINE_DATA

*/

Predicate Information (identified by operation id):

1 - filter("ID"=1)

Note

  • dynamic sampling used for this statement (level=2)

37 rows selected.

SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL> declare
2 v_hints sys.sqlprof_attr;
3 begin
4 v_hints:=sys.sqlprof_attr('FULL(@"SEL$1" "TEST"@"SEL$1")');
5 dbms_sqltune.import_sql_profile('select * from ovsee.test where id =1',
6 v_hints,'SQLPROFILE_NAME1',force_match=>true,replace=>true);
7 end;
8 /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> select * from ovsee.test where id =1;

no rows selected

SQL> select * from table(dbms_xplan.display_cursor(null,null,'outline'));

PLAN_TABLE_OUTPUT

SQL_ID gnrk70cay86mf, child number 0

select * from ovsee.test where id =1

Plan hash value: 217508114


| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |

| 0 | SELECT STATEMENT | | | | 2 (100)| |

|* 1 | TABLE ACCESS FULL| TEST | 1 | 35 | 2 (0)| 00:00:01 |

Outline Data

/*+

  BEGIN_OUTLINE_DATA
  IGNORE_OPTIM_EMBEDDED_HINTS
  OPTIMIZER_FEATURES_ENABLE('11.2.0.4')
  DB_VERSION('11.2.0.4')
  OPT_PARAM('_b_tree_bitmap_plans' 'false')
  ALL_ROWS
  OUTLINE_LEAF(@"SEL$1")
  FULL(@"SEL$1" "TEST"@"SEL$1")
  END_OUTLINE_DATA

*/

Predicate Information (identified by operation id):

1 - filter("ID"=1)

Note

  • dynamic sampling used for this statement (level=2)
  • SQL profile SQLPROFILE_NAME1 used for this statement

38 rows selected.

SQL>

目录
相关文章
|
4月前
|
Shell Linux
bashrc和profile区别
bashrc和profile区别
31 1
|
4月前
|
搜索推荐 关系型数据库 MySQL
/etc/profile,/etc/bashrc,~/.profile,~/.bashrc 的区别及使用
/etc/profile,/etc/bashrc,~/.profile,~/.bashrc 的区别及使用
33 0
|
5月前
|
Java Maven 数据库
|
存储 编解码 监控
h264与x264支持的Profile
h264与x264支持的Profile
141 0
|
Java 测试技术 开发者
Profile 配置|学习笔记
快速学习 Profile 配置
337 0
Profile 配置|学习笔记
|
Shell 数据安全/隐私保护
profile,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part 2
profile,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part 2
86 0
|
Shell Linux Go
Linux profile1,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part1
Linux profile1,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part1
104 0
|
Shell Linux
/etc/profile和~/.bash_profile的区别与联系
/etc/profile 为系统的每个用户设置环境信息和启动程序,当用户第一次登录时,该文件被执行,其配置对所有登录的用户都有效。当被修改时,必须重启才会生效。
3494 0
|
Shell Unix