ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Make MS SQL Server 2014 Log Every Query

    IT Discussion
    sql server sql server 2014 logging
    5
    10
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      We have a very large Microsoft SQL Server 2014 box and for application forensics, we'd like to have a way to log every query that is attempted and store it so that we can look through it. We know this will have high overhead. Trying to find a reasonable way to do this. We know that if we update to 2016 that you can do this natively, but in 2014 we aren't sure how best to accomplish this.

      Thoughts?

      1 Reply Last reply Reply Quote 0
      • DustinB3403D
        DustinB3403
        last edited by

        Updating isn't an option?

        scottalanmillerS 1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller @DustinB3403
          last edited by

          @dustinb3403 said in Make MS SQL Server 2014 Log Every Query:

          Updating isn't an option?

          Soon, but not in a "today" context, no.

          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            We are thinking SQL Server Profiler might do the trick. Going to look into that first.

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              Templates for Profiler...

              https://docs.microsoft.com/en-us/sql/tools/sql-server-profiler/sql-server-profiler-templates?view=sql-server-2017

              1 1 Reply Last reply Reply Quote 0
              • 1
                1337 @scottalanmiller
                last edited by 1337

                @scottalanmiller Check out Extended Events. It can log everything that happens.
                Fastest way to learn more is probably to search youtube for sql server extended events.

                Extended events are suppose to be the replacement for sql traces/profiling.

                scottalanmillerS RomoR 2 Replies Last reply Reply Quote 2
                • scottalanmillerS
                  scottalanmiller @1337
                  last edited by

                  @pete-s said in Make MS SQL Server 2014 Log Every Query:

                  @scottalanmiller Check out Extended Events. It can log everything that happens.
                  Fastest way to learn more is probably to search youtube for sql server extended events.

                  Extended events are suppose to be the replacement for sql traces/profiling.

                  Excellent, thanks.

                  1 Reply Last reply Reply Quote 1
                  • RomoR
                    Romo @1337
                    last edited by

                    @pete-s said in Make MS SQL Server 2014 Log Every Query:

                    Extended Events

                    @Pete-S happen to know where the default location of the event files are saved?

                    I created a new session and I believe it is properly showing the queries ran, but if I try to change the place where the file is logged to is doesn't start, but if I leave the default set I can't find the file!!

                    1 1 Reply Last reply Reply Quote 0
                    • 1
                      1337 @Romo
                      last edited by

                      @romo said in Make MS SQL Server 2014 Log Every Query:

                      @pete-s said in Make MS SQL Server 2014 Log Every Query:

                      Extended Events

                      @Pete-S happen to know where the default location of the event files are saved?

                      I created a new session and I believe it is properly showing the queries ran, but if I try to change the place where the file is logged to is doesn't start, but if I leave the default set I can't find the file!!

                      I'm not sure the default is actually a file at all, it may be memory buffers.
                      However it sound like you have a user rights issue. Make sure SQL server is allowed to write to the file where you put it.

                      JaredBuschJ 1 Reply Last reply Reply Quote 0
                      • JaredBuschJ
                        JaredBusch @1337
                        last edited by

                        @pete-s said in Make MS SQL Server 2014 Log Every Query:

                        @romo said in Make MS SQL Server 2014 Log Every Query:

                        @pete-s said in Make MS SQL Server 2014 Log Every Query:

                        Extended Events

                        @Pete-S happen to know where the default location of the event files are saved?

                        I created a new session and I believe it is properly showing the queries ran, but if I try to change the place where the file is logged to is doesn't start, but if I leave the default set I can't find the file!!

                        I'm not sure the default is actually a file at all, it may be memory buffers.
                        However it sound like you have a user rights issue. Make sure SQL server is allowed to write to the file where you put it.

                        Also remember The SQL instance is usually not running with a user context. Generally a system service.

                        1 Reply Last reply Reply Quote 1
                        • 1 / 1
                        • First post
                          Last post