How to restore same database more than once in SQL Server 2012

This days I had problem with restoring same demo CRONUS database more than once. Reason why I want to have same database restored twice is that sometimes I make mistake with compiling objects and then I can’t access to them so I decide to have 2 databases:

  1. Demo Database NAV (7-1)
  2. Demo Database NAV (7-1)_original

the first one is “working database” where I develop my solutions, and the second one is database where I make daily back up.

So first let’s restore original database which I use for back up.

Open Microsoft SQL Server Management Studio, and then on log on to your server instance in my case (NAV2013CRM2013). Then right click on Databases folder and then click on Restore Database… (picture 1) 

picture 1

After that the Restore Database (picture 2) window will open and you need to select Device and then click on

picture 2

and then Select backup devices (picture 3) window will open and here you need to click on Add and then in new window that will open you need to find your database file (.bak).

picture 3

After that just click on OK to return to Restore Database window where we will rename our database to Demo Database NAV (7-1)_original. When we renamed our database, we need to change data and log file. To do that on the left side of Restore Database window click on Files (picture 4).

picture 4.

and then on the first row where is Logical Name Demo Database NAV (7-1)_data scroll right to Restore As and click on (picture 5) the new window will open and in the row File name: type Demo Database NAV (7-1)_data_original.mdf and click OK.

picture 5

Do the same for Demo Database NAV (7-1)_log line but this time write Demo Database NAV (7-1)_log_original.ldf and click on OK and again OK to start restoring process.

After few moments you will receive message that database is restored successfully and now you can add database name to your Dynamics NAV Server instance and of course you can open database in Microsoft Dynamics NAV 2013 R2 Development Environment.

Because we change name of mdf and ldf file of back up database, the restoring process for the working database is the same but this time we don’t need to change mdf, ldf and the name of database. When we restore database we can assign it to Dynamics NAV Server instance and start working.

While I was restoring database, and tried to run some objects from Development Environment I got message like on picture 6.

picture 6

even NAV Server was properly configured and started I was wondering why I got this message. Solution is that on Demo database we need to configure User. To configure User you need to go back to SQL Server Management Studio, expand Database – Security folder and then on User folder right click with mouse and then New User (picture 7)

picture 7

Then you need to enter User name and Login name in Database User – New window and after that click on to open Select Schema (1) window where you need to click on Browse and after that in Browse for Objects window click on [dbo] (2) and in the end confirm with OK to return to Database User window (don’t close it) picture 8.

picture 8

after that on Owned schemas tab you need to select db_owner (picture 9) and in the

picture 9

Membership tab you need to select db_owner (picture 10)

picture 10

After that just confirm all changes with OK and now you will be able to run objects from Development Environment in RTC.

 

That will be all for today Smile see you in few days where we will continue with tables in Microsoft Dynamics NAV 2013 R2.

Cheers,

Renato!

Tags:
0 Comments

Leave a reply

Your email address will not be published.

*

Copyright ©[year] fajdiga.info. All rights reserved. Powered by Derecjun

Log in with your credentials

Forgot your details?