Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle - v$sql determine if sql command was commited

Tags:

oracle

As we all know v$sql / v$sql_text / v$sqlarea etc. contains a list of sql commands recently executed.

Well, I would like to know if the transaction that executed a certain sql command was rollbacked/commited or possibly still going, and possibly also know the commit time.

I tried joining it with v$session etc., But couldn't find anything useful. Help will be appreciated.

Another thing that may help me if there is some way to look at v$sql as transactional. That is, only when the transaction that ran the sql command is commited, the information is visible to other sessions in the v$sql table.

Thank you

like image 241
user967710 Avatar asked Oct 20 '22 17:10

user967710


1 Answers

You omitted the basic question: what are you actually trying to achieve?

v$sql views are based on x$ tables, which are not transactional. To determine if a currently executed transaction has committed, you can use transaction guard. But in general the application should know very well if the transaction completed or rolled back.

like image 185
steve Avatar answered Oct 24 '22 00:10

steve