The first experience of Statspack

Source: Internet
Author: User
Hehe, I've never done statspack before tonight (it seems a bit humiliating). These days a database is really tortured to death, obviously Sga_max_size has 1.5G, but actually see the whole instance to use the 200+m memory, slow to die, frequent read and write hard disk, but the hard drive is not a disk array, Io crazy slow, alas, pain ah. So decided to spend some time to learn the example optimization, today printed a few pages of performance Tuning guide documents, read about Statspack content, in their own notebook to do the experiment, in fact, it is very easy.
The%oracle_home%\rdbms\admin Pcreate is run first, during which the password, tablespace, and temporary table space of the Perfstat user is specified, which is not generally the default. Then there is a bunch of success tips, if you don't have time to see it doesn't matter, you can go to your DOS window (I am Win32 platform) under the path to view the. lis files, those are installation trace files.
Then you can use the perfstat/password to login sqlplus, Executive: EXEC Statspack. SNAP; is a snapshot, can be made at regular intervals to run once.
View report:%oracle_home%\rdbms\admin Preport the ID of all snapshot that have been done after running, and then select the Start ID and end ID of this report as needed. You then enter the filename to get a copy of the. lst file (the suffix name is written in the document. Lis, it should be wrong, but I look at the 9i of the document, running the 10g database, do not know is not a version of the problem), you can use the Text tool to open the viewing.
Check sql: Look at the report can see the tracking SQL, which has the hash value, the statement to be more detailed view of the hash value recorded, run%oracle_home%\rdbms\admin prepsql input, you can get LST file as before , a more detailed analysis of the SQL statement is documented.
Long snapshot, you may need to delete some historical data, run Oracle_home%\rdbms\admin ppurge on it, according to the prompts to select the ID to delete, and all delete on the oracle_home%\rdbms\admin Ptrunc, all the way to return.
Finally, pay attention to the level of snapshot, which can be done through exec statspack. Modify_statspack_parameter (i_snap_level=n) to modify, N can be 0,5,6,7,10, the default is 5.
0 provides general performance statistics only
5 adds a general analysis of SQL statements
6 Increased SQL planning and use
7 Increased number of segmented (segments)-level statistics
10 increased the analysis of latch (latches)
The documentation recommendations are prudent for 10 because of the high cost.
Because just play their own system, so there is nothing to analyze, just practice the use of statspack. The analysis of the results has to be studied, and has been found in Tom's two books, but expert one-on-one oracle in more detail.

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.