Hi, i want to extract any change made to SA into a messaging system. Is there any (java) library that allows me to read the binary transaction file. The SQL file I can generate from the transaction file doesnt help me much, as I would need to parse it to extract the information. I am looking for a more machine readable format such as CSV or XML.
Thanks a lot Frank |
So what would be a "machine readable format" for SQL Anywhere transactions - other than the original log file itself? FWIW, there's the C-based DBTools API with the DBTranslateLog() function, which should be callable from a JNI interface or the like (I'm guessing, it's not my area of expertise)... - this would allow to grab the contents in text form (primarily as SQL Statements and the like - note, the DBTRAN utility does use that API itself) and to format it as desired... I meant Easily machine readable. The DBTranslateLog is translating to SQL, what i need is ability to read the content directly, so instead of going log -dbtran-> SQL -parser-> CSV i like to use an API to translate from log file into CSV (log --Parser--> CSV)
(14 Oct '16, 10:08)
flangel
Replies hidden
So what exactly is the contents you are looking for - the TL contains all DDL/DML/DCL operations, and these are basically done via SQL statements, so what are you expecting other than SQL statements?
(14 Oct '16, 17:44)
Volker Barth
|
There is no Java tool that can read the transaction log. The only tool (library) that I know of that exists is written in C/C++ and it is dbtran (which loads dbtools library). FWIW: the same source code is compiled into the database server as well. So the best that you can do would be to use dbtran to convert the transaction log to a text file and then write a tool (in whatever language you want) that would convert the file into a CSV (or whatever format you desire). |
Consider a different approach: Use triggers to build your own audit trail facility that is designed to meet your needs, rather that struggle with parsing the hugely-complex transaction log. Tip: Triggering an Audit Trail Revisited: Triggering an Audit Trail Breck, thanks a lot for your answer. Might be a good alternative to consider.
(19 Oct '16, 06:22)
flangel
|