on 11-23-2020 1:59 PM
Dear Everyone,
We face a strange inconsistency issue in a system, an order item entry in our application is updated with outdated data. An important flag is reset and one timestamp field is set to a past date, this causes an issue in the application. This inconsistency occurs randomly, it is not reproducible, there is no identified pattern. We activated and checked application level/sytem logs, implemented extra checks, double checked the transaction handling of the application but nothing was found at all. We could not identify any suspicious standard/custom ABAP code which could be responsible for this symptom.
Now we try to catch the root cause from DB side which is SYBASE / 16.0.03.07. The issue happens rarely, 1-2 times in 2 days, because of that we want to avoid the dbcc traceon approach in isql, the log would surely explode before catching anything useful. We think that creating an update trigger for error logging could be helpful in this case, we could extract some data about the mysterious process. It could be good to know when this false update happens, who is the responsible user, based on these we could track back the ABAP process.
As an ABAP application developer I haven't got any clue about Sybase until now, at the moment I try to figure out the logic of the new trigger from application point of view. How to create a simple trigger and setting up the logical condition is fine, I found quite good help materials. What it is not clear what we could print in the BEGIN-END section
CREATE TRIGGER false_update
ON /namespace/tablename
FOR UPDATE
AS IF ....some condition check on the fields
BEGIN
PRINT "Invalid table update"
PRINT "Timestamp field is incorrect"
PRINT getdate()
...
END
In the Sybase Infocenter I found some hints, for example I can call the getdate() function and I could print its result. ( http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36272.1572/html/commands/... ) But I rather need a username if possible, (not the database owner), a current timestamp. I'm not sure what else can I use, is current_date(), current_time() valid in this context, can I call these in a trigger? In the Adaptive Server® Enterprise 15.5 Reference Manual: Building Blocks ( http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc36271.1550/pdf/blocks.pdf ) I found the user function as well.
I'm afraid that in Sybase level only some technical user can be logged, I'll not be able to figure out here who executed the ABAP process which resulted the inconsistent update. So the real question is: can we use these functions in the BEGIN-END section of the trigger to log the user and date/time of this inconsistency? Do you maybe have further hints what else informative could be extracted?
PRINT current_date()
PRINT current_time()
PRINT user
Thanks a lot in advance,
Akos
User | Count |
---|---|
81 | |
11 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.