cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Streams with bpstart & bpend

Gaurav_Patel1
Level 2

We are using bpstart notify & bpend scripts to put database in backup mode & remove it from backup mode respectively. We need to use multiple streams feature to reduce backup time. we used New_STREAM. We observed that start & stop scripts ran twice once for each script. One stream finished earlier than other which caused the database to be removed from backup mode & second stream is no more consistent.
Is there a way that we can avoid this.

2 REPLIES 2

pierceadmin
Level 2

Hi Gaurav,

Search through this community for keywords from your subject line and you should get some hits that help give you some more info in addition to my notes.

I'm currently trying to do the same thing you are.  I have the bpstart_notify successfully shutting my db services down only once, now I'm working on getting my bpend_notify script to only bring them up once.  I'm in a windows environment (master and clients).  Here's a copy of the bpstart and bpend commands I'm working on.  Keep in mind I'm troubleshooting an issue with my bpend_notify running multiple times so I don't guarantee these work as I've copied them.  I believe I still have a bug to work out in my bpend_notify. But they may help get you started.

 

In the bpstart_notify I have it creating a temporary file for each stream in the c:\temp directory.

In the bpend_notify I have it check for the existence of the temporary .lck file and delete it for each stream when the stream kicks off the bpstart_notify command.  When I get to the last one it should detect that there are no more present and run the command after :Complete.

 

-bpstart_notify sample

:FULL
@echo %STREAM_NUMBER% > C:\Temp\bpstart.%1.%2.%3.%STREAM_NUMBER%.lck
@REM Insert commands between the () brackets.
if %STREAM_NUMBER%==1 (c:\admin\shutdown_all_oracle.cmd)
if %ERRORLEVEL% GTR 1 goto :FAIL
@echo full backup started on %1 using policy %2 with schedule %3 and status %5, bpres = %6 >> bin\BP_RES.txt
@echo 0 >> %6
@GOTO :EOF 

 

 

--bpend_notify sample

:FULL
if exist C:\Temp\bpstart.%1.%2.%3.%STREAM_NUMBER%.lck (del C:\Temp\bpstart.%1.%2.%3.%STREAM_NUMBER%.lck)
@REM Check if this is the last stream...
if exist C:\Temp\bpstart.%1.%2.%3.*.lck (goto :EOF) else (goto :COMPLETE)
@REM Insert the commands directly below the :COMPLETE line
:COMPLETE
c:\admin\startup_all_oracle.cmd
@echo full backup finished on %1 using policy %2 with schedule %3 and status %5, bpres = %6 >> bin\BP_RES.txt
@echo 0 >> %6
@GOTO :EOF
@REM exit 0
:CINC
@echo cumulative incremental backup finished on %1 using policy %2 with schedule %3 and status %5, bpres = %6 >> bin\BP_RES.txt
@echo 0 >> %6
@GOTO :EOF
@REM exit 0
:FAIL
@REM no schedule type information was sent.  A failure has occured.  Write status 1 to results files.
@echo 1 >> %6
@GOTO :EOF
@REM exit 0

 

hopefully this helps.

good luck

-Brent

Former_Mary_Kay
Level 4
The bpend_notify script runs every time a stream ends.  I've done something similar to what you are trying to do before, and I had to have bpend_notify check to see if it's the last stream (and if any other bpend_notify scripts are already running) before executing what the rest of the script.