Move MDF to another drive VS adding an NDF file

  • I have a sql server 2000 instance where the MDF for one of the databases is on the C: drive and we are running out of space.

    The Database is a transactional replication subscriber - the Replication logging and Replication PUSH jobs are running on the Publisher.

    If I add a Datafile (.NDF) on another Drive and then set the .MDF file to NOT autogrow, will the .MDF stop growing altogether and data will be written to the .NDF going forward?

    Or am I better served to detach the database and just move the MDF file to another drive??

  • Jpotucek (3/16/2014)


    If I add a Datafile (.NDF) on another Drive and then set the .MDF file to NOT autogrow, will the .MDF stop growing altogether and data will be written to the .NDF going forward?

    Yes. If you set the file not to grow, the file won't grow. SQL will still write a little to that file until it's full but it won't grow any further.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you Gail!

    I'm thinking I should just move the MDF file using detach/attach and be done with it : )

    I do not have an environment to test this in where the DB Is a replication subscriber. Do you know if I will have a problem detaching the Database?

    I believe that if I just stop the replication PUSH job on the publisher while I am performing the detach/attach I should be OK.

  • Jpotucek (3/16/2014)


    I do not have an environment to test this in where the DB Is a replication subscriber. Do you know if I will have a problem detaching the Database?

    Yes. You won't be able to.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I ended up stopping the Replication Push job at the publisher, detached the DB (subscriber), moved the files, reattached the DB and then re enabled the the replication push job.

    Thanks for your help!

Viewing 5 posts - 1 through 4 (of 4 total)

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