Logshipping copy job will copy a file that the backup job has not finished yet. The resultant copy will have an incomplete or missing header which when verfied will show this error:
Msg 60404, Level 16, State 1, Line 0
Not a valid LiteSpeed™ for SQL Server® format file (Type is: 1).
Select a valid LiteSpeed™ for SQL Server® file for this restore operation.
Steps To Reproduce:
1. Setup logshipping.
2. Disable the sub "restore job"
3 Populate a table in the publishers database usng a query like the below
WHILE (1=1)
BEGIN
TRUNCATE TABLE [test1].[dbo].[Product]
DECLARE @Record INT
SET @Record=1
WHILE @Record<= 300000
BEGIN
INSERT INTO [test1].[dbo].[Product]
([ProductName] ,[ProductDescription],[ProductPrice])
VALUES ('Product ' + STR(@Record), 'Description ' + STR(@Record), @Record*100/3)
SET @RECORD = @RECORD+1
END
SELECT COUNT(ProductID) as RecordsCreated FROM [test1].[dbo].[Product]
END
4. Set the backup job to run once a choosen time (EXAMPLE 6:10:00pm)
5. Set the copy job to run once at a choosen time (EXAMPLE 6:10:10pm) note the slight offset..
6. When the jobs have finished verify the copy.
7. Note the error.