Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear Oracle session state

Tags:

oracle

plsql

A database connection on Oracle can have session state that persists for the lifetime of the connection, i.e. in the form of package variables.

Is there a way of flushing/clearing all that state between calls during a connection without killing the connection and reestablishing a new connection.

I.e. consider a package variable first set in the package init, and later modified within some procedure in that package: how to "reset" the package so that multiple calls to the procedure from 1 connection always lead to a reinit of the package?

In general: how to "reset" any session state between execution of statements from a client on that connection?

like image 841
oberstet Avatar asked Oct 02 '12 10:10

oberstet


People also ask

How does Oracle handle inactive sessions?

Just before the oracle executable executes a read to get the next "command" that it should execute for its session, it will set its session's state to INACTIVE . After the read completes, it will set it to ACTIVE . It will remain in that state until it is done executing the requested work.

How can I change session in Oracle?

Use the ALTER SESSION statement to set or modify any of the conditions or parameters that affect your connection to the database. The statement stays in effect until you disconnect from the database. To enable and disable the SQL trace facility, you must have ALTER SESSION system privilege.


1 Answers

dbms_session.reset_package is the closest I can think of. See this tahiti link.

like image 197
René Nyffenegger Avatar answered Sep 28 '22 07:09

René Nyffenegger