database restore to a different name

  • i tried to restore a database A (with 2 data files and 3 log files ) to Database B with 1 data files and 1 log file and it failed. So i restored the database with 2 data files and 3 log files. Now I like to merge the 2 data files to one and 3 log files to 1 - how will I do it.

    if any one has soluiton to the first option (restoring multiple data anf log files to one) I would prefer that. I dont need to have multiple files thet the original database has.

    thanks


    Regards,

    Naushi Hussain

  • I'm pretty confident there is no way to restore as you describe.

    For removing files, see deleting data files in Books Online and you will have all that you need for information (DBCC Shrinkfile).

    David

    @SQLTentmaker

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

  • David,

    thanks for quick reply. Now that I have the new database with the same files structure can I merge the multiple data files into one data file and the log files into one log file?


    Regards,

    Naushi Hussain

  • Why do you want to merge them into one file ? Many of us split them into multiple files so that we can improve performance by spreading them over multiple disk drives.

  • Did you read the stuff in BOL? That would be the first step. When / if you have questions following that please post the specific question.

    Additionally, Homebrew's point is correct in that there may be a need for the multiple files. So, before eliminating a file I would want to understand the utilization of the database to see if that is a good idea from the performance perspective.

    David

    @SQLTentmaker

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

  • I have been able to convince the user to keep it in multiple files. However the stuff you wanted me to read in BOL relates to deleting a file - we are not deleting files - I like to have one data file and one log file - so we have to restructure the database and soemhow transfer data from old files to the new files and then delete old files may be.


    Regards,

    Naushi Hussain

  • naushi (11/21/2008)


    i tried to restore a database A (with 2 data files and 3 log files ) to Database B with 1 data files and 1 log file and it failed.

    i'm not surprised it failed. You need to restore the database and its original file layouts. Once restored you need to empty 2 of the LOG files and then remove them. To move data from a filegroup\file you would create the object with drop existing clause. When objects are moved delete the data file\filegroup

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

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

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

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