June 10, 2009 at 12:16 pm
I just observed that one of the T-Log file is saved as MDF file. I know it is possible as i am seeing it. Are there any disadvantages ? i am seeing the size of log file very high. i am trying to shrink it and want to take advise from you on future action?
Shall i change it?
Thanks,
Sudhie.
June 10, 2009 at 12:25 pm
The extension doesn't matter, it's a matter of convention. You can detach it, rename it, then attach it back.
As far as the size, you need to check the database recovery model in options, and if it is not simple, you should be performing log backups.
June 10, 2009 at 12:34 pm
The extension of a database file do not matter except for the sake of consistency.
if you want to rename the log file to have ldf extension
alter database < database name> modify file(name = < logical filename >, filename = < physical file name >)
--example
alter database test modify file(name = 'test_log', filename = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\test.ldf')
June 10, 2009 at 12:57 pm
Robert klimes (6/10/2009)
if you want to rename the log file to have ldf extension
alter database < database name> modify file(name = < logical filename >, filename = < physical file name >)
--example
alter database test modify file(name = 'test_log', filename = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\test.ldf')
Then take the database offline, change the file name and then bring the DB back online. Alter database changes only the system catalog, not the actual file on disk.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply