Hi all,
I am restoring a sql server backup for the first time as well as the most recent traction logs. I'm not having any problems with the backup/restore per se, just a question/curiosity about the transactions logs. I am using a script and at
one point I ran the script accidentally a second time and noticed that all transaction logs failed to apply during the second run (as expected as they were already applied during the first run) except for the most recent log. It seems to apply cleanly.
Is this normal behavior? This log file was not a new log since the previous restore, it is the exact same set of logs that were applied the first time. I seem to be able to restore the most recent transaction log as many times as I like, is this
normal?
For reference, here is the portion of the script I am using to restore the logs
FOR /f %%b IN ('DIR /b %TLOG_PATH%\%DB_NAME%\*.trn') DO ( sqlcmd -Q "RESTORE LOG %DB_NAME% FROM DISK = '%TLOG_PATH%\%DB_NAME%\%%b' WITH NORECOVERY" )