How to get rid of .ldf files and create a new one

I am using SQL Server 2005. Since i do some development work so i create the replica of my live databases to run for trial. When i restore the data from the live one to the test one it increases the size of the log file very much which is occupying the space unnecessarily. I am trying to get rid of the log file and create a new one. What I have done so far is detach the database, delete the .ldf file and when i try to attach the database it says the .ldf file is not present. Could any body help me with this
LVL 1
shieldguyAsked:
Who is Participating?
 
Chris MangusDatabase AdministratorCommented:
Restore the database as usual.  Put the database in Simple recovery mode.  Then, run DBCC SHRINKFILE and shrink the .ldf.

You can't just get rid of it and create a new one.
0
 
MrNeticCommented:
shieldguy,

Put the database in the developement stage in SIMPLE RECOVERY MODEL, This will truncate the Transaction Log everytime the engine do checkpoint.

Best Regards,
Paulo Condeça
0
 
MrNeticCommented:
Don't forget to shrink the transaction log ( DBCC SHRINKFILE ('LOGICAL_NAME_OF_TRANSACTION_LOG') )

Best Regards,

Paulo Condeça
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Anthony PerkinsCommented:
If you are going to use Full Recovery Model, than you need to get in the habit of backing up the Transaction Log as well as the database.
0
 
shieldguyAuthor Commented:
Could any body please explain me clearly what is 'Simple Recovery Model' and 'Full Recovery Model'. What option do I need to select for that.

Kind Regards
0
 
MrNeticCommented:
shieldguy,

Don't have time to explain, but you can consult this site http://msdn2.microsoft.com/en-us/library/ms189275.aspx .

Hope it helps.
0
 
Chris MangusDatabase AdministratorCommented:
Is there anything else we can do for you on this question?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.