cannot move log file of db

  • Hello,

            we had one of our servers restarted and the log file of one of the databases was created in the default drive instead of the original drive.Iam trying to move the log file to its original location but Iam not able to do it.

    Iam using detach method.and.using xp_cmdshell trying to move the physical file from its present location to its original location but i get a access denied error.

    I have also tried using alter database statement but it does not seem to work.

     

    does anyone have anyother ide of moving the log file of the database.I would really appreciate it.

     

    Thanks

     

  • Why not just log on to the console and physically copy it?

    I'm a little puzzled on what actually happened.  How did the log file get to a different location to begin with?

    You might want to check the file permissions on the ldf and mdf files.  What service pack are you running?  There is an issue fixed in SP2 where a detach of a database wipes out permissions on the files and only leaves permissions for the account that did the detach. 

    Regards,
    Rubes

  • Yes when you say that the log file has got moved to default location without your knowledge then yo need to check what has happened to prevent. Then as said by rubes why don't you do a physical move. Because the file you move will be held by the connection that you have established and the same connection does the attach and hence fails.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

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

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