Transaction Log file saved as MDF

  • 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.

  • 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.

  • 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 &lt database name&gt modify file(name = &lt logical filename &gt, filename = &lt physical file name &gt)

    --example

    alter database test modify file(name = 'test_log', filename = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\test.ldf')

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Robert klimes (6/10/2009)


    if you want to rename the log file to have ldf extension

    alter database &lt database name&gt modify file(name = &lt logical filename &gt, filename = &lt physical file name &gt)

    --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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply