• is possible, is there internal procedure to moving with database files if database runs, is not detached on Sql Server 2012/2008, .... EDIT.... database is online, accesible for users, services running in Native OS

  • moving from one disk to another, initialized in Windows OS as HDDs

  • or only is possible to create a replica in another SQL instace and if done then to switch between DB files

  • my question is only about how to shorten the time until the instance is unavailable (detach, copy, attach, testing of consistency)

  • 3
    The following points need to be clarified: What do you mean when you say "if the database runs"? What do you want to move and when? What do you mean by "if done then switch between DB files"? Right now, your question doesn't make much sense to me. – Thomas Stringer Jun 5 '13 at 13:40
  • You cannot move the DB files if the DB is online. I believe you are looking for something like DB clustering, where you can "shorten the time until the instance is unavailable" (no files are moved around). Still you will need to clarify your question a bit more. – StanleyJohns Jun 5 '13 at 14:44
  • You could do a backup and restore that one on the remote machine, if it's just for offline reporting or some consistency checks that you were mentioning. The backup could be done without having any downtime. You'd just have some load on your server. – MicSim Jun 5 '13 at 14:59
  • @Thomas Stringer,@StanleyJohns,@MicSim I looking for solution when database is online, note I'm using a features on VMWare, but I'm searching for an alternative, because VMWare, or OmniBack to consume some time too, sure any VMWare (e.i.) restore is faster than copy file from one HDD to another – mKorbel Jun 5 '13 at 15:51
  • 1
    What administrative task are you trying to accomplish here? – Jon Seigel Jun 5 '13 at 17:15

If you have multiple data files for a database and you are trying to move one from one disk to another, I believe you can add new data file on the new drive to your filegroup, and then use ShrinkFile with the EmptyFile option on the file to be moved to migrate data from that file into the other files in the filegroup (SQL Server will distribute across the files automatically). The only problem with this is that you cannot do this for the first file of the database's primary filegroup, which I'm betting will be an issue for you.

|improve this answer|||||
  • Looks like as not possible to move with database files in the case that database is online, all my attempts potentially can creating big trouble, because these files are used/locked by SQL sever and Native OS too

  • stays using the features from VMWare tools, that are faster than plain file copy for one hdd to another

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.