Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | Questions | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle > Performance Tuning     

Using Oracle statspack


STATSPACK has two adjustable parameters: level and threshold. Level is the type of data
collected and threshold acts as a filter for collecting SQL statements. You can use this query
to view all levels:

SQL> SELECT * FROM stats$level_description ORDER BY snap_level;

Level 0		This level captures general statistics, including rollback segment, row cache, SGA,
system events, 
		background events, session events, system statistics, wait statistics, lock statistics, and
Latch 
		information.

Level 5		This level includes capturing high resource usage SQL Statements, along with all data
captured by 
		lower levels.

Level 6		This level includes capturing SQL plan and SQL plan usage information for high
resource usage SQL 
		Statements, along with all data captured by lower levels.

Level 7		This level captures segment level statistics, including logical and physical reads,
row lock, itl 
		and buffer busy waits, along with all data captured by lower levels.

Level 10	This level includes capturing Child Latch statistics, along with all data captured by
lower levels. 


To change the default level for statspack snapshots use this function:

SQL> exec statspack.snap(i_snap_level => 6, i_modify_parameter => 'true');

To create a snapshot:

sqlplus perfstat/perfstat

SQL> exec statspack.snap;

To view snapshots:

sqlplus perfstat/perfstat

SQL> select name,snap_id,to_char(snap_time,'DD.MM.YYYY:HH24:MI:SS') "Date/Time" from
stats$snapshot, v$database;

To delete a snapshot:

sqlplus perfstat/perfstat

SQL> @?/rdbms/admin/sppurge;
Enter the Lower and Upper Snapshot ID

To create statspack report:

sqlplus perfstat/perfstat

SQL> @?/rdbms/admin/spreport.sql


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

       Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #97
views : 2707
Added on : 04/26/06
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (202)
 
 
<< Previous Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Operating Systems > Unix : How to kill Unix user session  
  Databases > Oracle : Kill user session  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Mobile Phones / Tablets | Office Software
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com