User Tools

Site Tools


database:oracle:users:connect-as-another-user

Connect as another user (using a privileged one)

CREATE USER proxy1 IDENTIFIED BY proxy1;
ALTER USER main_user GRANT CONNECT through proxy1;
CONNECT proxy1[main_user]/proxy1@SID;

Now we are connected, let's check current user:

SHOW USER;

Output: user is main_user

Change only the default schema

ALTER SESSION SET current_schema=other_schema_name

Check if the schema was changed:

SELECT sys_context( 'userenv', 'current_schema' ) FROM dual;
database/oracle/users/connect-as-another-user.txt · Last modified: 2023/07/04 19:36 by 127.0.0.1