unattended restore?

Posted by bronco on 30-Mar-2016 05:28

Is it possible to somehow do an unattended restore with prorest? I'm trying to restore a db over an an existing one and I get a question if I want to overwrite. Since I'm do this for multiple db's in a script, I'm missing the -by parameter here.

Cheers

Posted by Paul Mowat on 30-Mar-2016 05:41

This is an example of a script I use.

echo off
SET DLC=C:\OE102B
SET PATH=%DLC%;%DLC%\bin;%PATH%
echo Deleting Databases.....

cd /d C:\Databases\next\yearend\10.2B\

call proshut openstrt -by  
call proshut paydb -by
call proshut userdef -by

call prodel openstrt < C:\temp\yes.txt
call prodel paydb < C:\temp\yes.txt
call prodel userdef < C:\temp\yes.txt
                  
call prorest openstrt openstrt.bak   
call prorest paydb paydb.bak
call prorest userdef userdef.bak

call proserve openstrt   
call proserve paydb
call proserve userdef

echo Complete.

pause.                

Posted by Paul Mowat on 30-Mar-2016 05:39

Hi,

You can pipe in a response.

For example create a file called Yes.txt and just put a Y in it followed by a blank line.

The in your script you would do the following.

prorest dbname dbname.bak < C:\temp\yes.txt

Hope that helps.

Paul

All Replies

Posted by Paul Mowat on 30-Mar-2016 05:39

Hi,

You can pipe in a response.

For example create a file called Yes.txt and just put a Y in it followed by a blank line.

The in your script you would do the following.

prorest dbname dbname.bak < C:\temp\yes.txt

Hope that helps.

Paul

Posted by Paul Mowat on 30-Mar-2016 05:41

This is an example of a script I use.

echo off
SET DLC=C:\OE102B
SET PATH=%DLC%;%DLC%\bin;%PATH%
echo Deleting Databases.....

cd /d C:\Databases\next\yearend\10.2B\

call proshut openstrt -by  
call proshut paydb -by
call proshut userdef -by

call prodel openstrt < C:\temp\yes.txt
call prodel paydb < C:\temp\yes.txt
call prodel userdef < C:\temp\yes.txt
                  
call prorest openstrt openstrt.bak   
call prorest paydb paydb.bak
call prorest userdef userdef.bak

call proserve openstrt   
call proserve paydb
call proserve userdef

echo Complete.

pause.                

Posted by jamesmc on 30-Mar-2016 06:00

Hi,

You can also echo a Y into the command:

echo y | prorest sports sports.bak

I use this method in my scripts (both unix and windows) and it works without the need of a file on disk although I still pipe in from a file when there are more complicated prompts that I need to answer.

I would have hoped by now that there was a command line option to confirm without prompting (like a -y) to automate scripted tasks without having to find other ways to answer prompts.

HTH.

Posted by bronco on 30-Mar-2016 08:01

I don't fabricate too many DBA scripts (as you might have guessed), but I was indeed surprised there's no -y, -by or whatever.

Posted by Paul Mowat on 30-Mar-2016 08:06

Didn't know you could do a echo :)

This thread is closed