D79236GC10 Appendix A
D79236GC10 Appendix A
Using Statspack
A-2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Introduction to Statspack
A-3 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Statspack Scripts
A-4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Installing Statspack
• Install Statspack:
– Supplying parameters as requested interactively
– Defining parameters in the session for batch mode
SQL> connect / as sysdba
SQL> define default_tablespace='SYSAUX'
SQL> define temporary_tablespace='TEMP'
SQL> define perfstat_password='erg8oiw'
SQL> @?/rdbms/admin/spcreate
SQL> undefine perfstat_password
A-6 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Capturing Statspack Snapshots
• Capture a snapshot:
SQL> connect perfstat/erg8oiw
SQL> execute statspack.snap;
• Use the function to determine the snapshot number:
SQL> variable snap number;
SQL> begin :snap := statspack.snap; end;/
SQL print snap
• Automate snapshot collection:
SQL> connect perfstat/erg8oiw
SQL> @spauto
A-7 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Configuring Snapshot Data Capture
A-8 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Statspack Snapshot Levels
0 General performance
5 SQL statements
7 Segment-level statistics
10 Parent and child latches
A-9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Statspack Baselines and Purging
• Allows characterization
of the application
• Can point toward
potential problems:
– High hard parse rate
– High I/O rate
– High login rate
• Is more useful if you have a comparable baseline
• Answers “What has changed?”
– Txn/sec change implies changed workload.
– Redo size/txn implies changed transaction mix.
– Physical reads/txn implies changed SQL or plan.
Statspack AWR
schema tables
Migration