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 Connector/ODBC

V2.0.9
  • Overview
  • Driver installation and configuration
    • Prepare for the installation
    • Install and configure the ODBC driver for Linux
    • Install and configure OceanBase Connector/ODBC for Windows
  • User guide
    • Basic operations
    • Enable logging
    • Get REF CURSOR data type
    • Scalar function escape
    • Call Function
  • Reference information
    • API functions in OceanBase Connector/ODBC
    • Data types in OceanBase Connector/ODBC
    • Error codes in OceanBase Connector/ODBC
  • FAQ
    • Query timeout
    • Chinese garbled characters
    • Common OceanBase ODBC installation and configuration issues and solutions
  • 600.version-release-records
    • 9900.V2.0
      • OceanBase Connector/ODBC V2.0.9
      • OceanBase Connector/ODBC V2.0.8
      • OceanBase Connector/ODBC V2.0.7
      • OceanBase Connector/ODBC V2.0.6

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Connector/ODBC
  3. V2.0.9

Enable logging

Last Updated:2026-09-04 08:24:40

Enable logging in Linux
Enable logging in Windows

OceanBase Connector/ODBC supports logging. This topic describes how to enable logging in Windows and Linux.

Enable logging in Linux

You can add the OPTION=4 setting to the odbc.ini configuration file to enable logging. Logs are stored in the /tmp/obodbc.log directory by default. You can also run the following commands to respectively enable and disable logging. The commands are prior to the setting in the odbc.ini configuration file. If you do not run the following commands, the setting in the driver manager is used.

export ODBC_LOG_ENABLE=true
export ODBC_LOG_ENABLE=false

After logging is enabled, run the following command to set a log path.

export ODBC_LOG_DIR=/home

Then add the following information to the odbcinst.ini configuration file for data source name (DSN) logging.

[ODBC]
Trace=YES
TraceFile=/odbc.log

Enable logging in Windows

When you add a DSN on the ODBC Data Source Administrator page, select Debug in the Cursor/Results section to enable logging. The obodbc.log file is stored in a temporary directory by default.

win-log1.png

You can also set the ODBC_LOG_ENABLE environment variable to enable or disable logging. This environment variable is prior to the setting in the driver manager. If it is not specified, the setting in the driver manager is used.

ODBC_LOG_ENABLE=true
ODBC_LOG_ENABLE=false

After you enable logging by setting the environment variable, set ODBC_LOG_DIR to specify a log path.

ODBC_LOG_DIR=/home

Then configure DSN logging, enable tracing, and set a file path on the ODBC Data Source Administrator page.

win-log2.png

Previous topic

Basic operations
Last

Next topic

Get REF CURSOR data type
Next
on this page
Enable logging in Linux
Enable logging in Windows