How to edit the "on completion" section of Log Shipping setup
GregBrown
Posts: 2 New member
in SQL Backup
Hi All,
I need to edit how log files are dealt with after they are replayed, but i cannot find anywhere to make the change. Editing the job, only gives the option to edit the destination on the target server before replay. Any help would be appreciated as the only real option i can see is re-seeding the whole DB. Re-seeding this DB takes about 14 hours.
Thanks in advance!
Tagged:
Answers
Thank you for your forum post.
What are you looking to change?
For the restore job, on completion of the restore the only parameter that comes to mind is you can only modify the path for the MOVETO command so the successful restored backup files are moved out of the network share to a different folder.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
To delete files from the MOVETO folder, simply add the ERASEFILES and FILEOPTIONS keywords to your backup job.
The easiest way to do this is to edit the restore job via SSMS ->SQL Agent ->Jobs ->Right Click the job and select properties ->Job Step->Edit.
The example syntax below will keep the latest 10 files:
ERASEFILES = 10b, -- value of 10b keep the latest 10 files
FILEOPTIONS = 1 -- value of 1 indicates Delete backup files in the
MOVETO
folder if they are older than the number of days or hours specified inERASEFILES
.Further reading is available here.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com