Check active transaction in Oracle

Check active transaction in Oracle

V$TRANSACTION view help in search for the transaction which is actually executing or waiting for the resources in the Oracle Database system. When you are working with DML or Begin-End statements, you can confirm the details of a transaction by querying from the V$TRANSACTION view.

For Example
In Example, we are inserted data into a table EMP then hold for issue a COMMIT or ROLLBACK Statement,In mean time you can view active transaction information for the currently connected session as follows:

-- Insert the row into the table.
SQL> insert into emp values(1, 'John', 'Smith');
-- Check the active transaction from view.
SQL> select xidusn, xidsqn from v$transaction;

XIDUSN     XIDSQN
---------- ----------
9          369

-- Commit will make the changes permanent and close the transaction.
SQL> commit;
-- After commit means tranction is finished.
SQL> select xidusn, xidsqn from v$transaction;
no rows selected

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.