How are the system health extended events files rolling over?SSMS 2008 / 2014 showing different values for...

Coworker asking me to not bring cakes due to self control issue. What should I do?

Lightning Data Table inline edit

Taking headphones when quitting job

How much light is too much?

Does the US government have any planning in place to ensure there's no shortages of food, fuel, steel and other commodities?

How to create a label containing values from different layers in QGIS

Describe a span of time of 1 or 2 years, without being too literal

Why avoid shared user accounts?

Why did Luke use his left hand to shoot?

Does it take energy to move something in a circle?

Stuck on a Geometry Puzzle

Is there a way to store 9th-level spells in a Glyph of Warding or similar method?

Single-row INSERT...SELECT much slower than separate SELECT

Potential client has a problematic employee I can't work with

Does an Eldritch Knight's Weapon Bond protect him from losing his weapon to a Telekinesis spell?

Plausible reason to leave the Solar System?

Website seeing my Facebook data?

Am I correct in stating that the study of topology is purely theoretical?

Translation needed for 130 years old church document

What does MTU depend on?

How to politely refuse in-office gym instructor for steroids and protein

Converting very wide logos to square formats

Is there any advantage in specifying './' in a for loop using a glob?

Closed set in topological space generated by sets of the form [a, b).



How are the system health extended events files rolling over?


SSMS 2008 / 2014 showing different values for TempDB file sizeswhat are the costs of enabling extended events?How to prevent Extended Events from tracking system fired events?Receiving historical SQL alerts when SQL Server agent is restartedHow do you use Extended Events to find port numbers?Expensive Query not showing in extended events tracehow to use fn_xe_file_target_read_file to read files over networkSQL agent jobs hung state (SSIS jobs hung)Does SQL Server re-create system databases if they are lost/missing?What is the right tool to process big .xel files (SQL Server Extended Events logs)?













3















I see the default system health session events within SQL Server are 5 MB each with 4 files in total.



We are trying to fetch data from the system health in historical events but for some critical production servers they just keep rolling over very fast. For some they stay there even for weeks



How is the mechanism working in SQL Server of rolling over the files and is there a way I can check when and how this is happening?



Edit@ Per Answer




  1. Event is not restarted

  2. Server is also not restarted and it happens per scheduled once a month


Therefore i am thinking there could be possibly lot of unwanted events being captured in system health. How can i find them and filter them out in this system health ?



Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?










share|improve this question





























    3















    I see the default system health session events within SQL Server are 5 MB each with 4 files in total.



    We are trying to fetch data from the system health in historical events but for some critical production servers they just keep rolling over very fast. For some they stay there even for weeks



    How is the mechanism working in SQL Server of rolling over the files and is there a way I can check when and how this is happening?



    Edit@ Per Answer




    1. Event is not restarted

    2. Server is also not restarted and it happens per scheduled once a month


    Therefore i am thinking there could be possibly lot of unwanted events being captured in system health. How can i find them and filter them out in this system health ?



    Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?










    share|improve this question



























      3












      3








      3








      I see the default system health session events within SQL Server are 5 MB each with 4 files in total.



      We are trying to fetch data from the system health in historical events but for some critical production servers they just keep rolling over very fast. For some they stay there even for weeks



      How is the mechanism working in SQL Server of rolling over the files and is there a way I can check when and how this is happening?



      Edit@ Per Answer




      1. Event is not restarted

      2. Server is also not restarted and it happens per scheduled once a month


      Therefore i am thinking there could be possibly lot of unwanted events being captured in system health. How can i find them and filter them out in this system health ?



      Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?










      share|improve this question
















      I see the default system health session events within SQL Server are 5 MB each with 4 files in total.



      We are trying to fetch data from the system health in historical events but for some critical production servers they just keep rolling over very fast. For some they stay there even for weeks



      How is the mechanism working in SQL Server of rolling over the files and is there a way I can check when and how this is happening?



      Edit@ Per Answer




      1. Event is not restarted

      2. Server is also not restarted and it happens per scheduled once a month


      Therefore i am thinking there could be possibly lot of unwanted events being captured in system health. How can i find them and filter them out in this system health ?



      Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?







      sql-server sql-server-2012 sql-server-2014 extended-events






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago







      BeginnerDBA

















      asked 3 hours ago









      BeginnerDBABeginnerDBA

      5391417




      5391417






















          1 Answer
          1






          active

          oldest

          votes


















          4















          How is the mechanism working in SQL Server of rolling over the files




          The files will roll over when any of the following occurs:




          • the file reaches its max size (in this case, 5 MB)

          • the XE session is stopped and restarted for any reason


          This could be someone actually running the command:



          ALTER EVENT SESSION [session_name]  
          ON SERVER
          STATE = STOP;


          Or it could be that the server or SQL Server instance was restarted (this seems unlikely given you mentioned this is a critical production server).






          and is there a way I can check when and how this is happening?




          If all of your files are at or around 5 MB, your server is just generating a lot of events. I have a production server that's not very busy, and it still takes less than 24 hours to fill up one of the 4 XE files with 5 MB of events. Here's a screenshot, check out the modified dates on those files:



          screenshot of Windows Explorer showing system_health XE logs



          To see what events are included in the event session in SSMS, you can go to Management → Extended Events → Sessions → right-click "system_health" and choose "Script Session as" → "CREATE to" → "New Query Editor Window".



          However, note this from the Microsoft docs article Use the system_health Session:




          We recommend that you do not stop, alter, or delete the system health session.




          So your best bet would be to create a new XE session with just the subset of events you want, and the specific Event File Target settings that work for your system.



          If the files are less than 5 MB, then the server or event session is being restarted. You can check the SQL Server error log for when restarts are happening, and you'll have to check with those who have CONTROL SERVER permissions to see who is stopping the XE session if that's the case.






          Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?




          It depends. Querying (reading) from a bunch of different files can be inconvenient. So I'd lean towards a lower total number of files, and just increasing the size of each one.



          That being said, I've never tried parsing through a really large XE file, so there might be issues with that. You'll have to test and see which one is better for your system.






          share|improve this answer


























          • Thanks, i will test those numbers and combination. I edited my question with doubt on files being rolled over. Any idea how to achieve that?

            – BeginnerDBA
            1 hour ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230689%2fhow-are-the-system-health-extended-events-files-rolling-over%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4















          How is the mechanism working in SQL Server of rolling over the files




          The files will roll over when any of the following occurs:




          • the file reaches its max size (in this case, 5 MB)

          • the XE session is stopped and restarted for any reason


          This could be someone actually running the command:



          ALTER EVENT SESSION [session_name]  
          ON SERVER
          STATE = STOP;


          Or it could be that the server or SQL Server instance was restarted (this seems unlikely given you mentioned this is a critical production server).






          and is there a way I can check when and how this is happening?




          If all of your files are at or around 5 MB, your server is just generating a lot of events. I have a production server that's not very busy, and it still takes less than 24 hours to fill up one of the 4 XE files with 5 MB of events. Here's a screenshot, check out the modified dates on those files:



          screenshot of Windows Explorer showing system_health XE logs



          To see what events are included in the event session in SSMS, you can go to Management → Extended Events → Sessions → right-click "system_health" and choose "Script Session as" → "CREATE to" → "New Query Editor Window".



          However, note this from the Microsoft docs article Use the system_health Session:




          We recommend that you do not stop, alter, or delete the system health session.




          So your best bet would be to create a new XE session with just the subset of events you want, and the specific Event File Target settings that work for your system.



          If the files are less than 5 MB, then the server or event session is being restarted. You can check the SQL Server error log for when restarts are happening, and you'll have to check with those who have CONTROL SERVER permissions to see who is stopping the XE session if that's the case.






          Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?




          It depends. Querying (reading) from a bunch of different files can be inconvenient. So I'd lean towards a lower total number of files, and just increasing the size of each one.



          That being said, I've never tried parsing through a really large XE file, so there might be issues with that. You'll have to test and see which one is better for your system.






          share|improve this answer


























          • Thanks, i will test those numbers and combination. I edited my question with doubt on files being rolled over. Any idea how to achieve that?

            – BeginnerDBA
            1 hour ago
















          4















          How is the mechanism working in SQL Server of rolling over the files




          The files will roll over when any of the following occurs:




          • the file reaches its max size (in this case, 5 MB)

          • the XE session is stopped and restarted for any reason


          This could be someone actually running the command:



          ALTER EVENT SESSION [session_name]  
          ON SERVER
          STATE = STOP;


          Or it could be that the server or SQL Server instance was restarted (this seems unlikely given you mentioned this is a critical production server).






          and is there a way I can check when and how this is happening?




          If all of your files are at or around 5 MB, your server is just generating a lot of events. I have a production server that's not very busy, and it still takes less than 24 hours to fill up one of the 4 XE files with 5 MB of events. Here's a screenshot, check out the modified dates on those files:



          screenshot of Windows Explorer showing system_health XE logs



          To see what events are included in the event session in SSMS, you can go to Management → Extended Events → Sessions → right-click "system_health" and choose "Script Session as" → "CREATE to" → "New Query Editor Window".



          However, note this from the Microsoft docs article Use the system_health Session:




          We recommend that you do not stop, alter, or delete the system health session.




          So your best bet would be to create a new XE session with just the subset of events you want, and the specific Event File Target settings that work for your system.



          If the files are less than 5 MB, then the server or event session is being restarted. You can check the SQL Server error log for when restarts are happening, and you'll have to check with those who have CONTROL SERVER permissions to see who is stopping the XE session if that's the case.






          Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?




          It depends. Querying (reading) from a bunch of different files can be inconvenient. So I'd lean towards a lower total number of files, and just increasing the size of each one.



          That being said, I've never tried parsing through a really large XE file, so there might be issues with that. You'll have to test and see which one is better for your system.






          share|improve this answer


























          • Thanks, i will test those numbers and combination. I edited my question with doubt on files being rolled over. Any idea how to achieve that?

            – BeginnerDBA
            1 hour ago














          4












          4








          4








          How is the mechanism working in SQL Server of rolling over the files




          The files will roll over when any of the following occurs:




          • the file reaches its max size (in this case, 5 MB)

          • the XE session is stopped and restarted for any reason


          This could be someone actually running the command:



          ALTER EVENT SESSION [session_name]  
          ON SERVER
          STATE = STOP;


          Or it could be that the server or SQL Server instance was restarted (this seems unlikely given you mentioned this is a critical production server).






          and is there a way I can check when and how this is happening?




          If all of your files are at or around 5 MB, your server is just generating a lot of events. I have a production server that's not very busy, and it still takes less than 24 hours to fill up one of the 4 XE files with 5 MB of events. Here's a screenshot, check out the modified dates on those files:



          screenshot of Windows Explorer showing system_health XE logs



          To see what events are included in the event session in SSMS, you can go to Management → Extended Events → Sessions → right-click "system_health" and choose "Script Session as" → "CREATE to" → "New Query Editor Window".



          However, note this from the Microsoft docs article Use the system_health Session:




          We recommend that you do not stop, alter, or delete the system health session.




          So your best bet would be to create a new XE session with just the subset of events you want, and the specific Event File Target settings that work for your system.



          If the files are less than 5 MB, then the server or event session is being restarted. You can check the SQL Server error log for when restarts are happening, and you'll have to check with those who have CONTROL SERVER permissions to see who is stopping the XE session if that's the case.






          Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?




          It depends. Querying (reading) from a bunch of different files can be inconvenient. So I'd lean towards a lower total number of files, and just increasing the size of each one.



          That being said, I've never tried parsing through a really large XE file, so there might be issues with that. You'll have to test and see which one is better for your system.






          share|improve this answer
















          How is the mechanism working in SQL Server of rolling over the files




          The files will roll over when any of the following occurs:




          • the file reaches its max size (in this case, 5 MB)

          • the XE session is stopped and restarted for any reason


          This could be someone actually running the command:



          ALTER EVENT SESSION [session_name]  
          ON SERVER
          STATE = STOP;


          Or it could be that the server or SQL Server instance was restarted (this seems unlikely given you mentioned this is a critical production server).






          and is there a way I can check when and how this is happening?




          If all of your files are at or around 5 MB, your server is just generating a lot of events. I have a production server that's not very busy, and it still takes less than 24 hours to fill up one of the 4 XE files with 5 MB of events. Here's a screenshot, check out the modified dates on those files:



          screenshot of Windows Explorer showing system_health XE logs



          To see what events are included in the event session in SSMS, you can go to Management → Extended Events → Sessions → right-click "system_health" and choose "Script Session as" → "CREATE to" → "New Query Editor Window".



          However, note this from the Microsoft docs article Use the system_health Session:




          We recommend that you do not stop, alter, or delete the system health session.




          So your best bet would be to create a new XE session with just the subset of events you want, and the specific Event File Target settings that work for your system.



          If the files are less than 5 MB, then the server or event session is being restarted. You can check the SQL Server error log for when restarts are happening, and you'll have to check with those who have CONTROL SERVER permissions to see who is stopping the XE session if that's the case.






          Also, should we be increasing file sizes say 200 MB 4 files or just keep small size files like 10 MB 80 files? Which one is better?




          It depends. Querying (reading) from a bunch of different files can be inconvenient. So I'd lean towards a lower total number of files, and just increasing the size of each one.



          That being said, I've never tried parsing through a really large XE file, so there might be issues with that. You'll have to test and see which one is better for your system.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 1 hour ago









          MDCCL

          6,84331745




          6,84331745










          answered 2 hours ago









          jadarnel27jadarnel27

          5,84411938




          5,84411938













          • Thanks, i will test those numbers and combination. I edited my question with doubt on files being rolled over. Any idea how to achieve that?

            – BeginnerDBA
            1 hour ago



















          • Thanks, i will test those numbers and combination. I edited my question with doubt on files being rolled over. Any idea how to achieve that?

            – BeginnerDBA
            1 hour ago

















          Thanks, i will test those numbers and combination. I edited my question with doubt on files being rolled over. Any idea how to achieve that?

          – BeginnerDBA
          1 hour ago





          Thanks, i will test those numbers and combination. I edited my question with doubt on files being rolled over. Any idea how to achieve that?

          – BeginnerDBA
          1 hour ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230689%2fhow-are-the-system-health-extended-events-files-rolling-over%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

          Meter-Bus Содержание Параметры шины | Стандартизация |...