Using Proxy Connections with SQL Developer or SQLPLUS
CREATE USER scott IDENTIFIED by tiger; GRANT CONNECT, CREATE TABLE TO SCOTT; CONNECT scott/tiger CREATE TABLE test_tab (ID NUMBER PRIMARY KEY, TEXTFIELD VARCHAR2(255)); CREATE USER dave IDENTIFIED BY kitten; GRANT CONNECT TO DAVE; ALTER USER SCOTT GRANT CONNECT THROUGH DAVE;
Now connect through DAVE into SCOTT user using SQLPLUS:
SQLPLUS DAVE[scott]/kitten@mydb select user from dual; USER ------------ SCOTT select table_name from user_tables; TABLE_NAME ------------ TEST_TAB -- Hey! I'm logged in as DAVE but I am now acting like SCOTT!
SQL Developer Method 1Now in SQL Developer open the Connection Screen and enter:
- Connection Name: MYDB - Dave>Kitten
- Username: DAVE[scott]
- Password: kitten
SQL Developer Method 2When setting up the connection you can also click the Proxy connection box, Select User Name and enter Username in "Proxy Client" box
Clean up after yourself!
Since this is only for temporary debugging be safe and remove the proxy privilege.
ALTER USER SCOTT REVOKE CONNECT THROUGH DAVE;
If interested in doing this full time I recommend reading the documentation in the References section below to be aware of all the pros and cons of using this connection method.
Oracle Documentation here: link
Blog Post about Proxy + SQLPLUS link