awr的命令

xypincle發表於2017-03-23

  1. 1.檢視當前的awr儲存策略:
  2. select * from dba_hist_wr_control ;

  3. 2.執行awr:
  4. SQL> @?/rdbms/admin/awrrpt.sql

  5. 3.檢視歷史awr記錄
  6. select snap_id,dbid,startup_time,begin_interval_time,end_interval_time from dba_hist_snapshot ;

  7. 4.建立一個snapshot:
  8. SQL> exec dbms_workload_repository.create_snapshot() ;

  9. 5.刪除範圍內的snapshot:
  10. exec dbms_workload_repository.drop_snapshot_range(low_snap_id=>205,high_snap_id=>208,dbid=>3722795346) ;

  11. 6.Enabling the Automatic Workload Repository
  12. SQL> show parameter statistics_level ;

  13. 7.Modifying Snapshot Settings Using the Command-Line Interface
  14.     7.1 The INTERVAL setting affects how often the database automatically generates snapshots.
  15.     7.2 The RETENTION setting affects how long the database stores snapshots in AWR.
  16.     7.3 The TOPNSQL setting affects the number of Top SQL to flush for each SQL criteria (Elapsed Time, CPU Time, Parse Calls, sharable Memory, and Version Count).
  17. SQL> exec dbms_workload_repository.modify_snapshot_settings(retention=>43200, interval=>30,topnsql=>100, dbid=>3722795346);

  18. 8.修改取樣時間間隔:
  19. SQL> exec dbms_workload_repository.modify_snapshot_settings(interval=>120) ;

建立基線
SQL>exec dbms_workload_repository.create_baseline(start_snap_id=>3890,end_snap_id=>3899,baseline_name=>'BaseLine01') ;

刪除基線
SQL>exec dbms_workload_repository.drop_baseline(baseline_name=>'BaseLine01',cascade=>true) ;

查詢建立的基線
select * from dba_hist_baseline ;
--建立一個基線模板
awr的命令

--刪除一個基線模板
awr的命令

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28878983/viewspace-2135889/,如需轉載,請註明出處,否則將追究法律責任。

相關文章