Sie sind auf Seite 1von 3

Automatic Workload Repository (AWR)

TheAWRcollectsandstoresdatabasestatisticsrelatingtoproblemdetectionandtuning.AWRisareplacementforthestatspackutilitywhichhelpsgather databaseperformancestatistics.AWRgeneratessnapshotsofkeyperformancedata,suchassystemandsessionstatistics,segment-usagestatistics,timemodelstatistics,high-loadstatisticsandstoresitinthesysauxtablespace. AWRprovidesstatisticsintwoformats temporary-inmemorycollectionofstatisticsintheSGA,accessibleviatheV$views persistent-typeofperformancedataintheformofregularAWRsnapshotswhichyouaccessviatheDBA_views TheMMONprocessisresponsibleforcollectingthestatisticsintheSGAandsavingthemtothesysauxtablespaces. AWRwillcollectdataonthefollowing Basestatisticsthatarealsopartofthev$SYSSTATandV$SESSTATviews SQLstatistics Databaseobject-usagestatistics Time-modelstatistics Waitstatistics ASH(activesessionhistory)statistics Operatingsystemstatistics
Tables that AWR uses to collect statistics v$sys_time_model v$osstat v$service_stats v$sysstat v$sesstat time model stats (db time, java execution time, pl/sql execution time, etc) operating system stats (avg_busy_ticks, avg_idle_ticks, etc) wait statistics ( db cpu, app wait time, user commits, etc) system stats session stats

Databaseperformancestatsfallintooneofthreecategories: Cumulativevalues-collectstatsoveraperiodoftimefromthev$sysstat,etc Metrics-usethecollectedstatstomakesomesortofsense. Sampleddata-theASHsamplerisusedtocollectthesestats. AWRSetup ToactivetheAWRchangethesystemparameterstatistics_leveltooneofthreevalues

open in browser customize

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

basic-thisoptiondisablestheAWR typical(default)-activatesstandardlevelofcollection all-sameastypicalbutincludesexecutionplansandtiminginfofromtheO/S


Active De-active Display
alter system set statistics_level = typical alter system set statistics_level = all alter system set statistics_level = basic show parameter statistics_level

Tochangethesnapshotintervalandhowmanydaysthesnapshotsarekeptyouusethepackagedbms_workload_repositoryorEnterpriseManager
Snapshot configuration
exec dbms_workload_repository.modify_snapshot_settings ( interval => 60, retention => 43200)

Change snapshotting values

interval = minutes retention = seconds select * from dba_hist_wr_control

Display values Create a snapshot Delete snapshots Create a baseline Delete a baseline Display snapshots View the repository tables

Snapshot Management
exec dbms_workload_repository.create_snapshot exec dbms_workload_repository.drop_snapshot_range (low_snap_id => 1077, high_snap_id => 1078) exec dbms_workload_repository.create_baseline (start_snap_id => 1070, end_snap_id => 1078, baseline_name => 'Normal Baseline') exec dbms_workload_repository.drop_baseline (baseline_name => 'Normal Baseline', cascade => FALSE) select snap_id, begin_interval_time, end_interval_time from dba_hist_snapshot order by 1 select table_name from dba_tables where tablespace_name = SYSAUX and substr(table_name, 1,2) = WR and rownum <= 20 order by 1

Useful Views dba_hist_active_sess_history ASH info (see below) dba_hist_baseline dba_hist_database_instance dba_hist_sql_plan dba_hist_wr_control dba_hist_snapshot baseline info environment data sql execution path data AWR settings snapshot info in the AWR

AWRReport TorunAWRreportyoucanusethefollowingoperatingsystemscriptsoruseEnterpriseManager.
the script will ask for begin snapshot and end snapshot and will be generated in text format Are you a developer? Try out the HTML to PDF API

open in browser customize

pdfcrowd.com

awrrpt.sql

the script will ask for begin snapshot and end snapshot and will be generated in text format Note: reports went in $oracle_home\db_1\bin

awrrpti.sql

the script will ask for begin snapshot and end snapshot and will be generated in HTM L format Note: reports went in $oracle_home\db_1\bin

YoucanobtainmoreinformationregardingtheAWRfromautomaticdatabasediagnosticmanager(ADDM).

open in browser customize

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com