PerStat common command

xiaoxiao2021-03-06  52

--Login Oracle As Sys

SQLPlus Internal;

--schedule auto job@spauto.sql

--1 / 24 hh once a hour (general situation) - 1/48 mi once every 30 minutes - 1/144 mi every 10 minutes - 1/288 mi every 5 minutes

DBMS_Job.Submit (: jobno, 'statspack.snap;', trunc (sysdate 1/24, 'hh'), 'Trunc (sysdate 1/24,' hh ')', true,: instno;

--create report@spreport.sql

--Remove Schedule Job

SELECT JOB, LOG_USER, Priv_User, Last_Date, Next_Date, Interval from User_Jobs;

Excute dbms_job.remove ('22 ')

- Delete HisData allows you to delete some views or table related data, mostly locked.

SELECT MAX (SNAP_ID) from Stats $ SNAPSHOT;

DELETE from Stats $ Snapshot Where Snap_ID <= 166;

--Truncate Stats Table Log in with Perfstat / Perfstat to get truncate

@ sptrunc.sql

转载请注明原文地址:https://www.9cbs.com/read-116681.html

New Post(0)