We have one critical VLDB (Very Large Database) in our organization and the size of the database is 10TB (yes, you heard that right 🙂 ). We have configured Log-shipping on this database in StandBy mode so that the secondary instance can be used for extracting some data for various reports. On the primary server we were facing some space issue and finally Sys-Admin gave the much-needed LUN. The on-shift DBA created the new files on the Primary instance in the new LUNs and Phew..the space issue on that server is resolved..
But wait !!!! Many times we do some stuff without proper planning (and this was one of those incidents the DBA did not think about Logshipping while creating new files..may be he was little tired or sleepy..anyway..) After sometime, for obvious reasons the Tlog restore in the secondary server started failing and the DBA on shift had no-clue about the same. After little research he found that new files have been added which was not there in Secondary instance and that was the reason for Tlog Restore failure. He hit the PANIC button and called me up for next step. After I did the initial checks then I asked him if he tried “MOVE” option with Tlog Restore (he did not know that we can use Move with Tlog restore since we do not have this option available in GUI).
Yes- we can use MOVE clause while restoring Tlog backups. Below I am giving the simple example:
RESTORE LOG [PR_DB] FROM
DISK = N’\\Server\Backup\LogShipping\PR\PR_20120211020000.trn’
WITH FILE = 1,
STANDBY = N’D:\Backup\ROLLBACK_UNDO_PR.BAK’,
MOVE N’PR_INDEX2′ TO N’H:\Data\PR\PR_Index2.ndf’,
NOUNLOAD, STATS = 10