cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Anywhere Monitor/Alert for specific SqlErrorCodes

Former Member
0 Kudos

Hi, I am trying to determine if there are any SQL Anywhere 16 configurations/tools/etc. that would provide the following:

1.)  A true "monitoring" process that is intended to be ran constantly in the background and not noticeably degrade the performance of the machine much (I realize that any new process running on a computer will require some level of resources).

2.)  Can be configured to monitor whenever specific SqlErrorCodes occur (i.e. regardless of if the error happened when someone was manually running SQL commands via dbiSql or another application that interacts with the DB invoked the faulty SQL statement/action, etc.).

3.)  Can be configured to perform some kind of action such as:

      a.)  Run a DB Stored Proc.

      b.)  Write to the Windows Event Log.

      c.)  Some other custom action...

Does anyone know of such a configuration/tool within the SQL Anywhere 16 product base (or other tools, etc.)?

Specifically, I would like to monitor my DB/Server and be alerted when any of the following SQLERRORCODE values occur:

  1.)  149   Automatic database upgrade applied

  2.)  140   Encryption has not been enabled

  3.)  100   Row not found

  4.)  -76   Request denied -- no active databases

  5.)  -75   Request to start/stop database denied

  6.)  -83   Specified database not found

  7.)  -86   Not enough memory to start

  8.)  -99   Connections to database have been disabled

  9.)  -107  Error writing to transaction log file

  10.) -607  Cannot stop the database server

  11.) -673  Database upgrade not possible

  12.) 672   Database upgrade failed

  13.) -697  Error during backup/restore: %1 

  14.) -764  Server not found and unable to automatically start

  15.) -876  Client out of memory

  16.) -895  Encryption error: %1

  17.) -913  A transaction log file is required for auditing

  18.) -1021 Invalid backup operation

  19.) -107  The %1 algorithm is not available in FIPS mode

  20.) -1104 Too many users in database

  21.) -1143 Encryption has not been enabled

  22.) -1152 Password has expired

  23.) -1372 The server is not able to establish TCP/IP connections

I am hoping there is some existing monitoring and alerting service that can do this.  Otherwise, the only thing I can think of is to force DBTran to run (to translate the DB's log file into a SQL script file), kickoff dbeng16/dbsrv16 with the "-zr", "-zo", and "-oe" parameter options (or maybe other options like "-uf", "-ufd", "-oef", "-o", etc), and then write my own "monitoring" program/WinService that every 5min or so parses the .SQL file that the DBTran creates and looks for those specific error codes.  Even then, I do not know that the resulting .SQL file from DBTran would contain all those error codes if/when the happen.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182948
Active Participant
0 Kudos

The SQLError can trigger the database event.

(event-type : RAISERROR)

And Message statement can write to the Windows Event Log.

Please refer to the following documents.

"CREATE EVENT statement"

http://dcx.sap.com/index.html#sa160/en/dbreference/create-event-statement.html

"MESSAGE statement"

http://dcx.sap.com/index.html#sa160/en/dbreference/message-statement.html

Thanks