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.

  1. Any tool/library to read the binary file
  2. Any tool/library to translate transaction log into format other then SQL ?

Thanks a lot Frank

asked 14 Oct '16, 09:20

flangel's gravatar image

flangel
26135
accept rate: 0%


I am looking for a more machine readable format such as CSV or XML

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...

permanent link

answered 14 Oct '16, 09:36

Volker%20Barth's gravatar image

Volker Barth
31.3k312458674
accept rate: 32%

edited 14 Oct '16, 09:38

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

what i need is ability to read the content directly

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).

permanent link

answered 14 Oct '16, 10:22

Mark%20Culp's gravatar image

Mark Culp
23.3k9132275
accept rate: 40%

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

ALTER TABLE and the Audit Trail

Reporting and the Audit Trail

permanent link

answered 14 Oct '16, 17:08

Breck%20Carter's gravatar image

Breck Carter
26.9k438609883
accept rate: 21%

Breck, thanks a lot for your answer. Might be a good alternative to consider.

(19 Oct '16, 06:22) flangel
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×48
×34

question asked: 14 Oct '16, 09:20

question was seen: 321 times

last updated: 19 Oct '16, 06:22