![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way to build a validation routine into the event and a capability to notify someone if the backup does not pass validation? Sample script would be a big help. |
#3
| |||
| |||
|
|
Is there a way to build a validation routine into the event and a capability to notify someone if the backup does not pass validation? Sample script would be a big help. |
#4
| |||
| |||
|
|
If you'd like an example of a quick script to do a backup/validate on either OS, I can provide a sample. |
|
Hi Doug, First, to verify the database, you should run dbvalid ( http://dcx.sybase.com/index.php#1101...1/dbvalid.html ) and check the process' exit code for success (0) or failure (non-zero) ( http://dcx.sybase.com/index.php#1101...xit-codes.html ) . To verify the transaction log, you should run dbtran and check for the same. The process' exit code is stored in the variable %ERRORLEVEL% in a DOS batch script, or the variable "$?" on Linux/UNIX bash script. If you'd like an example of a quick script to do a backup/validate on either OS, I can provide a sample. --- What you do with the exit code afterwards to 'notify someone' is somewhat environment-specific. If you wanted to do this on Windows, you can either re-code your backup process as a Windows Script / PowerShell Script and then use something like CDOSYS to send an e-mail ( http://support.microsoft.com/default.aspx/kb/810702 ), or you could install a command-line utility to send e-mail. (FWIW, I found a Win32 port of 'mutt': http://developer.berlios.de/projects/mutt-win32/ ) On Linux/UNIX, you can likely use "mutt", "sendmail", or a similar utility at the command line to send the e-mail for 'notification'. -- ALTERNATIVE SOLUTION -- You could create the same effect from a stored procedure in SQL using: 1. BACKUP DATABASE DIRECTORY ... http://dcx.sybase.com/index.php#1101...statement.html 2. xp_cmdshell to run dbvalid / operating system commands: http://dcx.sybase.com/index.php#1101...s-4380894.html 3. xp_sendmail to e-mail someone when the script fails: http://dcx.sybase.com/index.php#1101...1/spmspse.html I posted a sample of this solution on a thread you started last year with the same question: http://groups.google.com/group/sybas...fd839d9accd5cd ============= Cheers, Doug Stone wrote: Is there a way to build a validation routine into the event and a capability to notify someone if the backup does not pass validation? Sample script would be a big help. -- Jeff Albion, Sybase iAnywhere iAnywhere Developer Community : http://www.sybase.com/developer/libr...ere-techcorner iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals SQL Anywhere Patches and EBFs : http://downloads.sybase.com/swd/summ...&timeframe =0 Report a Bug/Open a Case : http://case-express.sybase.com/cx/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |