SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Why am I having so much trouble restoring?


Why am I having so much trouble restoring?

Author
Message
Bad_Karma
Bad_Karma
SSC Veteran
SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)

Group: General Forum Members
Points: 231 Visits: 190
What I'm trying to do is really just make a copy of a database on the same server for testing purposes. In previous versions of SQL Server, all I would do is restore the last backup I took of the source database and restore it with a new name. I would have to make sure to change the names of the files as well, but that always seemed to work and was so easy. But in 2012, this is much more difficult, it keeps wanting to use the timelines, and then doesn't let me change the file names.

Is there a better way to create a copy on the same server from a live and active database with minimal impact to the users? Some way that won't confuse my maintenance plans, or anything else on the server?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)

Group: General Forum Members
Points: 230034 Visits: 46344
RESTORE DATABASE <new database name> FROM DISK = <backup location>
WITH MOVE ....

Probably easier to do with T-SQL than the GUI.

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


Bad_Karma
Bad_Karma
SSC Veteran
SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)

Group: General Forum Members
Points: 231 Visits: 190
Now the new db is stuck as Restoring. This is the query that I ran, and the message that it delivered after. Did I miss something? I've definitely waited long enough.

RESTORE DATABASE TestDB
FROM DISK = 'D:\Backup\backup.bak'
WITH NORECOVERY,
MOVE 'DateFile' TO 'D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TestDB.mdf',
MOVE 'LogFile_Log' TO 'D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TestDB.ldf';
GO



Processed 379192 pages for database 'TestDB', file 'DateFile' on file 1.
Processed 5 pages for database 'TestDB', file LogFile_log' on file 1.
RESTORE DATABASE successfully processed 379197 pages in 79.610 seconds (37.212 MB/sec).

Eddie Wuerch
Eddie Wuerch
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2574 Visits: 2260
RESTORE DATABASE TestDB
FROM DISK = 'D:\Backup\backup.bak'
WITH NORECOVERY,
MOVE 'DateFile' TO 'D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TestDB.mdf',
MOVE 'LogFile_Log' TO 'D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TestDB.ldf';
GO



In the RESTORE statement, you specified NORECOVERY, which leaves the database in a state where additional log files may be restored. If you are done restoring the database, then you need to recover the database:

RESTORE DATABASE TestDB
WITH RECOVERY



Eddie Wuerch
MCM: SQL
Bad_Karma
Bad_Karma
SSC Veteran
SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)SSC Veteran (231 reputation)

Group: General Forum Members
Points: 231 Visits: 190
Ha! Wow, thanks for being patient with my me. That fixed it.

Much appreciated everyone!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search