• Pingback: Tweets that mention How much memory is each SQL Server database using? | John Sansom - SQL Server DBA in the UK -- Topsy.com

  • Pingback: SQL Server Memory Configuration and MemToLeave | John Sansom - SQL Server DBA in the UK

  • Geo

    I never knew that we could calculate the memory utilization of each DB!!! It was very helpful. Thanks.

    • http://www.johnsansom.com John Sansom

      You’re welcome! Thanks for your comment.

  • rahul

    it was good.
    it help me lot………..

    • http://www.johnsansom.com John Sansom

      Hi Rahul, thanks for your comment. I’m glad you found it useful.

  • Rafael Cruz

    Hi John,

    That worked great, but when tried to use on servers with AWE enabled i got this error:
    “Msg 208, Level 16, State 1, Line 1
    Invalid object name ‘sys.dm_os_buffer_descriptors’”.

    Is there an way to get this information (memory p/ database) on AWE enabled servers?

    • http://www.johnsansom.com John Sansom

      Hi Rafeal,

      Hmmm interesting, I’ve not encountered this issue myself. What edition of SQL Server is causing the problem?

      • Rafael Cruz

        Tks for the reply.
        This happens with SQL Server 2005.

        • http://www.johnsansom.com John Sansom

          I just tested the query on an Instance of SQL Server 2005 Standard Edition SP3 installed on Windows XP successfully. What edition of SQL Server are you running? (run SELECT @@VERSION)

          • Rafael Cruz

            Microsoft SQL Server 2005 – 9.00.4035.00 (X64)
            Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: SP 2)

            • http://www.johnsansom.com John Sansom

              OK, so let’s try and identify if the issue is with the query being run in your environment or that the DMV does not exist (which seems unlikely). Are you able to execute a simple (SELECT * FROM sys.dm_os_buffer_descriptors) ?

  • Claire

    Quick and nice way of getting memory usage, this query certainly works on both SQL 2005 and 2008…

    • http://www.johnsansom.com John Sansom

      Yep, works for me in SQL Server 2005 also. Thanks for the confirmation Claire!

  • Sara

    Hi
    How can I estimate necessary memory for database that I am going to have? Imagine a table with 7 column and around 500 rows. The data base updated every day!

    Thank u

    • http://www.johnsansom.com John Sansom

      Hi Sara,

      That’s a great question.

      When estimating how much memory you require for a SQL Server server there is a whole lot more to be considered than just the potential requirements of the database itself. So much so in fact that it’s just not possible to cover adequately in a blog post comment.

      That said there are some excellent resources that you can refer to in order to learn more about how SQL Server uses memory. One of the best places to start learning about SQL Server Memory architecture is in Books Online at Memory Management Architecture. For a shorter general discussion at an introductory level for estimating SQL Server memory usage take a look at Analyzing Memory Requirements for SQL Server.

      Thanks for your comments!

  • Pingback: The SQL Server Buffer Pool and Buffer Cache Hit Ratio