Named Instances

  • I am trying to install a certain database onto a different named instance by detaching the file copying it and pasting it to the desired directory which the named instance that I just created for a work lab that I am doing. It keeps giving me an error message stating that the file cannot be copied because it is in use by another user but Ive searched everywhere and can not find the file anywhere else. Does anybody have any suggestions.

  • Have you considered backup and restore?

  • check the NFTS permissions on the database files, the user you are logged on as likely doesn't have permissions to the files

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • danielmonro (3/19/2009)


    I am trying to install a certain database onto a different named instance by detaching the file copying it and pasting it to the desired directory which the named instance that I just created for a work lab that I am doing. It keeps giving me an error message stating that the file cannot be copied because it is in use by another user but Ive searched everywhere and can not find the file anywhere else. Does anybody have any suggestions.

    "the file"? which file?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • The whole system?

  • Is this is at all possible restarting the instance on which the database used to be may help. Sometimes when you detach the database the file may still have locks on it from SQL Server. If this is not an option, try backup and restore or re-attaching the database and detaching it again. I would do it using TSQL, not GUI, in this case the situation like yours is less likely.

  • It's possible that antivirus programm on your machine may accessing it.

    Also make sure that you have detached the database properly. Check for the same using sp_helpdb.

  • On the SQL server machine, right-click on my computer and select "Manage". Expand shared folders and click on "Open Files". Search for your file name to determine who has a lock on the file you are trying to copy/move. You can right-click on the file to remove the lock (close file actually), if appropriate.

    -- You can't be late until you show up.

  • Jason Crider (3/19/2009)


    Have you considered backup and restore?

    I agree. I always prefer using backup and restore. You can go back and drop the database from the original location once you verify that you have a good copied restored on the other instance. Just makes me feel safer doing it that way.

  • If it does seem that the file is actually locked, you might process monitor to get to the bottom of it.

    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

  • If it is Windows Server 2003, right click the file --> properties --> Click on Unblock if enabled.

    ---------------------------------------------------
    Thanks,
    Satheesh.

  • danielmonro (3/19/2009)


    It keeps giving me an error message stating that the file cannot be copied because it is in use by another user but Ive searched everywhere and can not find the file anywhere else. Does anybody have any suggestions.

    I recently had exactly the same issue and wanted to resolve it without going for the backup/restore option as has been previously suggested (no real reason for avoiding it, I just wanted to find out why the copy failed). All I did was stop the SQL Server Service and the lock was released. This may have been a bit heavy handed, and I did intend to investigate a bit further at a later date, but it did work.:-)

Viewing 12 posts - 1 through 11 (of 11 total)

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