KNOWLEDGE SHARING: EASY SQLPROFILE HOW TO

上一篇 / 下一篇  2011-12-20 15:29:15

For the sql-profile, we usually do it via dbms_sqltune system package or simply do it through OEM. Here we have another more straight forward approach.
There is a scripts under sqlt,e.g
 
This sql can help us to generate sql-profile very easy:
coe_xfr_sql_profile.sql <sql_id> <good_plan_hash_value>
for the sql_id,good_plan_hash_value, I believe you can find it from the ourput of sqltrend.
As a result, another sql file will be generated,e,g
Run coe_xfr_sql_profile.sql g7scs5vbfrta8 317069062  as a result, coe_xfr_sql_profile_g7scs5vbfrta8_317069062.sql will be generated.
You can simply run the sql generated to apply the new sql-profile. And further more, in the new profile, you will be told how to rollback this change:
e.g
REM PARAMETERS
REM   None.
REM
REM EXAMPLE
REM   SQL> START coe_xfr_sql_profile_g7scs5vbfrta8_317069062.sql;
REM
REM NOTES
REM   1. Should be run as SYSTEM or SYSDBA.
REM   2. User must have CREATE ANY SQL PROFILE privilege.
REM   3. SOURCE and TARGET systems can be the same or similar.
REM   4. To drop this custom SQL Profile after it has been created:
REM      EXEC DBMS_SQLTUNE.DROP_SQL_PROFILE('coe_g7scs5vbfrta8_317069062');
REM   5. Be aware that using DBMS_SQLTUNE requires a license
REM      for the Oracle Tuning Pack.
REM
 

TAG:

 

评分:0

我来说两句

zhuqingna0238

zhuqingna0238

51毕业学员

我的栏目

日历

« 2024-04-24  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 5274
  • 日志数: 7
  • 文件数: 5
  • 建立时间: 2009-05-09
  • 更新时间: 2012-01-06

RSS订阅

Open Toolbar