home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Database / DBMaint / data1.cab / Program_Files / perfcrea.SQL < prev    next >
Encoding:
Text File  |  1999-04-06  |  6.1 KB  |  89 lines

  1. SET NOCOUNT ON
  2. GO
  3. --Drop static table
  4. DROP TABLE dbmsys_perf_data
  5. DROP TABLE dbmsys_perf_descr
  6. GO
  7.  
  8. -- Create the stats table
  9. CREATE TABLE dbmsys_perf_descr
  10. (counter_id TINYINT PRIMARY KEY NONCLUSTERED NOT NULL,
  11.  counter_name VARCHAR(33) NOT NULL,
  12.  description VARCHAR(255),
  13.  log_this bit)
  14. GO
  15.  
  16. CREATE TABLE dbmsys_perf_data
  17. (counter_id TINYINT NOT NULL REFERENCES dbmsys_perf_descr(counter_id),
  18.  stats_value REAL NOT NULL,
  19.  capture_time SMALLDATETIME NOT NULL,
  20.  CONSTRAINT dbm_perf_data_fk PRIMARY KEY (counter_id, capture_time))
  21. GO
  22.  
  23. -- Populate dbmsys_perf_descr
  24. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  25. VALUES(1, 'Log Flush Requests', 'Number of requests to flush the log to disk.', 1)
  26. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  27. VALUES(2,'Log Logical Page IO','Logical page I/O for transaction log.',1)
  28. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  29. VALUES(3,'Log Physical IO','Physical I/O for transaction log.',1)
  30. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  31. VALUES(4,'Log Flush Average','Log flush requests per physical write.',1)
  32. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  33. VALUES(5,'Log Logical IO Average','Logical pages written per physical write for transaction log.',1)
  34. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  35. VALUES(6,'Batch Writes','The number of times multiple pages were written to disk in a batch.',1)
  36. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  37. VALUES(7,'Batch Average Size','The average number of pages written in a batch.',1)
  38. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  39. VALUES(8,'Batch Max Size','The maximum number of simultaneous outstanding physical I/Os.',1)
  40. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  41. VALUES(9,'Page Reads','The number of 2K pages read from disk (physical reads).',1)
  42. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  43. VALUES(10,'Reads Outstanding','The number of read requests issued to the operating system that have not been completed.',1)
  44. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  45. VALUES(11,'Writes Outstanding','The number of write requests issued to the operating system that have not completed.',1)
  46. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  47. VALUES(12,'Transactions','The number of Transact-SQL batches executed. This value is useful in computing ratios involving log write numbers.',1)
  48. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  49. VALUES(13,'Transactions/Log Write','The number of transaction records written to disk during each physical log write.',1)
  50. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  51. VALUES(14,'Cache Hit Ratio','The percentage of times a data page was found in the cache.',1)
  52. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  53. VALUES(15,'Cache Flushes','The number of times a page needed to be flushed from cache to make room for another page.',0)
  54. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  55. VALUES(16,'Free Page Scan (Avg)','The average number of buffer pages that had to be scanned in order to find a free page.',1)
  56. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  57. VALUES(17,'Free Page Scan (Max)','The maximum number of buffer pages that had to be scanned in order to find a free page.',1)
  58. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  59. VALUES(18,'Min Free Buffers','The lazy writer will attempt to maintain at least this number of buffers on the free list.',1)
  60. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  61. VALUES(19,'Cache Size','The total number of pages in the cache.',1)
  62. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  63. VALUES(20,'Free Buffers','The number of buffers currently on the free list.',1)
  64. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  65. VALUES(21,'Network Reads','The total number of reads from the network.',1)
  66. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  67. VALUES(22,'Network Writes','The total number of writes to the network.',1)
  68. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  69. VALUES(23,'Command Queue Length','The number of client requests waiting to be handled by the SQL Server worker threads.',0)
  70. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  71. VALUES(24,'Max Command Queue Length','The maximum number of client requests waiting to be handled by the SQL Server worker threads.',1)
  72. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  73. VALUES(25,'Worker Threads','The current number of worker threads servicing the command queue.',1)
  74. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  75. VALUES(26,'Max Worker Threads','The highest number of worker threads that serviced the command queue since the network application was started or since the statistics were cleared.',1)
  76. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  77. VALUES(27,'Network Threads','',0)
  78. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  79. VALUES(28,'Max Network Threads','',0)
  80. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  81. VALUES(29,'RA Pages Found in Cache','How many pages the RA Manager found already in the cache when trying to perform scans.',1)
  82. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  83. VALUES(30,'RA Pages Placed in Cache','How many pages were brought into the cache by the RA Manager.',1)
  84. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  85. VALUES(31,'RA Physical IO','How many 16K reads were done by the RA Manager.',1)
  86. INSERT dbmsys_perf_descr(counter_id, counter_name, description, log_this)
  87. VALUES(32,'Used Slots','How many RA slots are being used by active queries. Note that a single query may use multiple RA slots.',1)
  88. GO
  89.