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.2.2

    Download PDF

    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.2.2
    iconOceanBase Database
    SQL - V 4.2.2
    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

    (Optional) Deploy ODP

    Last Updated:2026-04-15 08:27:13  Updated
    share
    What is on this page
    Procedure
    Step 1: Install the ODP RPM package
    Step 2: Configure directories
    Step 3: Initialize the ODP account
    Step 4: Start ODP
    What to do next
    Connect to OceanBase Database
    (Optional) Adjust ODP parameters
    References

    folded

    share

    OceanBase Database Proxy (ODP), also known as OBProxy, is a database proxy middleware provided by OceanBase. ODP supports connection pool management, load balancing, and failovers. ODP is an optional component. You can determine whether to deploy it based on your application requirements and scenarios.

    This topic describes how to install ODP by using the ODP package.

    Notice

    • After you deploy ODP on a server, ODP provides the proxy service of OceanBase Database by exposing a socket in the IP address:port format. You can access OceanBase Database through the socket in the same way you access MySQL Database. We recommend that you deploy ODP on an OBServer node.
    • We recommend that you deploy only one ODP on a server and use port 2883. If you deploy multiple ODPs 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 port numbers.

    Procedure

    Step 1: Install the ODP RPM package

    In the following commands, $rpm_dir specifies the directory in which the RPM package is stored, and $rpm_name specifies the name of the RPM package.

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

    Note

    ODP is installed in the /opt/taobao/install directory.

    Here is an example:

    [root@xxx admin]# rpm -ivh obproxy-4.0.0-20230109154442.el7.x86_64.rpm
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:obproxy-4.0.0-20230109154442.el7 ################################# [100%]
    

    Step 2: Configure directories

    1. (Optional) Create a soft link to ODP.

      Note

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

      ODP is installed in 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 ODP of the corresponding version.

      [root@xxx admin]# su - admin
      -bash-4.2$ cd /opt/taobao/install
      -bash-4.2$ ls
      ajdk-8.3.6-b129  obproxy-4.0.0
      # Create a soft link to ODP.
      -bash-4.2$ sudo ln -s obproxy-4.0.0 obproxy
      [sudo] password for admin:
      -bash-4.2$ ll
      total 8
      drwxr-xr-x 9 root  root  4096 Sep 26 15:24 ajdk-8.3.6-b129
      lrwxrwxrwx 1 root  root    13 Jan 29 16:51 obproxy -> obproxy-4.0.0
      drwxr-xr-x 5 admin admin 4096 Jan 29 16:42 obproxy-4.0.0
      
      -- 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 Sep 26 15:24 ajdk-8.3.6-b129
      lrwxrwxrwx 1 admin admin   13 Jan 29 16:51 obproxy -> obproxy-4.0.0
      drwxr-xr-x 5 admin admin 4096 Jan 29 16:42 obproxy-4.0.0
      
    2. 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
      # Create a log directory
      -bash-4.2$ mkdir -p /home/admin/logs/obproxy/log
      # View the obproxy process directory
      -bash-4.2$ tree /opt/taobao/install/obproxy
      /opt/taobao/install/obproxy
      |-- bin
      |   |-- obp_xflush.py
      |   |-- obproxy
      |   |-- obproxyd.sh
      |   `-- unzip.py
      |-- lib
      |   |-- libgpr.so.7
      |   |-- libgrpc++.so.1
      |   |-- libgrpc++_cronet.so.1
      |   |-- libgrpc.so.7
      |   |-- libgrpc_cronet.so.7
      |   |-- libobproxy_so.so
      |   |-- libprotobuf.so.18
      |   `-- libstdc++.so.6
      |-- 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, 20 files
      

    Step 3: Initialize the ODP account

    ODP 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 ODP later, you can specify the username and password of the proxyro user in the startup parameters.

    Note

    ODP can use the proxyro user to access the OceanBase cluster. One proxyro user can be used for accessing one OceanBase cluster.

    Here is an example:

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

    $obclient -hxxx.xxx.xxx.1 -P2881 -uroot@sys -p
    Enter password:
    
    obclient [(none)]> CREATE USER proxyro IDENTIFIED BY '******';
    Query OK, 0 rows affected
    
    obclient [(none)]> GRANT SELECT ON *.* TO proxyro;
    Query OK, 0 rows affected
    
    obclient [(none)]> SHOW GRANTS FOR proxyro;
    +----------------------------------+
    | Grants for proxyro@%             |
    +----------------------------------+
    | GRANT SELECT ON *.* TO 'proxyro' |
    +----------------------------------+
    1 row in set
    

    Step 4: Start ODP

    Notice

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

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

      Here is an example:

      cd /opt/taobao/install/obproxy && bin/obproxy -r "xxx.xxx.xxx.1:2881;xxx.xxx.xxx.2:2881;xxx.xxx.xxx.3:2881" -p 2883 -o "observer_sys_password=$sha1_value,enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false" -c tenant_name
      

      Note

      • Replace the password in $sha1_value with the actual password. When you set the startup parameter of ODP, the password is the value behind sha1 instead of the original value. For example, if the password of the proxyro user is 123456, the observer_sys_password parameter must be set to 7c4a8d09ca3762af61e59520943dc26494f8941b.
      • The IP addresses in the sample code are for reference only. You need to enter the actual server IP address.

      The parameters are described in the following table:

      Parameter Description
      -r The IP address and port of the OBServer node.
      -p The service port number, which is usually set to 2883.
      -c The name of the cluster.
      -o The hardware or kernel parameter configuration.

      Here is an example:

      [root@xxx admin]# su - admin
      -bash-4.2$ cd /opt/taobao/install/obproxy && bin/obproxy -r "xxx.xxx.xxx.1:2881" -p 2883 -o "observer_sys_password=7c4a8d09ca3762af61e59520943dc26494f8941b,enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false" -c test3241
      bin/obproxy -r xxx.xxx.xxx.1:2881 -p 2883 -o observer_sys_password=7c4a8d09ca3762af61e59520943dc26494f8941b,enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false -c test3241
      rs list: xxx.xxx.xxx.1:2881
      listen port: 2883
      optstr: observer_sys_password=7c4a8d09ca3762af61e59520943dc26494f8941b,enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false
      cluster_name: test3241
      
    2. After ODP starts, you can check whether the obproxy process exists.

      ps -ef|grep obproxy
      

      Here is an example:

      [root@xxx admin]# ps -ef|grep obproxy
      admin     79111      0  6 17:32 ?        00:00:58 bin/obproxy -r xxx.xxx.xxx.1:2881 -p 2883 -o observer_sys_password=7c4a8d09ca3762af61e59520943dc26494f8941b,enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false -c test3241
      

    What to do next

    Connect to OceanBase Database

    When you connect to OceanBase Database through ODP, you must combine the username, tenant name, and cluster name. The format is Username@Tenant name#Cluster name or Cluster name:Tenant name:Username.

    Here is an example:

    • Use Username@Tenant name#Cluster name to connect to OceanBase Database.

      [admin@xxx /home/admin]
      $obclient -hxxx.xxx.xxx.1 -P2883 -uroot@sys#test3241 -p******
      Welcome to the OceanBase.  Commands end with ; or \g.
      ...
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      obclient [(none)]>
      
    • Use Cluster name:Tenant name:Username to connect to OceanBase Database.

      [admin@xxx /home/admin]
      $obclient -hxxx.xxx.xxx.1 -P2883 -utest3241:sys:root -p******
      Welcome to the OceanBase.  Commands end with ; or \g.
      ...
      Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      obclient [(none)]>
      

    (Optional) Adjust ODP parameters

    You can set parameters such as the operation log volume or CPU consumption based on the server specifications by modifying ODP parameters.

    The following example shows the parameter configurations of ODP. You can adjust the parameter configurations to decrease the operation log volume or CPU consumption.

    obclient [(none)]> ALTER PROXYCONFIG SET slow_proxy_process_time_threshold='1000ms';
    Query OK, 0 rows affected
    
    obclient [(none)]> ALTER PROXYCONFIG SET xflush_log_level=ERROR;
    Query OK, 0 rows affected
    
    obclient [(none)]> ALTER PROXYCONFIG SET syslog_level=WARN;
    Query OK, 0 rows affected
    
    obclient [(none)]> ALTER PROXYCONFIG SET enable_compression_protocol=false;
    Query OK, 0 rows affected
    
    obclient [(none)]> 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
    

    References

    • For more information about how to deploy ODP, see Deployment methods.
    • For more information about how to adjust ODP parameters, see Parameter description.
    • For more information about how to use ODP to connect to OceanBase Database, see Connection management.

    Previous topic

    Deploy a three-replica OceanBase cluster using the CLI
    Last

    Next topic

    Overview
    Next
    What is on this page
    Procedure
    Step 1: Install the ODP RPM package
    Step 2: Configure directories
    Step 3: Initialize the ODP account
    Step 4: Start ODP
    What to do next
    Connect to OceanBase Database
    (Optional) Adjust ODP parameters
    References