Statspack Installation Use and analysis
1. View table Space
Select Tablespace_name,file_name from Dba_data_files;
2. Create Statspack table Space
Create tablespace perfstat datafile ' d:\oracle\oradata\perfstat.dbf ' size 500m
The table space should be as large as possible.
(If the table space is small, there will be an error in the installation, causing the next installation to prompt "xxx synonym (synonymous) has been installed ...", you must find the synonyms to remove, very troublesome)
3. Install Statspack.
Run in oracle_home\rdmbs\admin\ directory:
@spcreate. sql
Run in the same directory if the creation fails: @spdrop. sql
4. Test:
Sql>execute Statspack.snap
Pl/sql procedure successfully completed.
Sql>execute Statspack.snap
Pl/sql procedure successfully completed.
sql> @spreport. sql
Use Statspack:
Sqlplus Perfstat/perfstat
exec Statspack.snap; -Information gathering statistics, each run will produce a snapshot number
--Get the snapshot number, you must have more than two snapshots to generate the report
Select snap_id, snap_time from Stats$snapshot;
@spreport. SQL--Enter the start and end snapshot numbers you want to see
Other Related scripts s:
Spauto.sql-Submit a job using Dbms_job to automate Statpack information collection statistics
Sppurge.sql-Clear a range of statistics, need to provide start and end snapshot number
Sptrunc.sql-Clear (TRUNCATE) all statistical information
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/