INTERACTIVE METHODAccess SQL*Plus as the PERFSTAT user and execute either method 1, 2 or 3 as discussed in the abovesnapshot Configuration section. The simplest form of the interactive mode is as follows:SQL> EXECUTE STATSPACK.SNAPAUTOMATED METHODThe ability to automate a snapshot is another one of the great features of the Statspack utility.Automating and scheduling when to take snapshots allows for the collection of database performanceinformation that would be beneficial for troubleshooting performance problems that occurred earlier.The following are two ways that snapshots can be automated:- Oracle's DBMS_JOB utility to schedule snapshots. This utility will be discussed in greater detail.- An operating specific job scheduler. For example on Unix, shell scripts can be written and thenscheduled through the CRON scheduler. For NT, the AT scheduler in combination with .cmd files.
The DBMS_JOB utility provides a way to schedule database related tasks that are controlled within thedatabase. Through the DBMS_JOB utility snapshots can be taken at a scheduled interval. When thespcpkg.sql script was executed as part of the Statspack installation, the DBMS_JOB package wascreated for the PERFSTAT user. One of the requirements to use the DBMS_JOB utility is that theinit.ora parameter job_queue_processes must be set to a value greater than 0. The spauto.sql script isdesigned to setup the automation of executing snapshots once every hour. The following line from thescript is how the job is added to the schedule:dbms_job.submit(:jobno, 'statspack.snap;', trunc(sysdate+1/24,'HH'), - 'trunc(SYSDATE+1/24,''HH'')',TRUE, :instno);The benefits of using the spauto.sql script is that it:- Displays the job number assigned- Identifies the number of job_queue_processes set for the database- The next time that the snapshot will occur
Load Profile Section
The Load Profile section of the Statspack report is useful primarily in comparing two reports to see if the load characteristics from the two report periods are similar. In proactive tuning, you generatereports on a routine basis and check the Load Profile for changes in throughput (shown by the per-second statistics) and changes in application characteristics (shown by the per-transaction statistics). Inreactive tuning, you use the Load Profile to verify the validity of comparing a report generated during a problem period with a report generated during a baseline period. Make sure the systems were runningcomparable workloads during the two report periods. For example, if one report showed a majority of read-only activity and the second was very update-intensive, comparing the two reports would not bevalid.If you are not comparing two reports, it's still a good idea to scan the Load Profile for any rates thatseem high, irrespective of a baseline. For example, a high hard-parse rate (say, greater than 100 per second) may have serious implications for performance. High hard-parse rates are likely to beaccompanied by latch contention, so you would expect to see latch free waits in the Top 5 Wait Eventsor high in the complete Wait Events list.
Load Profile~~~~~~~~~~~~ Per Second PerTransaction---------------