Oracle process session, cursor, and transaction relationship
If you use top in Linux, you can see the running Oracle process. In addition to background processes, Oracle also has user processes.
Both parallel and separate processes are enabled.
Multiple query windows in PL/SQL developer are actually processes.
A process can contain multiple sessions when they can only be run serially. For example, three select queries are executed in a query window.
The following statements show that all processes and session IDs are in the same process.
Select a. spid, A. PID, B. Sid, B. username, status, process, machine, B. Terminal, type, SQL _id
From v $ process a, V $ session B
Where background is null
And a. ADDR = B. paddr
And B. Username <> 'sysmance'
And B. Username <> 'sys'
And B. Terminal = 'pc-200904171104'
Order by B. terminal;
-- 13084 70 69 3608: 3612
Transaction concept: set to maintain data consistency.
Transactions are generated only when the table structure and data are changed.
DML, DDL.
The transaction commit statement is commit;
A session can have multiple transactions. For example, in a stored procedure. Of course, it is also serialized.
Open_cursors parameter cursor
To process SQL statements, Oracle allocates a region called context area to process the required information, including the number of rows to be processed, A pointer pointing to the expression form after the statement is analyzed and the query result set. cursor Is a handle or pointer pointing to the context area. Through it, PL/SQL can process data in the area.