remove multiple data and log files

  • Hey I do have multiple data file and log file in my database, i need to keep single data and log file for my db, can

    I delete directly from enterprise manager, will there be any impact in the server.

    Please let me know

  • Well ... you never need an additional log file, but multiple data files can yield performance boosts depending on implementation. Regardless, you do not want to go deleting them without ensuring there are no objects stored in them.

  • Yes, you can delete it from Management Studio (EM) but the file has to be empty first so, if you right click on the database go to tasks > shrink > files, pick the file you want to shrink via the drop down selections and select the "Empty file by migrating the data...." radio button at the bottom. This will move the data into the other file(s) in the filegroup. This can also be accomplished by the following statement;

    dbcc shrinkfile (FileName, EmptyFile)

    There will be some lag while this occurs depending on how much data is moving so, make sure you have a window that you won't make your users mad.

    Oh, and get a backup. Can't believe anything would go wrong but....

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

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

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