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
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 changing transaction log file from c to d

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2011-10-01 : 07:16:03
hello guys,
i have a personal project i have been running for years. However forgive me, but am a developer who knows little about administration.

My server c drive is getting too full and i checked the database files, which i noticed c has only 400mb left, but D has gigabytes of data.

What is the best option to move the database from c to d, or shrink the transaction log file.

thanks
Mary

_____________________


Yes O !

Sachin.Nand

2937 Posts

Posted - 2011-10-01 : 11:10:45
Even if you move it D what will you do when D also gets full after sometime ? Also is the size of mdf more or of the ldf ?

How many times before have you shrunk the log files before?If it is the first time then it is OK.But after shrinking make sure you have a Tlog backup set which will keep reusing the VLF's and also help you in Point In Time restore in case of failures and please dont make it a repetitive habit of shrinking any database files.

If you want to move it to D then you can use syntax like this


Alter database DatabaseName
Modify File(Name=Yourlogocalmdffilename,FileName=NewPath)

Use the above same syntax for ldf file also



PBUH

Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2011-10-03 : 11:19:22
thanks, i followed this example, which is the same as yours

http://msdn.microsoft.com/en-us/library/ms345408.aspx

and now am getting, database is not accessible

_____________________


Yes O !
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-10-04 : 00:32:02
What does this show ?



Select DATABASEPROPERTYEX('YourDB','Status')



PBUH

Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2011-10-04 : 13:49:43
says the two i changed are suspect, but the others are online

_____________________


Yes O !
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-10-05 : 02:48:58
Oops.Did you stopped the sql service before moving the databases ?

PBUH

Go to Top of Page
   

- Advertisement -