HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

Cannot restore Amazon RDS SQL Server database to given point-in-time using SQL Server Management Studio

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
cannotpointsqltimedatabasemanagementamazonusingstudioserver

Problem

I'm trying to restore one of my Amazon DRS SQL Server databases. Using SQL Server Management Studio, I can correct to my DRS instance using the master account I created when creating the database instance. When I start restoring a given database I'm able to see all full backups and transaction logs, but it gives me this error message when trying to restore


Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)


An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


The EXECUTE permission was denied on the object 'xp_fileexist', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)

I can restore a full database instance from AWS management console, but that is not what I want. I want to be able to restore a given database to a specific point-in-time and not restoring a whole new database instance. Also looks there isn't much information on how to restore to a specific point-in-time.

Thanks.

Solution

I would try scripting out the operation instead of running whatever Management Studio is doing "for" you. You shouldn't need to use xp_fileexist (assuming you can validate that the files actually exist in the place the script says). Using 2012 SSMS, I am restoring to a point in time that does not coincide directly with a log backup:

The resulting script in my case was:

BACKUP LOG ... WITH NOFORMAT, NOINIT, NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY
RESTORE DATABASE ... WITH FILE = 1, NORECOVERY, NOUNLOAD
RESTORE LOG ... WITH FILE = 1, NORECOVERY, NOUNLOAD
...
RESTORE LOG ... FROM DISK = [...path from line 1...] WITH NOUNLOAD, STOPAT = 

Code Snippets

BACKUP LOG ... WITH NOFORMAT, NOINIT, NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY
RESTORE DATABASE ... WITH FILE = 1, NORECOVERY, NOUNLOAD
RESTORE LOG ... WITH FILE = 1, NORECOVERY, NOUNLOAD
...
RESTORE LOG ... FROM DISK = [...path from line 1...] WITH NOUNLOAD, STOPAT = <time>

Context

StackExchange Database Administrators Q#30380, answer score: 2

Revisions (0)

No revisions yet.