Moving Datafiles

  • How can you move one data file to a new location?

    Thanks... I am sure it is simple, but my neurons are failing me today 🙁


    "Keep Your Stick On the Ice" ..Red Green

  • you can detach the database and re-attach it after moving the actual file. (sp_detach_db, sp_attach_db)

    you can back up your database, and restore it to the new location.

    just a couple methods I can think of right off the top of my head.....

  • Just a quick comment...on a production system you must use the backup/restore method. In order to detach a DB, you must have all users out of it, and while it's detached, it is unavailable.

    -Dan


    -Dan

  • I performed the detach/attach on a semi-production system. It was our SAP development server. We are testing an upgrade of SAP (actually migrating towards production) and I needed more disk space to allow for the mirroring of the tables; which occurs during the upgrade. Well, I had to move a datafile to a network drive on our SAN. I do not recommend this to anyone. SQL Server doesn't like datafiles to be placed on network or shared drives and this is for good reason!! This is only a temporary situation. Once the upgrade is complete I will move the datafile back.

    Thanks for the help!!


    "Keep Your Stick On the Ice" ..Red Green

  • In SQL 2000 the database has to be brought to offline initially with out detaching the database. Then the database file can be moved to a desired location.

    After the file gets transferred then the source database can be brought back to online.

  • jeffwe,

    What version of SQL Server, SAP, and who's SAN are you using ?

    We are running SAP/R3, SQL7, on Seagate's XIOTech Magnitude for a year now with no issues. We also did the detach/attach to move the database files, again with no issues.

    I keep hearing don't use a SAN, but I must tell you it must be hardware specific.

    Please share.

    quote:


    I performed the detach/attach on a semi-production system. It was our SAP development server. We are testing an upgrade of SAP (actually migrating towards production) and I needed more disk space to allow for the mirroring of the tables; which occurs during the upgrade. Well, I had to move a datafile to a network drive on our SAN. I do not recommend this to anyone. SQL Server doesn't like datafiles to be placed on network or shared drives and this is for good reason!! This is only a temporary situation. Once the upgrade is complete I will move the datafile back.

    Thanks for the help!!


  • Yes, you can move database file. But remember, you cannot rename your logical database file.

Viewing 7 posts - 1 through 6 (of 6 total)

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