MSSQLWIKI

Karthick P.K on SQL Server

The database ‘model’ is marked RESTORING and is in a state that does not allow recovery to be run.Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive

Posted by Karthick P.K on November 25, 2010

The database ‘model’ is marked RESTORING and is in a state that does not allow recovery to be run.Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive

Error:

The database ‘model’ is marked RESTORING and is in a state that does not allow recovery to be run.

Error: 927, Severity: 14, State: 2.

Database ‘model’ cannot be opened. It is in the middle of a restore.

Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive and then restart SQL Server. Check for additional errors in the event log that may indicate why the tempdb files could not be initialized.

 

Cause

We get above error if the Model database is corrupted. TempDB is recreated every time when SQLServer restarts using model database, We receive "Could not create tempdb" because model database is corrupted

Resolution

1. Start SQLServer with Traceflag 3608,3609,-c,-f

-T3609 Will keep the existing TEMPDB, Which means when SQLServer is restarted SQLServer uses the existing tempdb instead of re-creating it as long as checkpoint in the tempdb had been done immediately before the last server shutdown

{

Sqlservr.exe -sInstanceName -T3608 -c -f -T3609

}

2. Open SQLCMD and make DAC connection

{

SQLCMD -E -SADMIN:Servername\InstanceName

}

3. Use Tempdb

Go

{

Above command will open the TempDB. If you get error while executing "Use Tempdb" your tempdb is not cleanly shutdown.

To work around this copy a Tempdb.mdf and templog.ldf from Cleanly shutdown SQLServer of same version and replace it in TEMPDB location.

Also note Transaction log location is stored in Tempdb.mdf.So you may have to copy Tlog file in destination server in same directory structure as it existed source server .

Once you copy the file restart SQLServer using -T3608 -c -f -T3609 Then run

Use Tempdb

Go

}

4. sp_detach_db ‘model

5. Replace model.mdf and model.ldf from different server of same build

5. sp_attach_db ‘model’,’X:\PAth\model.mdf’,’x:\modellog.ldf’

{

Note: If you are in SQLServer2008 we can use "create database with attach" option

 CREATE DATABASE [model] ON
 ( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.R2\MSSQL\DATA\model.mdf' ),
 ( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.R2\MSSQL\DATA\modellog.ldf' )
 FOR ATTACH
 go

}

Now we can start SQL Server normally and if you find any database in restoring state if can use RESTORE database DBNAME WITH RECOVERY to recover and open the database.

 

 

Thank You and Best Regards,

Karthick P.K

24 Responses to “The database ‘model’ is marked RESTORING and is in a state that does not allow recovery to be run.Could not create tempdb. You may not have enough disk space available. Free additional disk space by deleting other files on the tempdb drive”

  1. Luca said

    Thanks designed for sharing such a fastidious thinking, post
    is good, thats why i have read it fully

  2. […] The database ‘model’ is marked RESTORING and is in a state that does not allow recovery to be ru… […]

  3. I am really enjoying the theme/design of your weblog.

    Do you ever run into any browser compatibility problems?
    A number of my blog readers have complained about my blog not operating correctly in Explorer but looks great in
    Opera. Do you have any tips to help fix this problem?

  4. Nice post. I was checking constantly this weblog and I’m inspired!
    Very useful information specifically the remaining section :
    ) I care for such information a lot. I was looking for
    this particular information for a long time. Thanks and good luck.

  5. Simply want to say your article is as astounding.
    The clearness to your publish is just cool and that i could think you are an expert on this subject.
    Well along with your permission let me to seize your RSS
    feed to keep updated with imminent post. Thanks 1,000,000 and please keep up the gratifying work.

  6. You will not be restricted to use AT&T inside the USwith your iPhone if you unlock it.

    There are several paid and free of charge iPhone unlocking computer software program out there on line.

  7. Madeline said

    We absolutely love your blog and find almost all of your post’s to be just what I’m looking for.
    Do you offer guest writers to write content for you? I
    wouldn’t mind producing a post or elaborating on a few of the subjects you write with regards to here.
    Again, awesome web log!

  8. Appreciating the time and effort you put into
    your site and in depth information you offer. It’s awesome to come
    across a blog every once in a while that isn’t the same
    old rehashed material. Excellent read! I’ve bookmarked your site and I’m including your RSS feeds
    to my Google account.

  9. It’s appropriate time to make some plans for the future and it is time
    to be happy. I’ve read this publish and if I may just I
    desire to counsel you few fascinating issues or advice.
    Perhaps you can write subsequent articles relating to this article.
    I wish to learn even more things about it!

  10. I think the admin of this website is really working hard
    in favor of his site, as here every information is quality based stuff.

  11. narensy said

    Excellent Work by Karthick

  12. This paragraph will assist the internet people for creating new webpage or even a blog from start to end.

  13. fog said

    Right now it seems like WordPress is the top blogging platform available right now.
    (from what I’ve read) Is that what you arre using on your blog?

  14. I don’t know if it’s just me or if perhaps everybody else encountering issues with your blog.
    It appears as if some of the text in your content are running off
    the screen. Can somebody else please comment and let me know if this is happening to them as well?

    This could be a issue with my internet browser because I’ve had this happen before.
    Appreciate it

  15. Wonderful post! We will be linking to this great content on our site.

    Keep up thhe great writing.

  16. I am no longer certain where you are getting your information,
    but good topic. I must spend a while studying much
    more or understanding more. Thank you for magnificent information I used to be on the lookout for this info for my mission.

  17. Your style is really unique compared to other folks I have read stuff from.
    Thank you for posting when you have the opportunity, Guess I’ll just bookmark this
    site.

  18. Valerie said

    Each of these three multi-packs of mini Coraline movie merchandise feature a different version of Coraline Jones herself with the sarcastic cat.
    For more printed Coraline movie merchandise,
    there’s also a film edition of the original Coraline story by Neil Gaiman, featuring images from the film version. The name Ibiza has been synonymous with
    the phrase.

  19. You may as well turn off syncing by not signing in to Home windows with a
    Microsoft account (or a website account connected
    to a Microsoft account).

  20. Grosse promotion: A protecting case iPhone 6 accredited to Military Common € 11.

    \

  21. Hi I am so grateful I found your site, I really found you by accident,while I was researching on Aol forr something else,
    Anyhow I am here now and would just like to say kudos for a marvelous pos and
    a alll round entertaining blog (I also love the theme/design), I don’t have time to go through it all at the moment but I hzve book-markedit and also added
    your RSS feeds, so when I have time I will be back to read
    a great deal more, Please do keep up the excellent jo.

  22. s tidak mungkin bagi perusahaan untuk mengabaikan godaan internet .
    ini, pada gilirannya, mengambil keuntungan dari layanan dengan harga terjangkau .
    Ada bberbagai kerangka kerja PHP yang tersedia di pasar yanhg membantu menyimpan sejumlah
    besar waktu Anda.

  23. I will immediately grab your rss as I can’t find your email subscription link or e-newsletter
    service. Do you have any? Please allow me realize
    so that I may just subscribe. Thanks.

  24. fantastic issues altogether, you simply received a
    brand new reader. What would you recommend about your post that you made
    some days ago? Any sure?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: