cancel
Showing results for 
Search instead for 
Did you mean: 

Watching for schema modification

oneeyeman1
Participant
0 Kudos
143

Hi, ALL,

Is it possible to get a notification about schema modification?

Let's say the user of my program runs "CREATE TABLE..." query.

My program wants to run some code when this query is executed.


The queries I'm interested are altering tables and indexes.

Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

bonusbrevis
Participant
0 Kudos

You could do this with the Auditing subsystem in ASE. Install Auditing as per the documentation and then define the audit event you are interested in - in your case:

sp_audit "create", "all", db_name, "on"

sp_audit "alter", "all", db_name, "on"

Once enabled and configured, these DDL executions by any user will trigger an addition to the current audit table in sybsecurity. You can then script an alert via a trigger to notify you when these records are written to the audit, though the audit record will also give you a timestamp, login, application etc. of the event.

former_member188958
Active Contributor

16.0 SP04 adds an option to output the audit records to the operating system (OS) syslog file. For example, the /var/log/messages for Linux OS, which may be more convenient to monitor.

https://help.sap.com/viewer/379424e5820941d0b14683dd3a992d5c/16.0.4.0/en-US/3d4ee52d272442b98dcd1903...

oneeyeman1
Participant
0 Kudos

iron_horse ,

if I'm running my program and someone decides to run that query from isql or from another computer with my program installed.

Of course it would be nice to know what kind of DDL was run, but...

Thank you.

P.S.: Is there a way to post a reply on the reply? Or replies are allowed only on 1st level?