openGauss Typical Application Scenarios and Configurations

·

2 min read

Log Diagnosis Scenario

ODBC logs are classified into unixODBC driver manager logs and psqlODBC driver logs. The former is used to trace whether the application API is successfully executed, and the latter is used to locate problems based on DFX logs generated during underlying implementation.

The unixODBC log needs to be configured in the odbcinst.ini file:

""[ODBC]
Trace=Yes
TraceFile=/path/to/odbctrace.log

[GaussMPP]
Driver64=/usr/local/lib/psqlodbcw.so
setup=/usr/local/lib/psqlodbcw.so

You only need to add the following information to the odbc.ini file:

""[gaussdb]
Driver=GaussMPP
Servername=10.10.0.13 (database server IP address)
...
Debug=1 (Enable the debug log function of the driver.)

NOTE: The unixODBC logs are generated in the path configured by TraceFile. The psqlODBC generates the mylog_*xxx*.log file in the /tmp/ directory.

High Performance

If a large amount of data needs to be inserted, you are advised to perform the following operations:

  • You need to set UseBatchProtocol to 1 in the odbc.ini file and support_batch_bind to on in the database.

  • The ODBC program binding type must be the same as that in the database.

  • The character set of the client is the same as that of the database.

  • The transaction is committed manually.

odbc.ini configuration file:

""[gaussdb]
Driver=GaussMPP
Servername=10.10.0.13 (database server IP address)
...
UseBatchProtocol=1 (enabled by default)
ConnSettings=set client_encoding=UTF8 (Set the character code on the client to be the same as that on the server.)