So I'm building a java app to interface with the company's database. Whenever it causes an ORA error, it just prints something like the following to system output:

ORA-00911: invalid character

Is there some way I can see what's causing it? Maybe some SQL statement I can use to see the last 10 errors caused on a table or something? I have SQLDeveloper if that might be useful.


Either set tracing on client(jdbc) side. Or you can create system trigger ON SYSTEMERROR see this, but this requires DBA privs.

| improve this answer | |
  • SYSTEMERROR trigger won't help (as it didn't work in the post you are referring ). In order to appear in v$sql the query must be validated. Queries with syntax errors never get successfully parsed – a1ex07 Jun 12 '15 at 19:10
  • @a1ex07 it won't apper in the v$sql view, but it should be read from ora_sql_txt function. It is the attribute passed to even trigger. – ibre5041 Jun 12 '15 at 20:47
  • yeah you're right , I didn't scroll down to the answer that mentioned sql_txt function. – a1ex07 Jun 12 '15 at 21:29

You can enable trace for you session after application is connected, for example, EXEC DBMS_MONITOR.session_trace_enable(binds=>TRUE);, then you will find the culprit in trace file. More information about tracing in Oracle https://oracle-base.com/articles/misc/sql-trace-10046-trcsess-and-tkprof

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.