Create a data source

更新时间:
复制 MD 格式

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.

    image

  • 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.

    image

Procedure

Method 1: Create a data source from the ODC homepage

Create an OceanBase data source

Important

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

******

  1. 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.

    image.png

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

    image.png

  3. 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.

    Note

    The system configuration item odc.connect.database.sync.block-internal-database determines 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=60000000

  4. In the pop-up window, enter a connection name and click the OK button to save the current connection configuration to the connection list.

  5. 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

Note
  • 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.

  1. 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.

    image.png

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

    image.png

  3. 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.

  4. In the pop-up window, enter a connection name and click the OK button to save the current connection configuration to the connection list.

  5. 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

  1. In the navigation pane on the left of the OceanBase Management Console , click Instance List. On the Instance List page, select the target instance.

    新建个人连接方法1-1

  2. On the Tenant Instance Workbench, click Log on to Database.

  3. Select a database account and click OK. You are redirected to ODC.

    新建个人连接方法2-3

  4. 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.