CLOSE_ALL_CONNECTIONS v15

The CLOSE_ALL_CONNECTIONS procedure terminates all active network sessions currently managed by the session and releases their associated resources.

CLOSE_ALL_CONNECTIONS();

Notes

  • Bulk cleanup: This procedure is an efficient way to ensure no "orphan" connections remain open at the end of a process or in the event of an error recovery sequence.

  • Scope: Only connections opened within the current session are affected. It will not close connections established by other database sessions.

  • Handle invalidation: After calling this procedure, any existing connection handles previously returned by OPEN_CONNECTION become invalid. Attempting to use them for read or write operations will result in an error.

Example

BEGIN   
  UTL_TCP.CLOSE_ALL_CONNECTIONS();
END;