Basic usage of Performance Statistics in oralcle statpack

Source: Internet
Author: User

In Oracle, using statpack for performance statistics is a good choice, but it is not a graphical interface. It is more troublesome and has many usage options. Generally, you can master the basic usage.
You can use it to query it.

 

1 Installation
First, create a separate tablespace as SYS. The requirement is relatively large, preferably 1, 2g
Create tablespace perfstat datafile 'f: "oracle" oradata "jssweb" perfstat. dbf'size 2000 m;

Run spcreate. SQL under the ORACLE_HOME \ RDBMS \ ADMIN directory.
Enter the password perfstat

Select the created tablespace, such as perfstat, and the installation is successful.

Verify the installation as follows:

Execute statspack. Snap

 

2 Basic use
You must use perfstat/perfstat to log on, and then
Run @ spreport. SQL,

You will be asked to enter the snapshotid, which is the number of days, and the number of the start and end days,

Define the report file (in the last step) to view the generated report.
Note that due to the sampling time, you can modify it in spauto. SQL and find:
Dbms_job.submit (: Job, 'statspack. Snap; ', trunc (sysdate + 1/24, 'hh24'), 'trunc (sysdate + 1/24, ''hh24 '')');

Modify.

If multiple instances exist, execute sprepins. SQL to generate a report.

View current job
Select job, schema_user, next_date, interval, what from user_jobs

View the snapshot list
Select snap_id, snap_time, startup_time from stats $ snapshot;

To view the execution plan of an SQL statement, use spreport to find the SQL statement and write down its hash value.
CPU elapsd old
Buffer gets executions gets per exec % Total time (s) Hash Value
--------------------------------------------------------------------------
250,175 259 965.9 63.5 36.93 386.17 2689373535

Run @ spresql. SQL and enter the hash value to view the corresponding execution plan.

 

Finally, it is a good tutorial for itpub statpack.

 

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.