I am trying to use SMSS to restore a database to a specific point in time. When i select the point in time, I get 3 backup sets to restore, one of them with a null filename and location. The script is outlined below, and there is a failure stating Cannot open backup device ‘NUL’. Operating system error 2(The system cannot find the file specified.) for the log restore of RESTORE LOG [dbRestore] FROM DISK = N’NUL’ WITH FILE = 1, NOUNLOAD, STATS = 5, STOPAT = N’2024-05-10T13:48:38′
I cannot figure out why this is happening and why SMSS is doing the Nul file.
USE [master]
BACKUP LOG [db] TO DISK = N’X:db_LogBackup_2024-05-13_14-44-13.bak’ WITH NOFORMAT, NOINIT, NAME = N’db_LogBackup_2024-05-13_14-44-13′, NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5
ALTER DATABASE [dbRestore] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE [dbRestore] FROM DISK = N’X:UserDBdbdb_backup_2024_05_10_020001_7961349.bak’ WITH FILE = 1, MOVE N’db’ TO N’F:dbRestore’, MOVE N’db_log’ TO N’L:dbRestore’, NORECOVERY, NOUNLOAD, REPLACE, STATS = 5
RESTORE LOG [dbRestore] FROM DISK = N’X:UserDBLogsdbdb_backup_2024_05_10_020357_8311872.trn’ WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 5
RESTORE LOG [dbRestore] FROM DISK = N’NUL’ WITH FILE = 1, NOUNLOAD, STATS = 5, STOPAT = N’2024-05-10T13:48:38′
ALTER DATABASE [dbRestore] SET MULTI_USER
GO
Tried restoring to point in time and expected the database to restore to that point in time. Tried restoring to a different point in time and had the same issue.
Scott Bathauer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.