Changing the Logical Filename for a Log File

  • Hello, 

    I read the following from a previous post:

    "You can change the LOGICAL filename of your primary file using ALTER DATABASE-"

    My question is, can I change the Logical Filename of a log file?

    Thanks,

    Steve DiDomenico - Nashua, NH

     

  • Certainly.  Same way.

    alter database pubs

     modify file (name = 'pubs_log', newname = 'newpubs_log')

    Steve

  • Thanks.

    Before I posted this question, I was getting an error when trying to Alter the Logical Filename of the Log File.

    I was able to Alter the Data file Logicial Filename using the suggested code in a previous post. 

    Since I was able to recreate the error, I did not save the message. I just ran it again and it worked. I have no idea what changed. I tried it on another data base and I can Alter both the Data and the Log file Logical Filenames.

    Now I wonder why I was getting the error.  I was running the same exact code.

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

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