StatsPack: Setup • Make sure TIMED_STATISTICS is true. $ sqlplus ‘/ as sysdba’ SQL> show parameter timed_statistics; NAME TYPE VALUE ---------------------- ------------ ---------- timed_statistics boolean TRUE • To create the package SQL> @?/rdbms/admin/spcreate Enter value for perfstat_password : perfstat or (whatever password you want) Enter value for default_tablespace: (press Return for the default TS) Enter value for temporary_tablespace: (press Return for the default temp TS) No errors. SPCPKG complete. Please check spcpkg.lis for any errors.
StatsPack: Snapshot • To gather StatsPack snapshot $ sqlplus perfstat/perfstat SQL> execute statspack.snap; • After taking the first snapshot, take an other one after about a minute later SQL> connect perfstat/perfstat SQL> execute statspack.snap; • Now, there should be snapshot ID #1 and #2 in the statspack table.
StatsPack: Report • To run the Report $ sqlplus perfstat/perfstat SQL> @?/rdbms/admin/spreport Instance DB Name Snap ID Snap Started Level Comment ------------ ------------ --------- ------------------------- -------------------- DB101 RAC1 1 08 May 2005 03:04 5 2 08 May 2005 03:04 5 Specify the Begin and End Snapshot IDs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enter value for begin_snap: 1 Begin Snapshot Id specified: 1 Enter value for end_snap: 2 End Snapshot Id specified: 2 Specify the Report Name ~~~~~~~~~~~~~~~~~~~~~~~ The default report file name is sp_1_2. To use this name, press <return> to continue, otherwise enter an alternative. Enter value for report_name: <hit return> . End of Report (sp_1_2.lst) SQL>
$ sqlplus ' / as sysdba ' SQL> sho parameter job_queue_processes If job_queue_processes=0, increase it SQL> alter system set job_queue_processes=1 SQL> @?/rdbms/admin/spauto
Monitor with Statspack • Snapshot before and after the loads. $ sqlplus perfstat/perfstat SQL> execute statspack.snap; SQL> @create_work.sql SQL> connect perfstat/perfstat SQL> execute statspack.snap; • Generate the snapshots report for Snap ID #3 and #4 using spreport.sql. • Compare your results with sp_1_2.lst.... • Compare « Top 5 Timed Events » on both reports...
Create snapshots from DBCONSOLE • Create snapshot before the workload starts: Performance -> snapshots-> “create” • From the command prompt as oracle, rerun the workload: $sqlpus ‘/ as sysdba’ SQL> @create_work.sql SQL> exit • Create snapshot after the workload ends: Performance -> snapshots-> “create”