Proper Guidelines for new Database setup in SQL Server
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:
- How to define
initial size
to create Database - Should i use different
file and filegroups
- What type of
Collation
should i select - Any tips for
tempdb
configuration - How to defined how much resource needed and how to allocate them.
- How to handle
Server Memory Setup
(Minimum server memory, Maximum
server memory, Index creation memory, Minimum memory per query) - How to calculate/estimated number of Maximum
worker threads
- How to calculate/estimated Maximum number of
concurrent connections
- How to configure
SQL Server Parallelism
(Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)
Thanks in Advance
sql-server configuration
New contributor
add a comment |
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:
- How to define
initial size
to create Database - Should i use different
file and filegroups
- What type of
Collation
should i select - Any tips for
tempdb
configuration - How to defined how much resource needed and how to allocate them.
- How to handle
Server Memory Setup
(Minimum server memory, Maximum
server memory, Index creation memory, Minimum memory per query) - How to calculate/estimated number of Maximum
worker threads
- How to calculate/estimated Maximum number of
concurrent connections
- How to configure
SQL Server Parallelism
(Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)
Thanks in Advance
sql-server configuration
New contributor
add a comment |
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:
- How to define
initial size
to create Database - Should i use different
file and filegroups
- What type of
Collation
should i select - Any tips for
tempdb
configuration - How to defined how much resource needed and how to allocate them.
- How to handle
Server Memory Setup
(Minimum server memory, Maximum
server memory, Index creation memory, Minimum memory per query) - How to calculate/estimated number of Maximum
worker threads
- How to calculate/estimated Maximum number of
concurrent connections
- How to configure
SQL Server Parallelism
(Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)
Thanks in Advance
sql-server configuration
New contributor
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:
- How to define
initial size
to create Database - Should i use different
file and filegroups
- What type of
Collation
should i select - Any tips for
tempdb
configuration - How to defined how much resource needed and how to allocate them.
- How to handle
Server Memory Setup
(Minimum server memory, Maximum
server memory, Index creation memory, Minimum memory per query) - How to calculate/estimated number of Maximum
worker threads
- How to calculate/estimated Maximum number of
concurrent connections
- How to configure
SQL Server Parallelism
(Cost Threshold for Parallelism, Locks, Max Degree, Query Wait)
Thanks in Advance
sql-server configuration
sql-server configuration
New contributor
New contributor
edited 1 hour ago
Shanky
13.9k32039
13.9k32039
New contributor
asked 1 hour ago
Md. Zakir Hossain
1063
1063
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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