The basic use method of Oracle Statspack

Source: Internet
Author: User

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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.