ODC supports connecting to tenants in Oracle compatible mode of OceanBase Cloud. This topic describes the prerequisites and procedure for this connection method.
Prerequisites
You have installed the desktop version of OceanBase Developer Center (ODC). For instructions, see Install desktop ODC.
You have obtained the connection string of the target tenant in Oracle compatible mode from the OceanBase Cloud instance. For instructions, see Get a connection string.
Procedure
Open the desktop version of ODC. Next to the search box at the top left of the Data Sources panel, click + > OB Cloud Oracle.
In the Create Data Source panel, enter or select the following information based on the connection string obtained in the Prerequisites section.
ItemDescriptionSmart Parsing (Optional) You can paste the connection string into the smart parsing text box. ODC automatically identifies it and fills in the connection information fields. Connection Address - Host IP/Domain Name: The IP address or domain name of the server where the database to be connected is located.
- Port: The port number of the server where the database to be connected is located.
Database Account - Database Username: An account created in the tenant. (In MySQL-compatible mode, this account must have permission to access the default database.)
- Database Password: The password of the account created in the tenant. Click Test Connection to test whether you can connect to the target database.
Note
- If the configuration information is incorrect, an error message will appear, such as incorrect username/password or network exception.
- You can only connect to databases within the current tenant. Otherwise, a test failure error will be reported.
- Before saving, you can click Test Connection to test the database connection. If the database username and password are correct, Connection Successful is displayed. In ODC V4.0.0 and later, you can save the connection without entering the account and password.
Environment Select the environment type as needed, such as Development, Test, or Production. Advanced Settings - sys Tenant Account: Choose whether to Query Tenant Views Using sys Tenant Account. If selected, enter the Account and Password.
For a physical database, enter an account with permission to query sys tenant views and its password. This field is automatically populated when Tenant in Connection Address is specified as sys.- Account: An account with permission to query views in the sys tenant.
- Password: The password corresponding to the account.
- SSL: Choose whether to enable SSL encryption for the SSL link to ensure secure data transmission between the client and server.
Before enabling SSL in ODC, confirm that SSL is enabled on the OBServer side; if connecting via OBProxy, also ensure SSL is enabled for OBProxy. To enable SSL on the server side, see OBServer Transmission Encryption. - Connection Initialization Script: Supports configuring the connection session through SQL statements. Example:
set session ob_query_timeout=60000000 - Driver Properties: Supports configuring driver properties to connect to OceanBase Database and implement specific features.
Note
- In ODC V2.3.0 and later, the import/export feature requires setting the root@sys user in the advanced configuration during connection creation.
- In ODC V2.4.1 and later, the import/export feature's view information query no longer strongly relies on the root@sys account (if the root@sys account is not configured, some ODC objects like stored procedures and functions do not support the export feature; if the root@sys account is configured, accessing view information in the sys tenant provides the optimal data routing strategy, which can improve export speed).
- The sys tenant account and password are those of a user under the cluster tenant (do not fill in "@sys#cluster" for the account). For example: the account is root.
- Users created via the non-encrypted method (require none) by default can choose whether to enable SSL as needed. If you select Enable SSL, an SSL connection is created; if not selected, a regular connection is created.
- For users created via the SSL connection method (require ssl), selecting Enable SSL creates an SSL connection; if not selected, the connection fails.
Users created via require ssl do not need to upload a certificate but must select Enable SSL; otherwise, the connection fails. It is recommended to upload a certificate to verify the identities of both communicating parties (not mandatory):- Upload a CA certificate, and the client verifies the server's identity;
- Upload the client key and client certificate, and the server verifies the client's identity.
- Users created via the X509 encryption method (require x509) must Enable SSL and upload the CA certificate as well as the client key and client certificate. Both the client and server verify each other's identities; not selecting Enable SSL or not uploading the certificates prevents successful connection creation.
Click the OK button in the lower-right corner of the panel, and enter a custom data source name in the dialog box to complete the data source creation.
Note
Before saving, you can click Test Connection to test the database connection. If the database username and password are correct, Connection Successful is prompted.