Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Recovery of TempDB

Author  Topic 

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-09 : 09:13:30
Since each time SQL server gets restarted the data and log of tempDB is also newly created.Then where does TempDB gets its recovery information from?

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-01-09 : 09:21:12
Recovery information?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-09 : 09:50:55
As far as I know recovery will consist roll forward and roll back to bring the database into consistent state.For this database needs a transaction log.How does it happen in case of TempDB.
Go to Top of Page

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-09 : 10:57:05
Please reply!
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-01-09 : 11:30:57
Please be patient! Bumping your post after an hour is just rude, especially considering it's a weekend. We're volunteers, we post in our spare time.

TempDB doesn't need to be recovered, it's recreated completely when SQL starts. Nothing that was in there before the restart will remain afterwards.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-09 : 23:24:50
Thank you so much....
Go to Top of Page

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-10 : 11:44:38
I have one more confusion..when the statement hold good when you say tempdb allows only roll back not roll forward,when the statement hold good?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-01-10 : 12:25:49
Sorry, don't understand what you're asking.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-10 : 12:57:35
There is no recovery phase for tempdb. It is recreated from scratch (with no user objects) every time SQL is restarted. Thus, no roll forward.

The only rollback will occur if an explicit transaction is rolled back, or if the service is shutdown during a transaction.
Go to Top of Page

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-10 : 13:49:46
So even if we delete Tempdb log file it will come up without any issues?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-10 : 13:58:08
Yes. But why would you do that?
Go to Top of Page

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-10 : 14:10:39
Just out of curiosity...
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-10 : 14:12:45
Sure, you can delete it (as long as the SQL Service isn't running), won't hurt anything.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-01-10 : 14:35:55
Don't go randomly deleting database files out of curiosity (unless on an instance that you're happy to completely reinstall). You could break things beyond repair


--
Gail Shaw
SQL Server MVP
Go to Top of Page

InfraDBA
Starting Member

38 Posts

Posted - 2011-01-10 : 14:42:45
well just asking in case of TempDB...:-) Thanks to all.....
Go to Top of Page
   

- Advertisement -