Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Why am I having so much trouble restoring? Expand / Collapse
Author
Message
Posted Saturday, March 23, 2013 2:54 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 8:47 AM
Points: 47, Visits: 159
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?
Post #1434628
Posted Saturday, March 23, 2013 3:53 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:52 AM
Points: 41,530, Visits: 34,446
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 2008, MVP
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

Post #1434630
Posted Sunday, March 24, 2013 4:41 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 8:47 AM
Points: 47, Visits: 159
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).
Post #1434710
Posted Sunday, March 24, 2013 10:21 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, February 25, 2014 4:17 PM
Points: 439, Visits: 1,094
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
Post #1434742
Posted Monday, March 25, 2013 9:34 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 8:47 AM
Points: 47, Visits: 159
Ha! Wow, thanks for being patient with my me. That fixed it.

Much appreciated everyone!
Post #1434983
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse