The only thing we have after the backup command is some echo statements. I would think that they would not affect the errorlevel?
@ECHO OFF set sql_install="C:\Program Files\Tivoli\TSM\TDPSql" set sql_virtual="C:\TSM\TDP" echo %date% %time% >> %sql_virtual%\SQL_FullLog.txt echo **************************************************************************************** >> %sql_virtual%\SQL_RunLog.txt echo %date% %time% >> %sql_virtual%\SQL_RunLog.txt echo **************************************************************************************** >> %sql_virtual%\SQL_RunLog.txt %sql_install%\tdpsqlc backup * full /BACKUPMETHod=legacy /SQLSERVER=servername /tsmoptfile=%sql_virtual%\dsm_sql.opt /logfile=%sql_virtual%\SQL_FullLog.txt >> %sql_virtual%\SQL_RunLog.txt echo **************************************************************************************** >> %sql_virtual%\SQL_RunLog.txt echo %date% %time% >> %sql_virtual%\SQL_RunLog.txt echo **************************************************************************************** >> %sql_virtual%\SQL_RunLog.txt On Thu, Jan 19, 2017 at 7:41 AM, Del Hoobler <[email protected]> wrote: > Tom, > > Does the script capture the RC and then exit the script with that RC? > > http://www-01.ibm.com/support/docview.wss?uid=swg21605132 > > > Thank you, > > Del > > ---------------------------------------------------- > > > "ADSM: Dist Stor Manager" <[email protected]> wrote on 01/18/2017 > 05:52:05 PM: > > > From: Tom Alverson <[email protected]> > > To: [email protected] > > Date: 01/18/2017 05:52 PM > > Subject: TDP SQL backup fails but is reported as a success ?? > > Sent by: "ADSM: Dist Stor Manager" <[email protected]> > > > > I periodically have an SQL backup fail but the scheduler reports that it > > was a success so I never get a failure ticket (the database admin > complains > > about the lack of a backup). Here you can see I get the ACO5436E error > > with RC=-50 which there is almost no hit for on an internet search. Here > > you can see the error and the fact that only 6 of the 11 databases were > > successful yet the scheduler has a return code of 0. This issue happens > > intermittently on many of our SQL backups. > > > > Backup Log: > > 01/17/2017 01:10:28 ANS1017E (RC-50) Session rejected: TCP/IP > connection > > failure. > > > > 01/17/2017 01:10:28 ACO5436E A failure occurred on stripe number (0), rc > = > > -50 > > > > 01/17/2017 01:10:28 ANS1017E (RC-50) Session rejected: TCP/IP > connection > > failure. > > > > 01/17/2017 01:10:28 Backup of VCM failed. > > > > 01/17/2017 01:10:28 ANS1017E (RC-50) Session rejected: TCP/IP > connection > > failure. > > > > 01/17/2017 01:10:28 Total SQL backups selected: 11 > > > > 01/17/2017 01:10:28 Total SQL backups attempted: 11 > > > > 01/17/2017 01:10:28 Total SQL backups completed: 6 > > > > 01/17/2017 01:10:28 Total SQL backups excluded: 0 > > > > 01/17/2017 01:10:28 Total SQL backups inactivated: 0 > > > > 01/17/2017 01:10:28 Total SQL backups deduplicated: 0 > > > > > > > > > > > > Schedule Log: > > > > 01/18/2017 01:20:34 > > > > Executing scheduled command now. > > > > 01/18/2017 01:20:41 Node Name: servername_SQL > > > > 01/18/2017 01:20:41 Session established with server storageserver: AIX > > > > 01/18/2017 01:20:41 Server Version 6, Release 3, Level 5.100 > > > > 01/18/2017 01:20:41 Data compression forced off by the server > > > > 01/18/2017 01:20:41 Server date/time: 01/18/2017 01:20:41 Last > access: > > 01/18/2017 01:10:33 > > > > 01/18/2017 01:20:42 > > > > Executing Operating System command or script: > > > > C:\TSM\TDP\SQLFULL.bat > > > > 01/18/2017 01:40:36 Finished command. Return code is: 0 > > > > 01/18/2017 01:40:36 ANS1908I The scheduled command completed > successfully. > > > > 01/18/2017 01:40:36 Scheduled event 'TDP_1AM' completed successfully. > > > > 01/18/2017 01:40:36 Sending results for scheduled event 'TDP_1AM'. > > > > 01/18/2017 01:40:37 Results sent to server for scheduled event > 'TDP_1AM'. > > >
