January 23, 2019 at 3:46 pm
Can SQL server have multiple Tempdb, and assign users to use different tempdb like Oracle does?
Thanks
January 23, 2019 at 4:11 pm
sqlfriends - Wednesday, January 23, 2019 3:46 PMCan SQL server have multiple Tempdb, and assign users to use different tempdb like Oracle does?Thanks
I would guess you mean like temporary tablespaces in Oracle and the answer would be no.
Sue
January 23, 2019 at 4:19 pm
yes, I did mean tablespace in Oracle. For in oracle you can assign different users to different tablespace.
In case one user use extensivly tablespace, we can assign it a different one from others.
But it looks like in SQL server we can have only one tempdb.
January 23, 2019 at 5:09 pm
for tempdb there is nothing you can do.
if however you are also talking about having all permanent tables of a user on their own file(s) then it is possible although not in a easy way.
on each database where you wish to force the users data to go to their individual files (filegroup in SQL Server terms) you can create a database trigger to rebuild any table created onto a specific filegroup - this could be based on the user name.
Once off task
- create a trigger to rebuild any table/index on the filegroup assigned to each user if applicable (otherwise do nothing). based on a hardcoded list or on a configuration table.
once off steps at user creation time
- create filegroup (and add corresponding files)
- add user/filegroup mapping to a table (or hardcode on the trigger)
Issues with this is that if the user creates a table with "select * into permtable from ...." the trigger will cause the table creation to fail.
Only works if a explicit "create table" is issued.
January 24, 2019 at 4:34 am
sqlfriends - Wednesday, January 23, 2019 3:46 PMCan SQL server have multiple Tempdb, and assign users to use different tempdb like Oracle does?Thanks
You can create multiple data files for tempdb which will increase the performance.
Why do you want more than one tempdb?
January 24, 2019 at 9:26 am
Yes, make tempdb in multiple files that could make use of the cores and reduce the contention.
We have already done so. 8 tempdb files. Our situation is some that adhoc queries and BI self service tools usage from users that highly use the tempdb.
So I am thinking that Oracle can assign different users to use different tempdb to isolate usage of the tempdb.
January 24, 2019 at 6:47 pm
sqlfriends - Thursday, January 24, 2019 9:26 AMOur situation is some that adhoc queries and BI self service tools usage from users that highly use the tempdb.So I am thinking that Oracle can assign different users to use different tempdb to isolate usage of the tempdb.
This IS a production box, right? You're trying to resolve the wrong problem. If users have ad hoc queries and BI self service tools that are driving TempDB into the stops, you need to fix those problems rather than ignore them.
Also, how big is each file for TempDB?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 25, 2019 at 1:59 pm
What Jeff said. It is worth it to tune tempdb and then make everyone use it correctly. The management strategy that you are suggesting just sounds like pushing the real problem off.
January 25, 2019 at 2:23 pm
i am not ignoring the problem. Just want to separate the hdhoc, or self -service based query aside from other main functionality of this server.
January 25, 2019 at 2:34 pm
sqlfriends - Friday, January 25, 2019 2:23 PMi am not ignoring the problem. Just want to separate the hdhoc, or self -service based query aside from other main functionality of this server.
That's ignoring the problem. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
January 25, 2019 at 2:44 pm
What Jeff said again. For example, if you have a bunch of ad hoc users that are affecting production, the solution is to probably build them a data warehouse. Doing weird junk to a production tempdb is not the way to go.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply