Guest User

Untitled

a guest
Jun 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. /**** Run this query to get the boundary time or your AWR report ****/
  2. select snap_id,
  3. snap_level,
  4. to_char(begin_interval_time, 'dd/mm/yy hh24:mi:ss') begin
  5. from
  6. dba_hist_snapshot
  7. order by 1
  8. desc;
  9.  
  10. /***
  11. Result look like this :
  12. 1696 1 20/06/18 11:00:12
  13. 1695 1 20/06/18 10:30:11
  14. 1694 1 20/06/18 10:00:09
  15. 1693 1 20/06/18 09:30:08
  16. 1692 1 20/06/18 09:00:06
  17. 1691 1 20/06/18 08:30:05
  18. 1690 1 20/06/18 08:00:04
  19. ***/
  20.  
  21. /**** Get your Database Id ****/
  22. select DBID from v$database;
  23.  
  24. /**** Get your AWR Report in HTML or text format ****/
  25. /**** If you're not sure what to put as a second parameter set 1 ****/
  26. SELECT
  27. output
  28. FROM
  29. TABLE
  30. (dbms_workload_repository.awr_report_html
  31. (YOURDATABASEID,YOURDATABASEINSTANCE,FIRSTSNAPSHOT,SECONDSNAPSHOT )
  32. );
  33. /**
  34. Example to get the report as text :
  35. SELECT
  36. output
  37. FROM
  38. TABLE
  39. (dbms_workload_repository.awr_report_text
  40. (3518879357,1,1693,1694 )
  41. );
  42.  
  43. Example to export result as html (way easier to read) :
  44. SELECT
  45. output
  46. FROM
  47. TABLE
  48. (dbms_workload_repository.awr_report_html
  49. (3518879357,1,1693,1694 )
  50. );
  51. -> Export result to file AWR.html
  52. **/
Add Comment
Please, Sign In to add comment