08-30-2022 05:40 AM
Hi
I want to automate a weekly restore of the most recent full backup of a SQL production database, to a development instance.
The problem I'm having is finding the job ID of the most recent backup.
I've tried using bpimagelist
bpimagelist -pt MS-SQL-Server -hoursago 48 -client Server1.com -idonly -st FULL
but I can't differentiate between the databases that are backed up on that instanace. Does anyone kjnow how to do this, or does someone have a better way to automate the restore.
Cheers
Alex
Solved! Go to Solution.
08-30-2022 05:49 AM
use the following command to find the correct NBIMAGE
bplist -C <SQLHOST> -S <NBSERVER> -t 15 -R 99 -s <sdate> -e <edate> \
Then insert it to a ready bch script or create it on the fly and run it using the command
dbbackex -f <bch_script> -np
08-30-2022 05:49 AM
use the following command to find the correct NBIMAGE
bplist -C <SQLHOST> -S <NBSERVER> -t 15 -R 99 -s <sdate> -e <edate> \
Then insert it to a ready bch script or create it on the fly and run it using the command
dbbackex -f <bch_script> -np
08-30-2022 07:18 AM
Checkout the bpflist command as well, it can be run from the client