This topic describes how to connect to a PostgreSQL database for a full database compatibility assessment. The target modes support OceanBase Oracle compatible mode and OceanBase MySQL compatible mode.
Version requirements
Item |
Description |
|---|---|
| Source database version | Identified by the PostgreSQL major version number (e.g., 14, 15). You can explicitly specify it using --source-major-version. |
| Target database version | oceanbase-oracle or oceanbase-mysql; --target-ob-version can be set to 3.2.4, 4.2.1, 4.2.5, 4.3.5, 4.4.2, 4.5.0, 4.5.1, or 4.6.0. |
Prerequisites
- Java Development Kit (JDK) 21 is installed, and
oceanbase-compat-engine.jaris obtained. For more information, see Install OMA. - The source database account has the necessary permissions to connect to the database specified by
--database, access the selected schema, and read object definitions and collect views: object definitions are obtained frominformation_schema,pg_catalog, and the correspondingpg_get_*functions, and dynamic information is collected from views such aspg_stat_activity. - The running machine can access the source database port
5432(or the actual port).
The actual visible information is subject to the account's permissions.
Procedure
For a full database assessment of PostgreSQL, --database must be specified. Example (target is MySQL compatible mode):
java -jar oceanbase-compat-engine.jar compat \
--mode full --task-name pg_db \
--type database --source-type postgresql \
--host 10.10.10.4 --port 5432 --database appdb \
--username oms_user --password-env OMA_DB_PASSWORD \
--schema public \
--collect-mode full \
--target oceanbase-mysql --target-ob-version 4.4.2 \
--report-lang zh --output /data/oma/reports/pg-db-mysql.html
When the target is OceanBase Oracle compatible mode, change --target oceanbase-oracle and select the corresponding --target-ob-version.
Parameters
Parameter |
Description |
|---|---|
--database |
The name of the database. This parameter is required for PostgreSQL. |
--schema |
The name of the schema. Multiple schemas can be specified. If not specified, the default scan scope is based on the source database metadata. |
--exclude-schema |
Specifies the schema to exclude. |
For collection categories and filter parameters, see Objects and metadata assessment.
Recent SQL information is read from non-idle active queries in pg_stat_activity. Due to view visibility and collection timing, this is not a complete historical workload. To assess business SQL statements individually, use Assess SQL statement compatibility.