Monday, March 4, 2013

Oracle Proxy Users

If you don't have the password of an account and you need to connect with this user to test any thing, instead of resetting the password, Oracle starting from 10g allows you to connect as a proxy user.
This also allows you to have one schema, but allow many users to connect, meaning no need for grants, roles, or synonyms.

This also means that one named user can be a proxy for many different application schemas depending on the connect string.

Configuration:
1- allow oradba user to connect to scott as a proxy user
SQL> alter user scott grant connect through oradba;

2- connect to the scott account using the oradba password
SQL> sqlplus oradba[scott]/oradba_password

3- check the environment
SQL> show user
SQL> select user from dual;
SQL> select sys_context('USERENV','PROXY_USER') from dual;

No comments: