Hi,
The box is running Win 2003 and SQL Server 2005. I have a transaction log file in a disk D and the main data is in disk C. I had the Data (Primary in 160MB, by 1MB, unrestricted growth in path C; Log, 25 MB, by 10 percent, restricted growth in path D)
I tried to use DBCC Shrinkfile and Truncate_Only statement, it gave me the error message. Can anyone please help?
This is what I wrote in the query,
Use Budget_2008
GO
DBCC ShrinkFile (D:\SQLDat2ServerLog\Budget_2008_log,1)
BACKUP Log D:\SQLData2ServerLog\Budget_2008 WITH TRUNCATE_ONLY
DBCC ShrinkFile (D:\SQLDat2ServerLog\Budget_2008_log,1)
Also, I would like to know is there anyway I can move the D path's log file back to the C path? I tried to use the following, but again, the error message appeared,
1) RUN Alter Database Budget_2008 SET OFFLINE
2) I move the D path's log file to the C path where the Data located.
3) Run ALTER DATABASE Budget_2008 MODIFY FILE(NAME = Budget_2008_Log, FILEName = 'C:\Program File\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Budget_2008_Log.LDF'
4) Run ALTER DATABASE Budget_2008 SET ONLINE
I tried to work on change the data in the file, but it ends up the new Log file is not working, but the Old Log file is still capturing the log. Can anyone help?
Thank you very much
The box is running Win 2003 and SQL Server 2005. I have a transaction log file in a disk D and the main data is in disk C. I had the Data (Primary in 160MB, by 1MB, unrestricted growth in path C; Log, 25 MB, by 10 percent, restricted growth in path D)
I tried to use DBCC Shrinkfile and Truncate_Only statement, it gave me the error message. Can anyone please help?
This is what I wrote in the query,
Use Budget_2008
GO
DBCC ShrinkFile (D:\SQLDat2ServerLog\Budget_2008_log,1)
BACKUP Log D:\SQLData2ServerLog\Budget_2008 WITH TRUNCATE_ONLY
DBCC ShrinkFile (D:\SQLDat2ServerLog\Budget_2008_log,1)
Also, I would like to know is there anyway I can move the D path's log file back to the C path? I tried to use the following, but again, the error message appeared,
1) RUN Alter Database Budget_2008 SET OFFLINE
2) I move the D path's log file to the C path where the Data located.
3) Run ALTER DATABASE Budget_2008 MODIFY FILE(NAME = Budget_2008_Log, FILEName = 'C:\Program File\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Budget_2008_Log.LDF'
4) Run ALTER DATABASE Budget_2008 SET ONLINE
I tried to work on change the data in the file, but it ends up the new Log file is not working, but the Old Log file is still capturing the log. Can anyone help?
Thank you very much