Overview
You can create a data source in OceanBase Developer Center (ODC) in the following ways:
From the ODC homepage: On the ODC homepage, click the New Data Source button to create a data source.

From a public cloud instance: In a public cloud instance, click Log on to Database and enter the username. You are redirected to ODC. After you enter the password, a data source is automatically created with a name based on the instance and username.

Procedure
Method 1: Create a data source from the ODC homepage
Create an OceanBase data source
When a new user with the AdministratorAccess or AliyunOceanBaseFullAccess permission logs on to ODC for the first time, the user is automatically granted the system_admin role.
A user who subsequently logs on to ODC is not automatically granted the system_admin role. You must grant the system_admin role to the user from within ODC.
By default, the system_admin role is granted to the Alibaba Cloud account.
When you log on with a Normandy account, only administrators can log on to ODC and use the personal space.
Example: Create an OceanBase MySQL data source named obmysql4.3.0 in ODC and attach the data source to the odc_4.2.0 project.
Item |
Example value |
Project name |
odc_4.2.0 |
Data source name |
obmysql4.2.0 |
Cluster name |
odctest |
Tenant name |
mysql |
Database username |
odctest |
Database password |
****** |
In the navigation pane on the left of the OceanBase Management Console, click the Data Development button to log on to the web-based ODC.

After you log on to ODC, click Data Source > New Data Source > OceanBase MySQL.

In the New Data Source window, fill in the following information:
Item
Description
Connection address
Select a database instance. It can be a cluster instance or a tenant instance.
Database account
Database username: The account created in the tenant. In MySQL mode, this account must have permissions to access the default database.
Database password: The password for the account created in the tenant. Click the Test Connection button next to the database password field to test the connection to the destination database.
Environment
Select an environment type as needed, such as development, testing, or production.
Project
You can attach the created data source to a specific project or leave it unattached. After a data source is attached to a project, databases that you create are automatically moved to the project.
NoteThe system configuration item
odc.connect.database.sync.block-internal-databasedetermines whether to automatically synchronize the built-in databases of the database system to the project. The default value of this configuration item is true, which indicates that built-in databases are not automatically transferred to the attached project. ODC detects the following built-in databases of the database system:OceanBase Oracle: SYS.
OceanBase MySQL: information_schema, mysql, test, and oceanbase.
Advanced Settings
Connection initialization script: Configure the connection session using SQL statements. Example:
set session ob_query_timeout=60000000In the pop-up window, enter a connection name and click the OK button to save the current connection configuration to the connection list.
After the data source is created, you can view it in the connection list the next time you log on to ODC. A successful connection test is not required to save the connection configuration.
Create an Object Storage Service data source
Object Storage Service data sources created in ODC support only data archiving tasks.
ODC V4.3.3 and later versions support the following types of Object Storage Service (OSS) data sources: Alibaba Cloud OSS, Tencent Cloud COS, Huawei Cloud OBS, and AWS S3.
Example: Create an Alibaba Cloud OSS data source in ODC.
In the navigation pane on the left of the OceanBase Management Console, click the Data Development button to log on to the web-based ODC.

After you log on to ODC, click Data Source > New Data Source > Alibaba Cloud OSS.

In the New Data Source window, fill in the following information:
Item
Description
File URL
The path to access the object file. For example,
oss://odc-sample/bucketname.Region
The specific geographic location where the data is stored.
AccessKey pair
The AccessKey ID and AccessKey secret of the OSS user.
Environment
Select an environment type as needed, such as development, testing, or production.
Project
You can attach the created data source to a specific project or leave it unattached. After a data source is attached to a project, databases that you create are automatically moved to the project.
In the pop-up window, enter a connection name and click the OK button to save the current connection configuration to the connection list.
After the data source is created, you can view it in the connection list the next time you log on to ODC. A successful connection test is not required to save the connection configuration.
Method 2: Create a data source from a public cloud instance
In the navigation pane on the left of the OceanBase Management Console , click Instance List. On the Instance List page, select the target instance.

On the Tenant Instance Workbench, click Log on to Database.
Select a database account and click OK. You are redirected to ODC.

Enter the password for the database account and click OK. A data source is automatically created with a name based on the current instance and username.

