Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm not a dba so I don't understand the admin side of SQL Server too much. One of our sharepoint instances blew up and our IT staff asked if I could assist bring it back to life. I found backups for sharepoint which is great. The thing about sharepoint is it is huge with many many databases. I have recovered all but one database (Sharepoint_Config). This database Sharepoint_Config's log file is over 400 gigs large!

Remember this database is currently "disconnected" have you, meaning I do not have access to it via sql management studio, its just a physical ldf file and an mdf file. We have software that we use that can restore these physical files back to their original location. So that part is simple, however I do not want to restore an ldf file that is over 400 gigs large.

Is there anything I can do to fix this mess?

share|improve this question
    
Please back up both files before you start making changes or attaching them! If you screw up, that's it. Any reason you can't just attach the files to SQL Server? –  usr Jan 8 at 21:45

1 Answer 1

up vote 2 down vote accepted

It sounds like no one took log backups on that database for a very long time. Restore the MDF and try:

EXEC sp_attach_single_file_db @dbname='YourDB',
@physname=N'C:\Path\To\YourDb.mdf'
GO

Then set up regular backups for those databases, both full and log backups. This is an article on log backups that might help. This is a more general article on SQL Server backups.

Good luck!

share|improve this answer
1  
Hi Katherine, I will try this out in about 10 minutes, waiting for the completion of some other databases but I will report back. Thank you –  JonH Jan 8 at 14:58
    
Hi Katherine, I guess management studio sees this database name already (SharePoint_Config). However, there is no log file associated with it because I never restored the log file. Because there is no log file I cannot expand the database. I can take a screen shot and post it to my question if you want? –  JonH Jan 8 at 15:26
    
Hi Katherine, here is the image screen shot: imgur.com/xEIi3MT –  JonH Jan 8 at 15:27
1  
No, that's okay. Detach the existing SharePoint_Config and continue. –  Katherine Villyard Jan 8 at 15:28
1  
kevinsky - True, but some companies resort to stuff like this to save money. The better option would be to hire a dba or at least get short term help. I was able to fix this although it was rough. I had to actually restore the huge trans log file, then shrink it up. See the chat log for more details. Thanks Katherine, you get +1 :). –  JonH Jan 8 at 21:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.