How To Set a Transaction To Be READ ONLY in Oracle?
Submitted by: AdministratorIf you want a transaction to be set as READ ONLY, you need to the transaction with the SET TRANSACTION READ ONLY statement. Note that a DML statement will start the transaction automatically. So you have to issue the SET TRANSACTION statement before any DML statements. The tutorial exercise below shows you a good example of READ ONLY transaction:
SQL> connect HR/globalguideline
SQL> SET TRANSACTION READ ONLY;
Transaction set.
SQL> SELECT * FROM ggl_links;
<pre> ID URL NOTES COUNTS CREATED
------- ---------------- ---------- ---------- ---------
101 globalguideline.COM 07-MAY-06
110 globalguideline.COM 07-MAY-06
112 oracle.com 07-MAY-06
113 sql.com 07-MAY-06</pre>
Submitted by: Administrator
SQL> connect HR/globalguideline
SQL> SET TRANSACTION READ ONLY;
Transaction set.
SQL> SELECT * FROM ggl_links;
<pre> ID URL NOTES COUNTS CREATED
------- ---------------- ---------- ---------- ---------
101 globalguideline.COM 07-MAY-06
110 globalguideline.COM 07-MAY-06
112 oracle.com 07-MAY-06
113 sql.com 07-MAY-06</pre>
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | How To Recover a Dropped Table in Oracle? |
☺ | How Oracle Handles Dead Locks? |
☺ | How Much Memory Your 10g XE Server Is Using? |
☺ | What Is the Relation of a User Account and a Schema? |
☺ | How To Use Values from Other Tables in UPDATE Statements using Oracle? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |