SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


TempDB Deleted Accidentally


TempDB Deleted Accidentally

Author
Message
Tushar Kanti
Tushar Kanti
SSChasing Mays
SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)

Group: General Forum Members
Points: 646 Visits: 530
Comments posted to this topic are about the item TempDB Deleted Accidentally
Mr. hoek
Mr. hoek
SSC Veteran
SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)

Group: General Forum Members
Points: 226 Visits: 52
Why not just 'create' the G: drive?

- ex: subst g: <anypath>

Then one does not have to run the SQL in Single User mode and such....
sqlsc-790406
sqlsc-790406
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 20
SQL server doesn't care much where you put stuff, only that the path exist
so you could also use good old dos command SUBST e.g.:

Create a folder c:\temp\data whith the correct ntfs permissions
SUBST g: c:\temp\
Start SQL server Service
Start SSMS
move tempdb to somewhere safe
etc.
when finished:
SUBST g: /d

Rob.
Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)

Group: General Forum Members
Points: 148370 Visits: 18282
the article is correct, subst will not work especially if the service runs under a user account. The steps are perfectly reasonable, although i have to say this topic (starting in single user mode) has been done to death.

For reference, there is no MOVE parameter for ALTER DATABASE you should use MODIFY to alter a file or filegroup. Otherwise very tidy article, well done

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
Mr. hoek
Mr. hoek
SSC Veteran
SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)SSC Veteran (226 reputation)

Group: General Forum Members
Points: 226 Visits: 52
Of course - thanks for mentioning this (sometimes one types faster then on thinks :-P)
Resender
Resender
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4134 Visits: 1578
I've been training to get 70-432 certification and came across this problem as well.

My personal opinion is that not only should you try and move tempdb to another location the default but his must be well documented.
M&M
M&M
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13140 Visits: 3919
Nice article, but I thought there would be something more than starting sql server in single user mode Smile

M&M
Peter Pirker
Peter Pirker
Mr or Mrs. 500
Mr or Mrs. 500 (589 reputation)Mr or Mrs. 500 (589 reputation)Mr or Mrs. 500 (589 reputation)Mr or Mrs. 500 (589 reputation)Mr or Mrs. 500 (589 reputation)Mr or Mrs. 500 (589 reputation)Mr or Mrs. 500 (589 reputation)Mr or Mrs. 500 (589 reputation)

Group: General Forum Members
Points: 589 Visits: 221
Handy article, thanks.

One cannot but admire all the brave DBA's out there who have to live with "a constant fear of losing data because of the mistakes of some developer or support person". Personally, I'm sure I couldn't handle such stress!

Although, by the sound of it, that's not exactly what happended here. More like errare humanum est, eh?

;-)
Tushar Kanti
Tushar Kanti
SSChasing Mays
SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)SSChasing Mays (646 reputation)

Group: General Forum Members
Points: 646 Visits: 530
Thankyou All for the comments and views.
@ Perry Whittle . I just ment to move the files physically and not syntactically.
@ Grasshopper. I don not think that will be possible as pointed out already.

Tushar
abhijit.vedak 76782
abhijit.vedak 76782
Valued Member
Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)

Group: General Forum Members
Points: 54 Visits: 98
This reminded me of something that happened a few years ago when working on SQL Server 2000. Same scenario. Following is what I did to resolve the issue:
a) Create a dummy folder (say "X") on a drive having ample space.
b) Created the same folder hierarchy (\X\Foldername) inside this folder as the path of the folder where tempdb was supposed to be located.
c) Mapped this newly created folder (X) as the drive (G-drive in this case).

On starting the SQL Server Service, it created the tempdb on this mapped G-drive which in turn was folder "\X\Foldername".
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search