最快速STATSPACK使用指南,實用手冊

rongshiyuan發表於2012-07-13
最快速STATSPACK使用指南,實用手冊


安裝statspack

SQL>connect / as sysdba

SQL>@?/rdbms/admin/spcreate

解除安裝

SQL>connect / as sysdba
SQL>@?/rdbms/admin/spdrop

/*
收集資訊前把timed_statistics = true;
alter system set timed_statistics = true;
*/


收集資訊

SQL>connect perfstat/perfstat
SQL>execute statspack.snap;

自動收集
SQL>connect perfstat/perfstat
SQL>@?/rdbms/admin/spauto

刪掉自動收集的job.

SQL>select * from user_jobs;

SQL>exec dbms_job.remove(JOB_ID)

/*
execute statspack.snap(i_snap_level=>10, i_modify_parameter=>'true');
Levels = 5 Additional data: SQL Statements
Levels = 6 This level includes all statistics gathered in the lower level(s).

Levels = 7 segments level statistics
Levels = 10 Additional statistics: Child latches
i_modify_parameter=>'true'/'false' 決定是否儲存level 的值,下一次執行繼續使用
*/

產生報告

SQL>conect perfstat/perfstat
SQL>@?/rdbms/admin/spreport

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-735371/,如需轉載,請註明出處,否則將追究法律責任。

相關文章