測試安裝好的Statspack
運行statspack
如果一切正常
已 perfstat/perfstat登陸
*/
SQL>execute statspack
SQL>execute statspack
SQL>@/home/newvers/product/
SQL>@/home/newvers/product/
使statspack自動收集系統狀況
alert system set job_queue_processes =
alert system set job_queue_processes =
alter system set Timed_statistics=true;
[orapaid@bj
Rem
Rem $Header: spauto
Rem
Rem spauto
Rem
Rem Copyright (c) Oracle Corporation
Rem
Rem NAME
Rem spauto
Rem
Rem DESCRIPTION
Rem SQL*PLUS command file to automate the collection of STATPACK
Rem statistics
Rem
Rem NOTES
Rem Should be run as the STATSPACK owner
Rem Requires job_queue_processes init
Rem set to a number >
Rem will run
Rem
Rem MODIFIED (MM/DD/YY)
Rem cdialeri
Rem cdialeri
Rem cdialeri
Rem
spool spauto
variable jobno number;
variable instno number;
begin
select instance_number into :instno from v$instance;
dbms_job
commit;
end;
/
prompt
prompt Job number for automated statistics collection for this instance
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prompt Note that this job number is needed when modifying or removing
prompt the job:
print jobno
prompt
prompt Job queue process
prompt ~~~~~~~~~~~~~~~~~
prompt Below is the current setting of the job_queue_processes init
prompt parameter
prompt than
show parameter job_queue_processes
prompt
prompt
prompt Next scheduled run
prompt ~~~~~~~~~~~~~~~~~~
prompt The next scheduled run for this job is:
select job
from user_jobs
where job = :jobno;
spool off;
From:http://tw.wingwit.com/Article/program/Oracle/201311/17354.html