cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute the restore script about SQLServer database with command line manually in nbu 9.1

littleboy124
Level 3

Hi all :

I am trying to restore from a sqlserver database by restore script with command line.  But I cannot make it to work because I did not find a command what can execute the restore script. 

I found "bprestore" in Administrator guide but it seems like  uselessly for sqlserver

Looking forward to your reply,thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

StefanosM
Level 6
Partner    VIP    Accredited Certified

The same command you use to backup a SQL database can be used for restores.
The command is
dbbackex -f <bch file> -np

The problem is that you have to create the bch restore script every time. I suggest you to create it in the GUI for the first time and change what needs to be changed with your script.
You have to use the bplist command to find the SQL backup you need to restore. something like this.
bplist -C <SQLHOST> -S <master server> -t 15 -R 99 -s <start date> -e <enddate>

View solution in original post

4 REPLIES 4

sanket_pathak1
Level 4

@littleboy124  initiating MSSQL restore with bprestore command would be way complicated...

but why do you want to do that when you have easier options available ?

For many years i used to initiate MSSQL restore little differently than others.. check the steps here

1. Ensure you have a restore script available on MSSQL Server in .bch or .bat format.

2. create dummy MSSQL policy on Master Server. Add the target MSSQL Server in clients section. Select the restore script in backup selection. Finally add a dummy schedule which should not have a start window.

3. Initiate a manual backup. This will start a dummy backup job.. which will not be doing anything.  This will also start the restore job. Depending on the parameters passed in restore script you may observe the behaviour for restore job.

This proceudre is helpful when DBA dont allow you login to server or you really have challenges in keep logged in yourself.

Thanks,

littleboy124
Level 3

@sanket_pathak1 Thank you so much for your reply,it is useful for me

StefanosM
Level 6
Partner    VIP    Accredited Certified

The same command you use to backup a SQL database can be used for restores.
The command is
dbbackex -f <bch file> -np

The problem is that you have to create the bch restore script every time. I suggest you to create it in the GUI for the first time and change what needs to be changed with your script.
You have to use the bplist command to find the SQL backup you need to restore. something like this.
bplist -C <SQLHOST> -S <master server> -t 15 -R 99 -s <start date> -e <enddate>

Thanks so much for your reply ,it means a lot to me