OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Command-Line Client

V2.2.13
  • Introduction
    • Overview of OBClient
  • Quick start
    • Quick start with OBClient
  • Command-line options
    • Common OBClient command-line options
    • Reference for OBClient command-line options
    • SQL context when a script fails
  • Configuration and environment
    • Configure OBClient and set environment variables
  • User guide
    • Reference for OBClient internal commands
  • Advanced features
    • Support for Oracle-compatible mode in OBClient
    • Log in to OBClient through a socket5 proxy
    • Multi-IP connection support for OBClient
    • Client IP passthrough and tenant allowlist (F5 scenario)
    • Log in as a proxy user of OBClient
    • LOAD DATA LOCAL INFILE
    • SET variables
    • Supported login_path options for OBClient
  • Tips and troubleshooting
    • OBClient Usage Tips and Troubleshooting

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Command-Line Client
  3. V2.2.13

Log in as a proxy user of OBClient

Last Updated:2026-09-02 09:17:42

Prepare the environment
Create users
Authorize a proxy user
Log in as a proxy user
References

OceanBase Database in Oracle-compatible mode supports the proxy user feature: after being authorized, User A (the proxy user) can log in using its own credentials and execute database operations on behalf of User B (the target user), with the role privileges of the target user taking effect.

Note

Proxy user is a user privilege capability in Oracle-compatible mode, which is different from the connection middleware ODP (OceanBase Database Proxy). This topic describes the former. When accessing the database through ODP, you can still use --proxy_user to specify the target user. For authorization and management of proxy users, see the OceanBase Database documentation "Use proxy users".

Prepare the environment

Create users

CREATE USER test IDENTIFIED BY test;
GRANT CONNECT, RESOURCE, DBA TO test;

CREATE USER test2 IDENTIFIED BY test2;
GRANT CONNECT, RESOURCE, DBA TO test2;

Authorize a proxy user

Authorize user test as the proxy user for user test2:

ALTER USER test2 GRANT CONNECT THROUGH test;

Remove proxy privileges:

ALTER USER test2 REVOKE CONNECT THROUGH test;

Log in as a proxy user

Log in as the proxy user test and act on behalf of the target user test2:

obclient -h100.88.109.130 -P38884 -utest@oracle -Dtest -ptest --proxy_user=test2

Use the --proxy_user option to specify the username to be proxied.

References

  • Supported modes
  • Command-line options

Previous topic

Client IP passthrough and tenant allowlist (F5 scenario)
Last

Next topic

LOAD DATA LOCAL INFILE
Next
on this page
Prepare the environment
Create users
Authorize a proxy user
Log in as a proxy user
References