home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / DB / UTIL72 / UTLBSTAT.SQL < prev    next >
Encoding:
Text File  |  1995-05-09  |  3.7 KB  |  105 lines

  1. rem 
  2. rem $Header: utlbstat.sql 7020100.1 94/09/23 22:14:19 cli Generic<base> $ bstat.sql 
  3. rem 
  4. Rem Copyright (c) 1988 by Oracle Corporation
  5. Rem NAME
  6. REM    UTLBSTAT.SQL
  7. Rem  FUNCTION
  8. Rem  NOTES
  9. Rem  MODIFIED
  10. Rem     drady      09/09/93 -  merge changes from branch 1.1.312.2
  11. Rem     drady      03/22/93 -  merge changes from branch 1.1.312.1 
  12. Rem     drady      08/24/93 -  bug 173918
  13. Rem     drady      03/04/93 -  fix bug 152986 
  14. Rem     glumpkin   11/16/92 -  Renamed from UTLSTATB.SQL 
  15. Rem     glumpkin   10/19/92 -  Renamed from BSTAT.SQL 
  16. Rem     jloaiza    01/07/92 -  rework for version 7
  17. Rem     mroberts   08/16/91 -         fix view for v7 
  18. Rem     rlim       04/29/91 -         change char to varchar2 
  19. Rem   Laursen    01/01/91 - V6 to V7 merge
  20. Rem   Loaiza     04/04/89 - fix run dates to minutes instead of months
  21. Rem   Martin     02/22/89 - Creation
  22. Rem   Jloaiza    02/23/89 - changed table names, added dates, added param dump
  23. Rem
  24. set echo on;
  25. connect internal;
  26.  
  27. Rem ********************************************************************
  28. Rem                 First create all the tables
  29. Rem ********************************************************************
  30.  
  31. drop table stats$begin_stats;
  32. create table stats$begin_stats as select * from v$sysstat where 0 = 1;
  33. drop table stats$end_stats;
  34. create table stats$end_stats as select * from stats$begin_stats;
  35.  
  36. drop table stats$begin_latch;
  37. create table stats$begin_latch as select * from v$latch where 0 = 1;
  38. drop table stats$end_latch;
  39. create table stats$end_latch as select * from stats$begin_latch;
  40.  
  41. drop table stats$begin_roll;
  42. create table stats$begin_roll as select * from v$rollstat where 0 = 1;
  43. drop table stats$end_roll;
  44. create table stats$end_roll as select * from stats$begin_roll;
  45.  
  46. drop table stats$begin_lib;
  47. create table stats$begin_lib as select * from v$librarycache where 0 = 1;
  48. drop table stats$end_lib;
  49. create table stats$end_lib as select * from stats$begin_lib;
  50.  
  51. drop table stats$begin_dc;
  52. create table stats$begin_dc as select * from v$rowcache where 0 = 1;
  53. drop table stats$end_dc;
  54. create table stats$end_dc as select * from stats$begin_dc;
  55.  
  56. drop table stats$begin_event;
  57. create table stats$begin_event as select * from v$system_event where 0 = 1;
  58. drop table stats$end_event;
  59. create table stats$end_event as select * from stats$begin_event;
  60.  
  61. drop table stats$dates;
  62. create table stats$dates (stats_gather_times varchar2(100));
  63.  
  64. drop view stats$file_view;
  65. create view stats$file_view as
  66.   select ts.name    ts,
  67.          i.name     name,
  68.          x.phyrds pyr,
  69.          x.phywrts pyw,
  70.          x.readtim prt,
  71.          x.writetim pwt,
  72.          x.phyblkrd pbr,
  73.          x.phyblkwrt pbw
  74.   from v$filestat x, ts$ ts, v$datafile i,file$ f
  75.  where i.file#=f.file#
  76.    and ts.ts#=f.ts#
  77.    and x.file#=f.file#;
  78.  
  79. drop table stats$begin_file;
  80. create table stats$begin_file as select * from stats$file_view where 0 = 1;
  81. drop table stats$end_file;
  82. create table stats$end_file as select * from stats$begin_file;
  83.  
  84.  
  85. Rem ********************************************************************
  86. Rem                    Gather start statistics
  87. Rem ********************************************************************
  88.  
  89. insert into stats$dates 
  90.    select to_char(sysdate, 'dd-mon-yy hh24:mi:ss') from dual;
  91.  
  92. insert into stats$begin_roll select * from v$rollstat;
  93.  
  94. insert into stats$begin_file select * from stats$file_view;
  95.  
  96. insert into stats$begin_stats select * from v$sysstat;
  97.  
  98. insert into stats$begin_dc select * from v$rowcache;
  99.  
  100. insert into stats$begin_lib select * from v$librarycache;
  101.  
  102. insert into stats$begin_latch select * from v$latch;
  103.  
  104. insert into stats$begin_event select * from v$system_event;
  105.