Using fn_dblog cause we lost support?

Rodrigo Ribeiro 27 Reputation points
2021-02-11T12:05:05.953+00:00

Hi,

A lot of sources reference fn_dblog in its scripts, but it is no documented. Some applications use it to read logs and do some actions.

Why this function is not documented? Using it makes we lost product support?
It can be documented on official documentation?

SQL Server | Other
{count} votes

Accepted answer
  1. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2021-02-12T06:28:17.56+00:00

    Hi @Anonymous ,

    fn_dblog is an ‘undocumented feature’, in that Microsoft has no official documentation or support for this – so they can alter or remove it as they see fit. In reality, it is so widely used that there is very little chance that it will be subjected to major alterations – but this is not guaranteed.

    Note that use of the fn_dblog() function (and all other undocumented commands) against a production database instance is executed at your own risk.


    If the response is helpful, please click "Accept Answer" and upvote it, thank you.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Ronen Ariely 15,206 Reputation points
    2021-02-11T12:35:36.993+00:00

    Good day,

    Why this function is not documented?

    There are hundreds of elements in SQL servers that are not documented, just like in any large complex application. Some of the elements are intended for internal use of the application and some are intended for use by the team developing the application or by the team supporting the application.

    There are many elements that are not confidential but Microsoft does not want to take responsibility for them because they are not intended for normal user use. In such cases, for example, the Microsoft team usually happy to share the knowledge unofficial in their blogs, but not officially published in the documentation. Official documentation makes the element part of the official product and restrictions and duties apply accordingly.

    Paul Randal for example used to write a lot about the internals of SQL Server and undocumented features while working at Microsoft developing the SQL Server. Today he is not longer at Microsoft but still, I HIGHLY RECOMMEND to follow his blog and read his posts about the server internals. By the way, he also posted about this function.

    Using it makes we lost product support?

    (1) You can always prefer to backup the database log file and use fn_dump_dblog which give the information from backup file. This way you sure that you do not touch the production.

    (2) (For the sake of the responsibility and the forum let me add "as much as I know" and remind you that anything that you do with undocumented feature is by definition not supported!

    So, as much as I know... fn_dblog is a read only function, which mean it does not change anything.

    It can be documented on official documentation?

    It can if Microsoft will want to do it and they probably do not for the same reason that I mentioned above.

    You can open a request in the UserVoice but I have a feeling that this will not be accepted: https://feedback.azure.com/forums/908035-sql-server

    I hope that this cover the questions :-)

    2 people found this answer helpful.

  2. Olaf Helper 47,441 Reputation points
    2021-02-11T12:43:29.363+00:00

    The function (and many more like the often used sys.sp_MSforeachdb ) are for internal use, not documented and are therefore un-supported; but you won't lost support option, if you use it.


  3. Shashank Singh 6,251 Reputation points
    2021-02-11T14:38:25.113+00:00

    Why this function is not documented?

    This is undocumented because MS has not tested it completely or probably did not gave much thought about testing all its parameters. May be there are some aspects like one suggested by Jonathan Kehayias which can be counter productive by and hence this is unsupported. Quoting from the blog

    `Edit 8/15/13: Beware – Jonathan just found out from a customer system that uses this extensively that every time fn_dump_dblog is called, it creates a new hidden SQLOS scheduler and up to three threads, which will not go away (and will not be reused) until a server restart. It’s a bug that the SQL team is going to fix now we’ve alerted them to it. Use with caution.

    Edit 5/15/15: It’s fixed in SQL Server 2012 SP2+ and SQL Server 2014. The fix won’t be backported any earlier.`

    Using it makes we lost product support?

    No, but let us say you use fn_dblog and something bad happened you cannot blame Microsoft for that. So let us say you are using undocumented command and it caused some incident due to which you had monetary loss, in such case you cannot blame MS for that. Support will still work.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.