Link to home
Start Free TrialLog in
Avatar of ljhodgett
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
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

The error message says that your transactional log backup (testdb.trn) is split across two or more media files in different locations and hence it needs all the transactional log backups in addition to E:\testdb\testdb.trn

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
ASKER CERTIFIED SOLUTION
Avatar of ignitedintelligence
ignitedintelligence

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial