on 2021 Feb 10 2:46 PM
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.
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
54 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.