renaming logical file names

  • Is there any danger with renaming the LOGICAL file names behind the database?

    There are a bunch of databases that were restored copies and all of them have the same logical database file name. I'm trying to get some growth data so I want the logical files to be different (prefer them to match the actual database name) so I can more easily identify them.

    For instance:

    database_id name type_desc name physical_name

    1 DLMdb1 ROWS DLMDB1 D:\dlmdb1.mdf

    1 DLMdb1 LOG DLMDB1_log E:\dlmdb1.ldf

    2 DLMdb2 ROWS DLMDB1 D:\dlmdb2.mdf

    2 DLMdb2 LOG DLMDB1_log E:\dlmdb2.ldf

    3 DLMdb3 ROWS DLMDB1 D:\dlmdb3.mdf

    3 DLMdb3 LOG DLMDB1_log E:\dlmdb3.ldf

    Am I safe to rename the logical names? I can't think of anything that references those logical file names that I would be breaking [backups, applications].


  • You should have no problem changing the logical names, except maybe for some scripted restores that have a MOVE clause using the logical name.

    SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: "If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them."

  • If you've automated any restore operations to test your backups or move data around for development or QA, that would be the one place. But, as you say, applications and backups, they'll be fine.

    The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
    Theodore Roosevelt

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

  • Thanks for the confirmation. I'll let you know if I see anything blow up!

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

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