DB Restoration Issue

  • I have a db backup of a database ....sample.bak

    Now I want

    (1) restore original db i.e sample // I have done this through SSMS GUI restore menu

    (2) I want to create another db (not sample) but different name i.e testing_db

    // Here I'm stuck

    my issue is, how do I put a different db name i.e testing_db during restoration ?

  • RESTORE DATABASE SomeOtherName FROM DISK = 'Sample.bak'

    WITH MOVE <and specify where the files should be placed>

    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
  • GilaMonster (10/22/2013)


    RESTORE DATABASE SomeOtherName FROM DISK = 'Sample.bak'

    WITH MOVE <and specify where the files should be placed>

    [/b]

    bold part not understood.

    Can you please put an example for the bold part ?

    what do you mean by specify where the files should be placed ?

  • Open up Books online, go to RESTORE DATABASE and look at the large number of detailed explanations and examples listed there.

    The MOVE clause specified where the database files should go if not to the place that the original database used. If you're restoring as a different name, you want the files renamed too, hence the MOVE clause.

    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
  • still have confusion.

    I am confused because you have mentioned database path. ( not disk path)

    If you're restoring as a different name, you want the files renamed too, hence the MOVE clause.

    Yes . As mentioned earlier

    (2) I want to create another db (not sample) but different name i.e testing_db

    I want this testing_db to stay side by side to the other db i.e sample.

    Can you please tell now how the command will look like ?

    By the Way , Is it not possible to do the same thing using SQL Server Management Studio GUI ?

    I am more comfortable with GUI than command line

  • spectra (10/22/2013)


    (2) I want to create another db (not sample) but different name i.e testing_db

    Yes, you said that in the first post.

    Can you please tell now how the command will look like ?

    I already did. See my first reply

    By the Way , Is it not possible to do the same thing using SQL Server Management Studio GUI ?

    I am more comfortable with GUI than command line

    Sure it's possible. Change the database name in the drop down box on the main tab. But you really should learn the T-SQL commands

    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
  • Sure it's possible. Change the database name in the drop down box on the main tab. But you really should learn the T-SQL commands

    one can not change database names in drop down box.....is not it ?

    I want a new db name of my liking ..... I want to give a new name i.e testing_db ......how this would be possible here ?

    Am I missing anything here ?

  • 2 second google search gave the link you need:

    http://technet.microsoft.com/en-us/library/ms190447(v=SQL.105).aspx

    This link gives you exactly what Gail is referring too - study it well, the example at the bottom shows you exactly what you need to do..

    [font="Times New Roman"]There's no kill switch on awesome![/font]
  • Loundy (10/22/2013)


    2 second google search gave the link you need:

    http://technet.microsoft.com/en-us/library/ms190447(v=SQL.105).aspx

    This link gives you exactly what Gail is referring too - study it well, the example at the bottom shows you exactly what you need to do..

    I'll be using GUI. I am more comfortable with this than command line.

    Can you please post reply to the GUI query posted in my above post.

    I am not a DBA.

  • spectra (10/22/2013)


    one can not change database names in drop down box.....is not it ?

    I'm going to guess you haven't tried and just decided to imply that I'm lying without even taking a minute to test out what I said. Right?

    If you want to restore a backup to a different database name, change the name in the drop down on the first tab of the restore dialog.

    I want a new db name of my liking ..... I want to give a new name i.e testing_db ......how this would be possible here ?

    I've told you. Multiple times, two different methods.

    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
  • dup

    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
  • This worked fine.

    Excellent.

    Thanks guys.

    Have a great day.

Viewing 12 posts - 1 through 11 (of 11 total)

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