ljhodgett
asked on
How to restore transaction log sql server 2005
Hi,
I'm trying to implement a backup strategy by taking a full backup every evening at midnight then doing a transaction log backup every hour. I'm using the following code: -
--full backup
BACKUP DATABASE testdb
TO DISK = '\\Sql1\testdb\testdb.Bak'
WITH INIT,
NOUNLOAD, SKIP, NOFORMAT
--transaction log backup
BACKUP LOG testdb --database name
TO DISK = '\\Sql1\testdb\testdb.trn'
WITH
NOUNLOAD, SKIP, NOFORMAT
Both scripts run successfully but when I go to restore the database I get the error shown in the image. This occurs when I add both files to the "Specify the source and location of backup sets to restore"
What am I doing wrong please?
Many Thanks
Lee
screen.JPG
I'm trying to implement a backup strategy by taking a full backup every evening at midnight then doing a transaction log backup every hour. I'm using the following code: -
--full backup
BACKUP DATABASE testdb
TO DISK = '\\Sql1\testdb\testdb.Bak'
WITH INIT,
NOUNLOAD, SKIP, NOFORMAT
--transaction log backup
BACKUP LOG testdb --database name
TO DISK = '\\Sql1\testdb\testdb.trn'
WITH
NOUNLOAD, SKIP, NOFORMAT
Both scripts run successfully but when I go to restore the database I get the error shown in the image. This occurs when I add both files to the "Specify the source and location of backup sets to restore"
What am I doing wrong please?
Many Thanks
Lee
screen.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I hope your transactional log backup is taken to two or more files instead of the single file specified above.
Specify those other testdb.trn files to restore.
Hope this helps