OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.0.0Enterprise Edition

  • Overview
    • Overview
    • System architecture
    • Compatibility with MySQL
    • Compatibility with Oracle
      • Overview
      • SQL data types
      • Built-in functions
      • System views
    • Limits
  • Get Started
    • Quick start with OceanBase Database
    • Hands on for OceanBase SQL
      • Usage notes
      • Basic SQL operations (MySQL mode)
      • Basic SQL operations (Oracle mode)
    • Build applications (MySQL Mode)
      • Connect Python applications to OceanBase Database
      • Connect Java applications to OceanBase Database
      • Connect C applications to OceanBase Database
    • Build applications(Oracle Mode)
      • Connect Python applications to OceanBase Database
      • Connect Java applications to OceanBase Database
      • Connect C applications to OceanBase Database
    • Experience OceanBase advanced features
      • Experience scalable OLTP
        • Run the TPC-C benchmark in OceanBase Database
        • Experience the hot row update capability of OceanBase Database
      • Experience operational OLAP
      • Experience parallel import and data compression
      • Experience the multitenancy feature
  • Develop
    • Develop (MySQL Mode)
      • Connect to Oceanbase Database with client
        • Overview
        • Connect to an OceanBase Database tenant by using a MySQL client
        • Connect to an OceanBase Database tenant by using OBClient
        • Connect to OceanBase Database by using ODC
        • Java application
          • OceanBase Connector/J
          • Java APIs
          • Connect Java applications to OceanBase Database
        • C application
          • OceanBase Connector/C
          • C API functions
          • Connect C applications to OceanBase Database
        • Python applications
        • SpringBoot connection example
        • SpringBatch connection example
        • Example of Database connection pool configuration
          • Overview of database connection pool configuration
          • Example of configuring a Tomcat connection pool
          • Example of configuring a C3P0 connection pool
          • Example of configuring a Proxool connection pool
          • Example of configuring a HiKariCP connection pool
          • Example of configuring a DBCP connection pool
          • CommonPool configuration example
          • Example of configuring a JDBC connection pool
        • SpringJDBC connection example
        • SpringJPA connection example
        • Hibernate connection example
        • MyBatis connection example
      • Create and manage database objects
        • About DDL statements
        • View the currently connected database
        • Change the password of a user
        • Data type
          • General data types
          • Unsupported data types
        • Create and manage tables
          • About tables
          • Create a table
          • About auto-increment columns
          • About types of column constraints
          • About table structure modification
          • About table clearing
          • About table dropping
          • Flash back a dropped table
          • About table privileges
        • Create and manage partition tables
          • About partitioned tables
          • Create a partitioned table
          • Manage a partitioned table
          • Create a subpartitioned table
          • Manage a subpartitioned table
          • Partition routing
          • Indexes on partitioned tables
          • Suggestions on using partitioned tables
        • Create and manage indexes
          • About indexes
          • Create an index
          • Drop an index
        • Create and manage views
          • About views
          • Create a view
          • Modify a view
          • Delete a view
        • Create and manage sequences
          • About sequences
          • Create a sequence
          • Modify a sequence
          • Delete a sequence
        • Create and manage triggers
          • About triggers
          • Create a trigger
          • Delete a trigger
      • Query
        • About queries
        • Single-table queries
        • Conditional queries
        • ORDER BY queries
        • GROUP BY queries
        • Use the LIMIT clause in queries
        • Query data from multiple tables
          • About multi-table join queries
          • INNER JOIN queries
          • OUTER JOIN queries
          • Subqueries
        • Use operators and functions in a query
          • Use arithmetic operators in queries
          • Use numerical functions in queries
          • Use string connectors in queries
          • Use string functions in queries
          • Use datetime functions in queries
          • Use type conversion functions in queries
          • Use aggregate functions in queries
          • Use NULL-related functions in queries
          • Use the CASE conditional operator in queries
          • Use the SELECT FOR UPDATE statement to lock query results
        • Execution plan
          • View an execution plan
          • Understand an execution plan
        • Use SQL hints in queries
        • Variables of query timeout
      • DML statements and transactions
        • DML statement
          • About DML statements
          • About the INSERT statement
          • UPDATE statements
          • About the DELETE statement
          • About the REPLACE INTO statement
        • Transactions
          • About transaction control statements
          • Start a transaction
          • Transaction savepoints
          • Commit a transaction
          • Roll back a transaction
          • About transaction timeout
      • Common errors and solutions
        • About error codes
        • Database connection error
        • About timeout
          • Idle session timeout
          • Transaction timeout errors
        • About user
          • Locked user
          • Incorrect user password
        • About table
          • Table already exists
          • Table does not exist
          • Invalid use of NULL value
        • About constraint
          • Unique key conflict
          • Foreign key conflict
        • About SQL commands
          • Data truncation
    • Develop (Oracle Mode)
      • Connect to Oceanbase Database with client
        • Overview
        • Connect to an OceanBase tenant by using an Oracle client
        • Connect to an OceanBase Database tenant by using OBClient
        • Connect to OceanBase Database by using ODC
      • Application development
        • Java application
          • OceanBase Connector/J
          • Java APIs
          • Connect Java applications to OceanBase Database
        • Python application
          • OceanBase Connector/J in Python
          • Python APIs
          • Connect Python applications to OceanBase Database
        • 300.c-application-1
          • OceanBase Connector/C
          • OBCI APIs
          • Connect C applications to OceanBase Database
      • Create and manage database objects
        • About DDL statements
        • View the currently connected database
        • Change the password of a user
        • Data type
          • General data types
          • Unsupported data types
        • Create and manage tables
          • About tables
          • Create a table
          • Define an auto-increment column by using the SEQUENCE keyword
          • About types of column constraints
          • About table structure modification
          • About table clearing
          • About table dropping
          • Flash back a dropped table
          • About table privileges
        • Create and manage partition tables
          • About partitioned tables
          • Create a partitioned table
          • Manage a partitioned table
          • Create a subpartitioned table
          • Manage a subpartitioned table
          • Partition routing
          • Indexes on partitioned tables
          • Suggestions on using partitioned tables
        • Create and manage indexes
          • Drop an index
          • About indexes
          • Create an index
        • Create and manage views
          • About views
          • Create a view
          • Modify a view
          • Drop a view
        • Create and manage sequences
          • About sequences
          • Create a sequence
          • Modify a sequence
          • Delete a sequence
        • Create and manage synonyms
          • About synonyms
          • Create a synonym
          • Delete a synonym
        • Create and manage triggers
          • About triggers
          • Create a trigger
          • Modify a trigger
          • Delete a trigger
          • Enable or disable a trigger
      • Query
        • About queries
        • Single-table queries
        • Conditional queries
        • ORDER BY queries
        • GROUP BY queries
        • Use Row_Limiting_Clause in queries
        • Query data from multiple tables
          • About multi-table join queries
          • INNER JOIN queries
          • OUTER JOIN queries
          • Subqueries
        • Use operators and functions in a query
          • Use arithmetic operators in queries
          • Use numerical functions in queries
          • Use string concatenation operators in queries
          • Use string functions in queries
          • Use datetime functions in queries
          • Use type conversion functions in queries
          • Use aggregate functions in queries
          • Use NULL-related functions in queries
          • Use CASE functions in queries
          • Use the SELECT FOR UPDATE statement to lock query results
        • Execution plan
          • View execution plans of queries
          • Understand an execution plan
        • Use SQL hints in queries
        • About query timeout variables
      • DML statements and transactions
        • DML statement
          • About DML statements
          • About the INSERT statement
          • UPDATE statements
          • About the MERGE statement
          • About the DELETE statement
        • Transactions
          • About transaction control statements
          • Start a transaction
          • Transaction savepoints
          • Commit a transaction
          • Roll back a transaction
          • About transaction timeout
      • Common errors and solutions
        • Overview
        • Database connection error
        • About timeout
          • Idle session timeout
          • Transaction timeout errors
        • About user
          • Locked user
          • Incorrect user password
        • About object
          • Object already exists
          • Object does not exist
        • About constraint
          • Unique key conflict
          • Foreign key conflict
        • About sql
          • Data type inconsistency
  • Deploy
    • Overview
    • Deployment procedure
    • Preparations before deployment
      • Prepare servers
      • Configure servers
      • Prepare installation packages
    • HA solution for OceanBase clusters
    • Deploy through the CLI
      • Configure the deployment environment
        • Install oat-cli
        • Use oat-cli to configure the deployment environment
        • Configure the clock source
        • Upload installation packages
        • Configure host information
        • Check the environment before deployment
      • Deploy OCP
        • Deployment description
        • Generate a configuration file
        • Start deployment
        • Check after deployment
      • Deploy the OceanBase cluster
        • Deploy a single-replica OceanBase cluster
        • Deploy a three-replica OceanBase cluster
      • Deploy OBProxy
        • Deploy OBProxy through the CLI
      • Create an OceanBase tenant
        • View resources available for a business tenant
        • Create a tenant
        • Verify after deployment
      • Deploy OMS
        • Deployment description
        • Modify the configuration file
        • Start deployment
        • Check after deployment
      • Deploy ODC
        • Deployment description
        • Modify the configuration file
        • Start deployment
        • Check after deployment
  • Migrate
    • Overview
    • Migrate data by using SQL scripts
    • Migrate data by using MySQLDump
    • Migrate data by using DataX
    • Migrate data by using OUTFILE statements

Download PDF

Overview System architecture Compatibility with MySQL Overview SQL data types Built-in functions System views Limits Quick start with OceanBase Database Usage notes Basic SQL operations (MySQL mode) Basic SQL operations (Oracle mode) Connect Python applications to OceanBase Database Connect Java applications to OceanBase Database Connect C applications to OceanBase Database Connect Python applications to OceanBase Database Connect Java applications to OceanBase Database Connect C applications to OceanBase Database Experience operational OLAP Experience parallel import and data compression Experience the multitenancy feature Overview Deployment procedure Prepare servers Configure servers Prepare installation packages HA solution for OceanBase clustersOverview Migrate data by using SQL scripts Migrate data by using MySQLDumpMigrate data by using DataX Migrate data by using OUTFILE statements
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Database
  3. SQL
  4. V4.0.0
iconOceanBase Database
SQL - V 4.0.0Enterprise Edition
SQL
KV
  • V 4.4.2
  • V 4.3.5
  • V 4.3.3
  • V 4.3.1
  • V 4.3.0
  • V 4.2.5
  • V 4.2.2
  • V 4.2.1
  • V 4.2.0
  • V 4.1.0
  • V 4.0.0
  • V 3.1.4 and earlier

Deploy OBProxy through the CLI

Last Updated:2023-07-24 09:52:12  Updated
share
What is on this page
Install OBProxy
Initialize OBProxy
Initialize the OBProxy account
Start OBProxy
OceanBase Database connection example
Adjust OBProxy parameters

folded

share

OBProxy can forward the data access requests of users to the correct OBServers. The results are returned to the clients through OBProxy. This topic describes how to install OBProxy by using the OBProxy RPM package.

Notice

  • After you deploy OBProxy on a server, OBProxy provides the proxy service of OceanBase Database by exposing a socket in the format of IP address:port. You can access OceanBase Database through the socket in the same way you access MySQL databases. We recommend that you deploy OBProxy on an OBServer.
  • We recommend that you deploy only one OBProxy on a server and use port 2883. If you deploy multiple OBProxies on the same server, you need to specify different ports and configuration file paths for differentiation. You can set the port number to 3306, 1521, or other numbers.

Install OBProxy

  1. Install the OBProxy RPM package.

    You can run the following commands to install OBProxy. $rpm_dir specifies the directory that stores the RPM package. $rpm_name specifies the name of the RPM package.

    [root@xxx /]# cd $rpm_dir
    [root@xxx $rpm_dir]# rpm -ivh $rpm_name
    

    Note

    OBProxy is installed under the /opt/taobao/install directory.

    Example:

    [root@xxx admin]# rpm -ivh obproxy-3.2.3-20220310201314.el7.x86_64.rpm
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:obproxy-3.2.3-20220310201314.el7 ################################# [100%]
    
  2. (Optional) Create a soft link to OBProxy.

    Note

    A soft link to OBProxy can hide the version information, facilitating subsequent operations.

    OBProxy is installed under the /opt/taobao/install directory. The home directory of the obproxy process is /opt/taobao/install/obproxy, which is a soft link that points to the directory of OBProxy of the corresponding version.

    [root@xxx admin]# su - admin
    -bash-4.2$ cd /opt/taobao/install
    -bash-4.2$ sudo ln -s obproxy-3.2.3 obproxy
    -bash-4.2$ ll
    total 8
    drwxr-xr-x 9 root  root  4096 Mar 22 10:24 ajdk-8.3.6-b129
    lrwxrwxrwx 1 root  root    13 Apr 28 10:25 obproxy -> obproxy-3.2.3
    drwxr-xr-x 4 admin admin 4096 Apr 27 17:56 obproxy-3.2.3
    
    -- Change the owner and group of the obproxy process to admin.
    [root@xxx install]# chown -R admin:admin obproxy
    [root@xxx install]# ll
    total 8
    drwxr-xr-x 9 root  root   4096 Mar 22 10:24 ajdk-8.3.6-b129
    lrwxrwxrwx 1 admin admin    13 Apr 28 10:25 obproxy -> obproxy-3.2.3
    drwxr-xr-x 4 admin admin  4096 Apr 27 17:56 obproxy-3.2.3
    
  3. Establish an operation log directory for the obproxy process.

    The operation log directory of the obproxy process points to /home/admin/logs/obproxy/log through a soft link.

    [root@xxx admin]# su - admin
    -bash-4.2$ mkdir -p /home/admin/logs/obproxy/log
    -bash-4.2$ for t in {log};do ln -s /opt/taobao/install/obproxy/$t /home/admin/logs/obproxy/log/$t; done
    -bash-4.2$ tree /opt/taobao/install/obproxy
    /opt/taobao/install/obproxy
    |-- bin
    |   |-- obp_xflush.py
    |   |-- obproxy
    |   |-- obproxyd.sh
    |   `-- unzip.py
    |-- log -> /home/admin/logs/obproxy/log
    |-- minidump -> /home/admin/logs/obproxy/minidump
    |-- start_obproxy.sh
    `-- tools
        |-- dump_syms
        |-- log4cplus.conf
        |-- minidump.sh
        |-- minidump_stackwalk
        `-- obproxy.sym
    
    3 directories, 11 files
    

Initialize OBProxy

Initialize the OBProxy account

OBProxy needs to communicate with the backend OBServer node. Therefore, you need to create a user (proxyro) under the sys tenant of the OceanBase cluster and specify a password for the user. When you start OBProxy later, you can specify the username and password of the proxyro user in the startup parameters.

Note

OBProxy can use the proxyro user to access the OceanBase cluster. One OceanBase cluster corresponds to one proxyro user.

Example:

Create the proxyro user and grant the SELECT privilege to the user.

$ obclient -h127.1 -uroot@sys -P2881 -p -c -A
Enter password:

obclient> CREATE USER proxyro IDENTIFIED BY '**1***';
Query OK, 0 rows affected

obclient> GRANT SELECT ON *.* TO proxyro;
Query OK, 0 rows affected

obclient> SHOW GRANTS FOR proxyro;
+----------------------------------+
| Grants for proxyro@%             |
+----------------------------------+
| GRANT SELECT ON *.* TO 'proxyro' |
+----------------------------------+
1 row in set

Start OBProxy

Notice

Start OBProxy from its home directory as the admin user. Problems may occur if you start OBProxy from other directories or as other users.

  1. When OBProxy starts, it needs to know the target OceanBase cluster, which is specified by the rootservice_list parameter.

    The following section takes a three-replica OceanBase cluster as an example.

    [root@xxx admin]# su - admin
    -bash-4.2$ cd /opt/taobao/install/obproxy && bin/obproxy -r "10.10.10.1:2881;10.10.10.2:2881;10.10.10.3:2881" -p 2883 -o "observer_sys_password=$sha1_value,enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false" -c obdemo
    

    Note

    • Replace the password in $sha1_value with the actual password. When you set the startup parameter of OBProxy, the password is the value behind sha1 instead of the original value.
    • The IP addresses in the sample code are for reference only. You need to enter the actual server IP address.

    Parameters:

    Parameter Note
    -r The IP address and port number of the OBServer.
    -p The service port number, which is usually set to 2883.
    -c The name of the cluster.
    -o The hardware or kernel parameter configuration.
  2. (Optional) If the OCP web service has been simulated, the API address can also be specified when OBProxy starts.

    -bash-4.2$ cd /opt/taobao/install/obproxy && bin/obproxy -p 2883 -c obdemo -o "obproxy_config_server_url=http://10.10.10.1:8088/services?Action=GetObProxyConfig&User_ID=alibaba-inc&uid=ocpmaster,enable_cluster_checkout=false,enable_strict_kernel_release=false,enable_metadb_used=false"
    
  3. After OBProxy starts, you can check whether the obproxy process exists.

    -bash-4.2$ ps -ef|grep obproxy
    
  4. You can kill the obproxy process to stop it.

    kill -9 `pidof obproxy`
    
  5. You do not need to specify the parameters again when OBProxy starts again because the parameters have been written into the parameter file.

    cd /opt/taobao/install/obproxy && bin/obproxy
    
  6. The operation logs of OBProxy are stored in /opt/taobao/install/obproxy/log, that is, /home/admin/logs/obproxy/log.

    [root@xxx obproxy]# ll log
    lrwxrwxrwx 1 admin admin 28 Apr 27 17:56 log -> /home/admin/logs/obproxy/log
    

OceanBase Database connection example

When you connect to OceanBase Database through OBProxy, you must combine the cluster name, instance name, and username. Valid format: Username@Tenant name#Cluster name or Cluster name:Tenant name:Username.

$ obclient -h10.10.10.1 -uroot@sys#obdemo -P2883 -p -c -A oceanbase
Enter password:

or

$ obclient -h10.10.10.1 -uobdemo:sys:root -P2883 -p -c -A oceanbase
Enter password:

Adjust OBProxy parameters

The following part shows the parameter configurations of OBProxy. You can adjust the parameter configurations to reduce the operation log volume or CPU consumption as needed.

obclient> ALTER PROXYCONFIG SET slow_proxy_process_time_threshold='1000ms';
Query OK, 0 rows affected

obclient> ALTER PROXYCONFIG SET xflush_log_level=ERROR;
Query OK, 0 rows affected

obclient> ALTER PROXYCONFIG SET syslog_level=WARN;
Query OK, 0 rows affected

obclient> ALTER PROXYCONFIG SET enable_compression_protocol=false;
Query OK, 0 rows affected

obclient> SHOW PROXYCONFIG LIKE '%compress%'\G
*************************** 1. row ***************************
         name: enable_compression_protocol
        value: False
         info: if enabled, proxy will use compression protocol with server
  need_reboot: false
visible_level: USER
*************************** 2. row ***************************
         name: enable_syslog_file_compress
        value: False
         info: Whether to enable archive log compression
  need_reboot: false
visible_level: SYS
2 rows in set

Previous topic

Deploy a three-replica OceanBase cluster
Last

Next topic

View resources available for a business tenant
Next
What is on this page
Install OBProxy
Initialize OBProxy
Initialize the OBProxy account
Start OBProxy
OceanBase Database connection example
Adjust OBProxy parameters