Suppose there is a server on it 5 DB. How can I get a high precision base with which a lot of work is happening than with other bases?

  • one
    Apparently, you somehow faced performance problems. In this case, it is worthwhile not to look for the most used database (what will it give you?), But describe the whole situation. - etki
  • I need these statistics in order to, on the basis of it, set priorities in one other program. - iluxa1810

2 answers 2

Alternatively, you can get information about current requests on the server using sys.dm_exec_requests . The results can be grouped by database and get a picture of the number of queries running on each of the databases. You can arrange everything in the form of a snood and pull it as needed.

    You need to start SQL Server Profiler, put a filter on Duration more than 1000 ms in it. In the Events Selection tab, select the Show All Columns check box and select the Database Name for all event types in the additional columns that appear. Click Run. After some time, a table of slow calls to the server databases will be created. If visually it does not immediately strike the eye that calls to one of the databases prevail, then you can copy the table to Excel and filter by the Database Name column.

    • How can I get this information directly for c #? - iluxa1810
    • @ iluxa1810, in the profiler, after you have recorded the snapshot, click Save As -> Table. Next, specify the name of the table where the report will be exported. After export, using LINQ database queries, get the data you need. The disadvantage of this method is its static nature. Each new report will have to do hands, every new time. - R. Matveev