Proper Guidelines for new Database setup in SQL Server












1














I need proper guidelines to setup Database in SQL Server for sales Application (Its a huge Data Transaction System). Specifically i'm looking below information:




  1. How to define initial size to create Database

  2. Should i use different file and filegroups

  3. What type of Collation should i select

  4. Any tips for tempdb configuration

  5. How to defined how much resource needed and how to allocate them.

  6. How to handle Server Memory Setup (Minimum server memory, Maximum
    server memory, Index creation memory, Minimum memory per query)

  7. How to calculate/estimated number of Maximum worker threads

  8. How to calculate/estimated Maximum number of concurrent connections

  9. How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)


Thanks in Advance










share|improve this question









New contributor




Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1














    I need proper guidelines to setup Database in SQL Server for sales Application (Its a huge Data Transaction System). Specifically i'm looking below information:




    1. How to define initial size to create Database

    2. Should i use different file and filegroups

    3. What type of Collation should i select

    4. Any tips for tempdb configuration

    5. How to defined how much resource needed and how to allocate them.

    6. How to handle Server Memory Setup (Minimum server memory, Maximum
      server memory, Index creation memory, Minimum memory per query)

    7. How to calculate/estimated number of Maximum worker threads

    8. How to calculate/estimated Maximum number of concurrent connections

    9. How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)


    Thanks in Advance










    share|improve this question









    New contributor




    Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1







      I need proper guidelines to setup Database in SQL Server for sales Application (Its a huge Data Transaction System). Specifically i'm looking below information:




      1. How to define initial size to create Database

      2. Should i use different file and filegroups

      3. What type of Collation should i select

      4. Any tips for tempdb configuration

      5. How to defined how much resource needed and how to allocate them.

      6. How to handle Server Memory Setup (Minimum server memory, Maximum
        server memory, Index creation memory, Minimum memory per query)

      7. How to calculate/estimated number of Maximum worker threads

      8. How to calculate/estimated Maximum number of concurrent connections

      9. How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)


      Thanks in Advance










      share|improve this question









      New contributor




      Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I need proper guidelines to setup Database in SQL Server for sales Application (Its a huge Data Transaction System). Specifically i'm looking below information:




      1. How to define initial size to create Database

      2. Should i use different file and filegroups

      3. What type of Collation should i select

      4. Any tips for tempdb configuration

      5. How to defined how much resource needed and how to allocate them.

      6. How to handle Server Memory Setup (Minimum server memory, Maximum
        server memory, Index creation memory, Minimum memory per query)

      7. How to calculate/estimated number of Maximum worker threads

      8. How to calculate/estimated Maximum number of concurrent connections

      9. How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)


      Thanks in Advance







      sql-server configuration






      share|improve this question









      New contributor




      Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 1 hour ago









      Shanky

      13.9k32039




      13.9k32039






      New contributor




      Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      Md. Zakir Hossain

      1063




      1063




      New contributor




      Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Md. Zakir Hossain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          2















          How to define initial size to create Database




          Well I believe you are asking what value to select for initial size ?. If so, I am sorry to say that it depends on your environment. But please do not leave it to default of 2 MB (for data file) and 1 MB (for log file). I wish MS had better value set as default but this is AFAIK from SQL Server 2005 and has not been changed yet. If you ask me, I would suggest to keep initial size to as much as possible to avoid autogrowth. Suppose you know your database would be 500 GB in year keep it to 300 GB and forget the hassle of autogrowth and slowness due to it, there is no harm in giving as much space to data file as it needs this is only going to benefit the queries. This size if for data file, for log file you would have to figure out yourself. SQL Server Database growth and Autogrowth Setting article would help you more.




          Should i use different file and filegroups




          Well again the answer is "it depends", file and filegroups are more for making DBA's management job easier and segregating things. If you have large database where you want to offload non critical objects which are accessed less on slow drive and move more accessed objects on faster drive you can do it via filegroups. You can also move one BIG table to altogether different filegroup residing on fast drive to make queries faster. Please read below 2 discussions.




          • Benefit to use multiple filegroups

          • Benefit of filegroups and setting filegroups to read-only



          What type of Collation should i select




          That definitely I cannot tell and you should ask the respective teams.




          Any tips for tempdb configuration




          A lot, please refer to below links. Since you have not added what version of SQL Server you are talking I would only suggest very basic things. Putting tempdb on faster drive makes queries using temp tables fast. Make sure you correctly add temdb data files and keep initial size and autogrowth same for all the data files. For SQL Server 2014 and before enabling TF 1117 and 1118 is also recommended. For SQL Server 2016 and above TF's are not required. More details Here




          • Correctly adding Tempdb Files

          • Cheat Sheet How to Configure Tempdb



          How to defined how much resource needed and how to allocate them




          That needs lot of information from your side. There is no direct formula for it.




          How to handle Server Memory Setup (Minimum server memory, Maximum server memory, Index creation memory, Minimum memory per query)




          To configure max server memory please refer What is a deterministic method for evaluating a sensible buffer pool size?. Don't touch index creation memory and minimum memory per query. If you are having just one instance of SQL server leave min server memory to default.



          Ignore points 7 should not touch those settings unless you are expert. The default just works fine. You should let SQL Server decide worker threads it does the job beautifully.




          How to calculate/estimated Maximum number of concurrent connections




          Unless you start putting some load on server there is hardly any point in getting concurrent connection. For getting max connections on SQL Server hitting see Stackexchange thread Max Number of connection




          How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)




          You just need to setup proper max degree of parallelism rest you should leave to default. For maxdop setting refer MAXDOP setting algorithm for SQL Server






          share|improve this answer























          • thanks. Could you please suggest me any article for Question No-5
            – Md. Zakir Hossain
            15 mins ago












          • You need to be more clear about what resources you are talking about. There is no rule you would have to start by your own. How big is your application, how many users would be accessing it, what would be size of database ?.
            – Shanky
            7 mins 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
          });


          }
          });






          Md. Zakir Hossain is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f226132%2fproper-guidelines-for-new-database-setup-in-sql-server%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









          2















          How to define initial size to create Database




          Well I believe you are asking what value to select for initial size ?. If so, I am sorry to say that it depends on your environment. But please do not leave it to default of 2 MB (for data file) and 1 MB (for log file). I wish MS had better value set as default but this is AFAIK from SQL Server 2005 and has not been changed yet. If you ask me, I would suggest to keep initial size to as much as possible to avoid autogrowth. Suppose you know your database would be 500 GB in year keep it to 300 GB and forget the hassle of autogrowth and slowness due to it, there is no harm in giving as much space to data file as it needs this is only going to benefit the queries. This size if for data file, for log file you would have to figure out yourself. SQL Server Database growth and Autogrowth Setting article would help you more.




          Should i use different file and filegroups




          Well again the answer is "it depends", file and filegroups are more for making DBA's management job easier and segregating things. If you have large database where you want to offload non critical objects which are accessed less on slow drive and move more accessed objects on faster drive you can do it via filegroups. You can also move one BIG table to altogether different filegroup residing on fast drive to make queries faster. Please read below 2 discussions.




          • Benefit to use multiple filegroups

          • Benefit of filegroups and setting filegroups to read-only



          What type of Collation should i select




          That definitely I cannot tell and you should ask the respective teams.




          Any tips for tempdb configuration




          A lot, please refer to below links. Since you have not added what version of SQL Server you are talking I would only suggest very basic things. Putting tempdb on faster drive makes queries using temp tables fast. Make sure you correctly add temdb data files and keep initial size and autogrowth same for all the data files. For SQL Server 2014 and before enabling TF 1117 and 1118 is also recommended. For SQL Server 2016 and above TF's are not required. More details Here




          • Correctly adding Tempdb Files

          • Cheat Sheet How to Configure Tempdb



          How to defined how much resource needed and how to allocate them




          That needs lot of information from your side. There is no direct formula for it.




          How to handle Server Memory Setup (Minimum server memory, Maximum server memory, Index creation memory, Minimum memory per query)




          To configure max server memory please refer What is a deterministic method for evaluating a sensible buffer pool size?. Don't touch index creation memory and minimum memory per query. If you are having just one instance of SQL server leave min server memory to default.



          Ignore points 7 should not touch those settings unless you are expert. The default just works fine. You should let SQL Server decide worker threads it does the job beautifully.




          How to calculate/estimated Maximum number of concurrent connections




          Unless you start putting some load on server there is hardly any point in getting concurrent connection. For getting max connections on SQL Server hitting see Stackexchange thread Max Number of connection




          How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)




          You just need to setup proper max degree of parallelism rest you should leave to default. For maxdop setting refer MAXDOP setting algorithm for SQL Server






          share|improve this answer























          • thanks. Could you please suggest me any article for Question No-5
            – Md. Zakir Hossain
            15 mins ago












          • You need to be more clear about what resources you are talking about. There is no rule you would have to start by your own. How big is your application, how many users would be accessing it, what would be size of database ?.
            – Shanky
            7 mins ago
















          2















          How to define initial size to create Database




          Well I believe you are asking what value to select for initial size ?. If so, I am sorry to say that it depends on your environment. But please do not leave it to default of 2 MB (for data file) and 1 MB (for log file). I wish MS had better value set as default but this is AFAIK from SQL Server 2005 and has not been changed yet. If you ask me, I would suggest to keep initial size to as much as possible to avoid autogrowth. Suppose you know your database would be 500 GB in year keep it to 300 GB and forget the hassle of autogrowth and slowness due to it, there is no harm in giving as much space to data file as it needs this is only going to benefit the queries. This size if for data file, for log file you would have to figure out yourself. SQL Server Database growth and Autogrowth Setting article would help you more.




          Should i use different file and filegroups




          Well again the answer is "it depends", file and filegroups are more for making DBA's management job easier and segregating things. If you have large database where you want to offload non critical objects which are accessed less on slow drive and move more accessed objects on faster drive you can do it via filegroups. You can also move one BIG table to altogether different filegroup residing on fast drive to make queries faster. Please read below 2 discussions.




          • Benefit to use multiple filegroups

          • Benefit of filegroups and setting filegroups to read-only



          What type of Collation should i select




          That definitely I cannot tell and you should ask the respective teams.




          Any tips for tempdb configuration




          A lot, please refer to below links. Since you have not added what version of SQL Server you are talking I would only suggest very basic things. Putting tempdb on faster drive makes queries using temp tables fast. Make sure you correctly add temdb data files and keep initial size and autogrowth same for all the data files. For SQL Server 2014 and before enabling TF 1117 and 1118 is also recommended. For SQL Server 2016 and above TF's are not required. More details Here




          • Correctly adding Tempdb Files

          • Cheat Sheet How to Configure Tempdb



          How to defined how much resource needed and how to allocate them




          That needs lot of information from your side. There is no direct formula for it.




          How to handle Server Memory Setup (Minimum server memory, Maximum server memory, Index creation memory, Minimum memory per query)




          To configure max server memory please refer What is a deterministic method for evaluating a sensible buffer pool size?. Don't touch index creation memory and minimum memory per query. If you are having just one instance of SQL server leave min server memory to default.



          Ignore points 7 should not touch those settings unless you are expert. The default just works fine. You should let SQL Server decide worker threads it does the job beautifully.




          How to calculate/estimated Maximum number of concurrent connections




          Unless you start putting some load on server there is hardly any point in getting concurrent connection. For getting max connections on SQL Server hitting see Stackexchange thread Max Number of connection




          How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)




          You just need to setup proper max degree of parallelism rest you should leave to default. For maxdop setting refer MAXDOP setting algorithm for SQL Server






          share|improve this answer























          • thanks. Could you please suggest me any article for Question No-5
            – Md. Zakir Hossain
            15 mins ago












          • You need to be more clear about what resources you are talking about. There is no rule you would have to start by your own. How big is your application, how many users would be accessing it, what would be size of database ?.
            – Shanky
            7 mins ago














          2












          2








          2







          How to define initial size to create Database




          Well I believe you are asking what value to select for initial size ?. If so, I am sorry to say that it depends on your environment. But please do not leave it to default of 2 MB (for data file) and 1 MB (for log file). I wish MS had better value set as default but this is AFAIK from SQL Server 2005 and has not been changed yet. If you ask me, I would suggest to keep initial size to as much as possible to avoid autogrowth. Suppose you know your database would be 500 GB in year keep it to 300 GB and forget the hassle of autogrowth and slowness due to it, there is no harm in giving as much space to data file as it needs this is only going to benefit the queries. This size if for data file, for log file you would have to figure out yourself. SQL Server Database growth and Autogrowth Setting article would help you more.




          Should i use different file and filegroups




          Well again the answer is "it depends", file and filegroups are more for making DBA's management job easier and segregating things. If you have large database where you want to offload non critical objects which are accessed less on slow drive and move more accessed objects on faster drive you can do it via filegroups. You can also move one BIG table to altogether different filegroup residing on fast drive to make queries faster. Please read below 2 discussions.




          • Benefit to use multiple filegroups

          • Benefit of filegroups and setting filegroups to read-only



          What type of Collation should i select




          That definitely I cannot tell and you should ask the respective teams.




          Any tips for tempdb configuration




          A lot, please refer to below links. Since you have not added what version of SQL Server you are talking I would only suggest very basic things. Putting tempdb on faster drive makes queries using temp tables fast. Make sure you correctly add temdb data files and keep initial size and autogrowth same for all the data files. For SQL Server 2014 and before enabling TF 1117 and 1118 is also recommended. For SQL Server 2016 and above TF's are not required. More details Here




          • Correctly adding Tempdb Files

          • Cheat Sheet How to Configure Tempdb



          How to defined how much resource needed and how to allocate them




          That needs lot of information from your side. There is no direct formula for it.




          How to handle Server Memory Setup (Minimum server memory, Maximum server memory, Index creation memory, Minimum memory per query)




          To configure max server memory please refer What is a deterministic method for evaluating a sensible buffer pool size?. Don't touch index creation memory and minimum memory per query. If you are having just one instance of SQL server leave min server memory to default.



          Ignore points 7 should not touch those settings unless you are expert. The default just works fine. You should let SQL Server decide worker threads it does the job beautifully.




          How to calculate/estimated Maximum number of concurrent connections




          Unless you start putting some load on server there is hardly any point in getting concurrent connection. For getting max connections on SQL Server hitting see Stackexchange thread Max Number of connection




          How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)




          You just need to setup proper max degree of parallelism rest you should leave to default. For maxdop setting refer MAXDOP setting algorithm for SQL Server






          share|improve this answer















          How to define initial size to create Database




          Well I believe you are asking what value to select for initial size ?. If so, I am sorry to say that it depends on your environment. But please do not leave it to default of 2 MB (for data file) and 1 MB (for log file). I wish MS had better value set as default but this is AFAIK from SQL Server 2005 and has not been changed yet. If you ask me, I would suggest to keep initial size to as much as possible to avoid autogrowth. Suppose you know your database would be 500 GB in year keep it to 300 GB and forget the hassle of autogrowth and slowness due to it, there is no harm in giving as much space to data file as it needs this is only going to benefit the queries. This size if for data file, for log file you would have to figure out yourself. SQL Server Database growth and Autogrowth Setting article would help you more.




          Should i use different file and filegroups




          Well again the answer is "it depends", file and filegroups are more for making DBA's management job easier and segregating things. If you have large database where you want to offload non critical objects which are accessed less on slow drive and move more accessed objects on faster drive you can do it via filegroups. You can also move one BIG table to altogether different filegroup residing on fast drive to make queries faster. Please read below 2 discussions.




          • Benefit to use multiple filegroups

          • Benefit of filegroups and setting filegroups to read-only



          What type of Collation should i select




          That definitely I cannot tell and you should ask the respective teams.




          Any tips for tempdb configuration




          A lot, please refer to below links. Since you have not added what version of SQL Server you are talking I would only suggest very basic things. Putting tempdb on faster drive makes queries using temp tables fast. Make sure you correctly add temdb data files and keep initial size and autogrowth same for all the data files. For SQL Server 2014 and before enabling TF 1117 and 1118 is also recommended. For SQL Server 2016 and above TF's are not required. More details Here




          • Correctly adding Tempdb Files

          • Cheat Sheet How to Configure Tempdb



          How to defined how much resource needed and how to allocate them




          That needs lot of information from your side. There is no direct formula for it.




          How to handle Server Memory Setup (Minimum server memory, Maximum server memory, Index creation memory, Minimum memory per query)




          To configure max server memory please refer What is a deterministic method for evaluating a sensible buffer pool size?. Don't touch index creation memory and minimum memory per query. If you are having just one instance of SQL server leave min server memory to default.



          Ignore points 7 should not touch those settings unless you are expert. The default just works fine. You should let SQL Server decide worker threads it does the job beautifully.




          How to calculate/estimated Maximum number of concurrent connections




          Unless you start putting some load on server there is hardly any point in getting concurrent connection. For getting max connections on SQL Server hitting see Stackexchange thread Max Number of connection




          How to configure SQL Server Parallelism (Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)




          You just need to setup proper max degree of parallelism rest you should leave to default. For maxdop setting refer MAXDOP setting algorithm for SQL Server







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 29 mins ago

























          answered 1 hour ago









          Shanky

          13.9k32039




          13.9k32039












          • thanks. Could you please suggest me any article for Question No-5
            – Md. Zakir Hossain
            15 mins ago












          • You need to be more clear about what resources you are talking about. There is no rule you would have to start by your own. How big is your application, how many users would be accessing it, what would be size of database ?.
            – Shanky
            7 mins ago


















          • thanks. Could you please suggest me any article for Question No-5
            – Md. Zakir Hossain
            15 mins ago












          • You need to be more clear about what resources you are talking about. There is no rule you would have to start by your own. How big is your application, how many users would be accessing it, what would be size of database ?.
            – Shanky
            7 mins ago
















          thanks. Could you please suggest me any article for Question No-5
          – Md. Zakir Hossain
          15 mins ago






          thanks. Could you please suggest me any article for Question No-5
          – Md. Zakir Hossain
          15 mins ago














          You need to be more clear about what resources you are talking about. There is no rule you would have to start by your own. How big is your application, how many users would be accessing it, what would be size of database ?.
          – Shanky
          7 mins ago




          You need to be more clear about what resources you are talking about. There is no rule you would have to start by your own. How big is your application, how many users would be accessing it, what would be size of database ?.
          – Shanky
          7 mins ago










          Md. Zakir Hossain is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Md. Zakir Hossain is a new contributor. Be nice, and check out our Code of Conduct.













          Md. Zakir Hossain is a new contributor. Be nice, and check out our Code of Conduct.












          Md. Zakir Hossain is a new contributor. Be nice, and check out our Code of Conduct.
















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f226132%2fproper-guidelines-for-new-database-setup-in-sql-server%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

          Understanding the information contained in the Deep Space Network XML data?

          Ross-on-Wye

          Eastern Orthodox Church