Table of Contents

About

When a session starts, CURRENT_SCHEMA has the value of the schema owned by SESSION_USER.

How to

Get the current value

To get the current value of CURRENT_SCHEMA, CURRENT_USER, or SESSION_USER, use the userenv context:

SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;

Modify it

CURRENT_SCHEMA can be changed during the session with the SQL statement ALTER SESSION SET CURRENT_SCHEMA.

ALTER SESSION SET CURRENT_SCHEMA = MY_SCHEMA;

MY_SCHEMA without quote.

Oracle recommends against issuing ALTER SESSION SET CURRENT_SCHEMA from in a stored PL/SQL unit.