First, I dont know what autonomous means..hehehe, lack of vocabulary :p
I am quotting from online dictionary, it is said that Autonomous means not controlled by others or by outside forces; independent. Combine it with transaction, it becomes an independent transaction, not controlled by other transactions.
Now, the meaning of autonomous transaction in PL/SQL pretty clear:
"Pragma Autonomous Transaction is which is executed in the execution of another transaction known as parent transaction which is independent of it or the whole transaction splits in to two parts known as parent& child will be independent of both but have the same relationship."
When you are writing a PL/SQL block (procedure or trigger) with insert or update statement followed by commit, try to include PRAGMA AUTONOMOUS TRANSACTION in the declare part. It will perform that commit as an independent transaction despite of other transaction is being rolled back or commited.
In the above example, we created a procedure INSERT_INTO_T. In this procedure we used the new pragma AUTONOMOUS_TRANSACTION. That directive tells the database that this procedure, when executed, is to be executed as a new subtransaction – independent from its parent transaction. This procedure simply inserts a record with the value of ‘1’ into the table T and commits. We then proceed to create an anonymous PL/SQL block in which we insert the value of ‘-1’ into T, invoke the stored procedure INSERT_INTO_T and rollback. Prior to autonomous transactions, the commit in the subroutine INSERT_INTO_T would have committed not only the work it performed (the insert of ‘1’) but any outstanding work the session had performed and not yet committed (the insert of ‘-1’ in the anonymous block). The rollback would have rolled back no work since the commit in the procedure would have committed both inserts. We see this is not the case with autonomous transactions. The work performed in the procedure marked with AUTONOMOUS_TRANSACTION was committed however the work performed outside the autonomous transaction was rolled back.
What is it used for? It is for audit trail purpose. And what is audit trail used for??? Hm, still a mystery for me ^^ next time laaahhh