Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
12Activity
0 of .
Results for:
No results containing your search query
P. 1
STATSPACK

STATSPACK

Ratings: (0)|Views: 678|Likes:
Published by api-27472162

More info:

Published by: api-27472162 on Dec 04, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

Statspack
Statspack is a set of performance monitoring and
reporting utilities provided by Oracle starting from
Oracle 8i and above. Statspack provides improved

BSTAT/ESTAT functionality, though the old BSTAT/ESTAT
scripts are still available. For more information about
STATSPACK, read the documentation in file
$ORACLE_HOME/rdbms/admin/spdoc.txt.

AlthoughAWR andADDM (introduced in Oracle 10g) provide better
statistics than STATSPACK, users that are not licensed to use the
Enterprise Manager Diagnostic Pack should continue to use statspack.
Install statspack
cd $ORACLE_HOME/rdbms/admin
sqlplus "/ as sysdba" @spdrop.sql
-- Drop and install statspack
sqlplus "/ as sysdba" @spcreate.sql
-- Entertablespace names when
prompted
Take performance snapshots of the
database
sqlplus perfstat/perfstat
exec statspack.snap;

-- Take a performance snapshots
-- or :
exec perfstat.statspack.snap(i_snap_level=>10); -- or instruct
statspack to do gather more details in the snapshot

-- (look up which
oracle version supports which level).
The spauto.sql script can be customized and executed to
schedule the collection of STATPACK snapshots.
Statspack reporting
-- Get a list of snapshots
select SNAP_ID, SNAP_TIME from STATS$SNAPSHOT;
@spreport.sql
-- Enter two snapshot id's for
difference report
Other statspack scripts
Some of the other statspack scripts are:
\ue000
sppurge.sql - Purge (delete) a range of Snapshot
Id's between the specified begin and end Snap Id's
\ue000
spauto.sql - Schedule adbms_job to automate the
collection of STATPACK statistics
\ue000
spcreate.sql - Installs the STATSPACK user, tables
and package on a database (Run as SYS).
\ue000
spdrop.sql - Deinstall STATSPACK from database (Run
as SYS)
\ue000
spreport.sql - Report on differences between values
recorded in two snapshots
\ue000
sptrunc.sql - Truncates all data in Statspack tables
Potential problems
Statpack reporting suffers from the following problems:
\ue000

Some statistics may only be reported on COMPLETION
of a query. For example, if a query runs for 12 hours,
its processing won't be reported during any of the
snapshots taken while the query was busy executing.

\ue000

If queries are aged out of the shared pool, the
stats from V$SQL are reset. This can throw off the
delta calculations and even make it negative. For
example, query A has 10,000buffer_gets at snapshot 1,
but at snapshot #2, it has been aged out of the pool
and reloaded and now shows only 1,000buffer_gets. So,
when you runspreport.sql from snapshot 1 to 2, you'll
get 1,000-10,000 = -9,000 for this query.

External links
\ue000
www.spviewer.com - website with great software tools
for Oracle tuning based on statspack.
\ue000
statspackanalyzer.com - website that can analyze
statspack reports
Installing Oracle STATSPACK

The installation steps for STATSPACK are relatively simple
and straightforward. This chapter will walk you, step by
step, through the installation and configuration of
STATSPACK. We will be including a complete description of
the following steps:

\u2022
Creating the perfstat tablespace
\u2022
Creating the perfstat user
\u2022
Creating the tables
\u2022
Installing the packages
\u2022
Collecting data
\u2022
Scheduling data collection snapshots with
dbms_job
\u2022
Testing your installation

Let's begin by reviewing the functions of each of these
files. Several of the files call subfiles, so it helps if
we organize the files as a hierarchy:

\ue000
spcreate.sql This is the first install script run
after you create the tablespace. It calls several
subscripts:
\ue000
spcsr.sql This script creates a user called
PERFSTAT with the required permissions.
\ue000
spctab.sql This creates the STATSPACK tables and
indexes, owned by the PERFSTAT user.
\ue000
spcpkg.sql This creates the PL/SQL package called
STATSPACK with the STATSPACK procedures.
\ue000
spauto.sql This script contains the dbms_job.submit
commands that will execute a STATSPACK snapshot every
hour.
\ue000
spdrop.sql This script is used to drop all STATSPACK
entities. This script calls these subscripts:
\ue000
spdtab.sql This drops all STATSPACK tables and
indexes.
\ue000
spdusr.sql This script drops the PERFSTAT user.

Activity (12)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
cjfwnr13 liked this
harshdba liked this
Dew TyFree liked this
ronald_lopes007 liked this
prasadsukhavasi liked this
minuvarsha0 liked this
avikbanerj liked this
Virat Choudhary liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->