Skip to main content

Why and How to Use Proxy Users in Oracle Database

Managing access in Oracle databases can get tricky, especially when multiple developers share the same schema or when DBAs need to perform tasks under specific accounts without knowing their passwords. That’s where proxy users come in.

A proxy user allows one account to connect through another, giving teams a secure and flexible way to manage access without exposing credentials.

Use-Cases

  • DBA tasks without passwords – Perform administrative operations (like creating private database links or jobs with DBMS_JOB) under a specific user account without needing to know or share that account’s password. 
  • Shared schema access for teams – Allow multiple developers to work in the same schema using their own proxy accounts instead of sharing a single set of credentials. 
  • Auditing and accountability – Track individual actions inside a shared schema, since each user connects with their own credentials through the proxy.

How-To

In this example, the target schema account is named EDS (the application account). A separate account, proxy_user, will be created to connect through the EDS account.
col username form a20
select username from dba_users where username like upper('%eds%') or username like upper('%meris%')

USERNAME
--------------------
EDS

Create the proxy account.
create user proxy_user identified by passw0rd;
grant connect to proxy_user;
Grant permission connect through to proxy_user to login as EDS as proxy.
alter user EDS grant connect through proxy_user;
Connect via proxy user.
sqlplus proxy_user[EDS]/passw0rd
SQL> show user
USER is "EDS"
SQL> set pages 400 lines 200
SQL> col session_user form a20
SQL> col session_schema form a20
SQL> col current_schema form a20
SQL> col proxy_user form a20
SQL> r
  1  select sys_context('userenv','session_user') as session_user,
  2  sys_context('userenv','session_schema') as session_schema,
  3  sys_context('userenv','current_schema') as current_schema,
  4  sys_context('userenv','proxy_user') as proxy_user
  5* from dual

SESSION_USER         SESSION_SCHEMA       CURRENT_SCHEMA       PROXY_USER
-------------------- -------------------- -------------------- --------------------
EDS                  EDS                  EDS                  PROXY_USER


Find the proxy session.
SQL> col username form a20
SQL> col osuser form a20
SQL> r
  1  SELECT a.sid,
  2         a.serial#,
  3         a.username,
  4         a.osuser,
  5         b.authentication_type
  6  FROM   v$session a,
  7         v$session_connect_info b
  8  WHERE  a.sid = b.sid
  9    AND  a.serial# = b.serial#
 10*   AND  b.authentication_type = 'PROXY'

       SID    SERIAL# USERNAME             OSUSER               AUTHENTICATION_TYPE
---------- ---------- -------------------- -------------------- --------------------------
       108      15998 EDS                  oracle               PROXY
       108      15998 EDS                  oracle               PROXY
       108      15998 EDS                  oracle               PROXY
       108      15998 EDS                  oracle               PROXY

Comments

Popular posts from this blog

In-Place Upgrade from Oracle Linux 7 to 8 Using LEAPP

Upgrading from Oracle Linux 7 to Oracle Linux 8 is important to keep your system secure, stable, and supported. Oracle Linux 7 is now out of support, which means it no longer receives updates, security patches, or fixes. Moving to Oracle Linux 8 ensures you continue getting updates, new features, and better performance. The LEAPP tool makes this upgrade easier by allowing an in-place upgrade, so you don’t need to reinstall the system from scratch. It checks if your system is ready, identifies potential issues, and helps guide you through the upgrade process. This guide will walk you through the basic steps and requirements to successfully upgrade Oracle Linux 7 to Oracle Linux 8 using LEAPP. Oracle Lifetime Support Policy Regarding upgrading Oracle Linux 7 to Oracle Linux 8, here are a few key points to consider: Review the official documentation thoroughly before starting the upgrade process Ensure you have a complete backup in place, as this is an in-place upgrade and you may n...

Step-by-Step Guide to Renewing OLVM Certificates in Version 4.3

Managing certificates is a critical administrative task in Oracle Linux Virtualization Manager (OLVM) environments, as expired certificates can result in host disconnections, authentication failures, and service disruptions. In this article, we will cover the process of renewing certificates in OLVM version 4.3 before they expire, ensuring secure communication between the engine and managed KVM hosts. For this procedure, we will use the OlvmKvmCerts utility provided by Oracle to renew the required certificates. In OLVM 4.3, although some engine-related certificates can be renewed using the engine-setup command, not all certificates are automatically refreshed. Certain components require manual renewal because the certificate renewal process in this version is not fully automated. It is important to note that this limitation has been addressed in  OLVM 4.4.10.7-1.0.24 and later.  Additionally, OLVM 4.3 has been unsupported since October 2022, and OLVM 4.4 reached end of su...

Oracle 19c: Data Guard Physical Standby Setup Guide

In this blog post, we’ll walk through the process of creating a Data Guard Physical Standby database in Oracle Database 19c, where ASM (Automatic Storage Management) and OMF (Oracle Managed Files) are used for storage management.  Setting up a standby database with Data Guard enhances the high availability, disaster recovery, and data protection capabilities of your Oracle environment.  By leveraging ASM and OMF, we simplify file management and ensure optimal performance and flexibility. This guide provides a step-by-step approach, from preparing the primary database to configuring the standby environment, ensuring a smooth and reliable setup. Environment Overview In this setup, we have two database servers configured for a Data Guard Physical Standby environment: Primary Server : server-graz – This server hosts the primary database named graz . Standby Server : server-salzburg – This server will act as the physical standby. Both servers are configured to use ASM (Au...