Create a YashanDB data source

Updated at:

Creating a YashanDB data source allows Dataphin to read business data from or write data to a YashanDB database. This topic describes how to create a YashanDB data source.

Background

YashanDB is a proprietary relational database. Its kernel is not based on any open-source database and is compatible with the Oracle syntax. To use a YashanDB database for data development in Dataphin, you must first create a YashanDB data source.

YashanDB data sources are primarily used for offline integration. After you create the data source, you can use the YashanDB reader component in an offline pipeline to read data from the YashanDB database, or use the YashanDB writer component to write data to the database. For more information, see Configure the YashanDB reader component and Configure the YashanDB writer component. For the full range of features supported by the YashanDB data source, see Data sources supported by Dataphin.

Permissions

Only custom global roles with the New Data Source permission and the following system roles can create data sources: Super Admin, Data Source Admin, Business Unit Architect, and Project Admin.

Procedure

  1. From the top navigation bar of the Dataphin homepage, go to Management Center > Data Source Management.

  2. On the Data Source page, click + New Data Source.

  3. On the New Data Source page, in the Relational Database section, select YashanDB.

    If you have recently used YashanDB, you can also select YashanDB in the Recently Used section. Alternatively, you can enter "Yashan" or "YashanDB" in the search box to quickly find it.

  4. On the New YashanDB Data Source page, configure the connection parameters for the data source.

    1. Configure the basic information for the data source.

      Parameter

      Description

      Data source name

      Enter a name for the data source. The name must meet the following requirements:

      • Must contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).

      • Cannot exceed 64 characters in length.

      Data source code

      The data source code must have the fixed prefix ds_, which cannot be modified. After you configure the data source code, you can use the ${data_source_code}.table or ${data_source_code}.schema.table variable format to dynamically reference the data source for the corresponding environment.

      Important
      • The data source code cannot be modified after it is configured.

      • You can preview data on the object details page in the asset directory and asset checklist only after the data source code is configured.

      • In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, SelectDB, and GaussDB data warehouse service (DWS) data sources are currently supported.

      Version

      Currently, only version 23.4 is supported.

      Data source description

      Enter a brief description for the YashanDB data source. The description must be 128 characters or fewer.

      Time zone

      Dataphin processes time-formatted data in integration tasks based on the selected time zone. The default time zone is Asia/Shanghai. Click Modify to select a different time zone. The options include:

      • GMT: GMT-12:00, GMT-11:00, GMT-10:00, GMT-09:30, GMT-09:00, GMT-08:00, GMT-07:00, GMT-06:00, GMT-05:00, GMT-04:00, GMT-03:00, GMT-02:30, GMT-02:00, GMT-01:00, GMT+00:00, GMT+01:00, GMT+02:00, GMT+03:00, GMT+03:30, GMT+04:00, GMT+04:30, GMT+05:00, GMT+05:30, GMT+05:45, GMT+06:00, GMT+06:30, GMT+07:00, GMT+08:00, GMT+08:45, GMT+09:00, GMT+09:30, GMT+10:00, GMT+10:30, GMT+11:00, GMT+12:00, GMT+12:45, GMT+13:00, GMT+14:00.

      • Daylight Saving Time: Africa/Cairo, America/Chicago, America/Denver, America/Los_Angeles, America/New_York, America/Sao_Paulo, Asia/Bangkok, Asia/Dubai, Asia/Kolkata, Asia/Shanghai, Asia/Tokyo, Atlantic/Azores, Australia/Sydney, Europe/Berlin, Europe/London, Europe/Moscow, Europe/Paris, Pacific/Auckland, Pacific/Honolulu.

      Data source configuration

      Specify whether the data source has separate production and development environments:

      • If your business data source is separated, select Production + Development Data Source.

      • If your business data source is not separated, select Production Data Source.

      Tag

      You can assign a tag to the data source for classification. For information about how to create a tag, see Manage data source tags.

    2. Configure the connection parameters between the data source and Dataphin.

      If you selected Production + Development Data Source, you must configure connection information for both. If you selected Production Data Source, you only need to configure the production data source.

      Note

      Typically, you should configure the production data source and the development data source to be different to isolate the environments and prevent development activities from affecting production. However, if your development and production environments share the same data source, you can configure them with identical parameters. This setup is suitable only when you have confirmed that environment isolation is not required, as development operations may directly affect production data.

      For Configuration Method, you can select JDBC URL or host. JDBC URL is selected by default.

      JDBC URL

      Parameter

      Description

      JDBC URL

      The format of the connection address is jdbc:yasdb://host:port/database_name, where host is the IP address of the YashanDB server, port is the port number of the YashanDB service, and database_name is the name of the database.

      Schema (Optional)

      Enter the schema associated with the username. If you leave this parameter empty, the schema with the same name as the username is used by default.

      Note

      In YashanDB, object names that are not enclosed in quotation marks are parsed as uppercase.

      Username, Password

      Enter the username and password for database authentication. To ensure that tasks run properly, make sure the user has the required data permissions.

      Host

      Parameter

      Description

      Server address

      Enter the IP address and port number of the server.

      You can click + Add to add multiple IP address and port number pairs. Click the image icon to delete extra pairs, but you must keep at least one.

      dbname

      Enter the name of the database.

      Schema (Optional)

      Enter the schema associated with the username. If you leave this parameter empty, the schema with the same name as the username is used by default.

      Username, Password

      Enter the username and password for database authentication. To ensure that tasks run properly, make sure the user has the required data permissions.

      Note

      If you select host as the configuration method and create the data source, and then later switch the configuration method to JDBC URL, the system automatically concatenates the server IP addresses and port numbers to populate the JDBC URL field.

    3. Configure advanced settings for the data source.

      Parameter

      Description

      connectTimeout

      The connection timeout, in milliseconds. Default value: 900000 ms (15 minutes).

      Note

      If your JDBC URL contains a connectTimeout parameter, the value specified in the URL takes precedence.

      socketTimeout

      The socket timeout, in milliseconds. Default value: 1800000 ms (30 minutes).

      Note

      If your JDBC URL contains a socketTimeout parameter, the value specified in the URL takes precedence.

      Connection retries

      If a connection times out, the system automatically retries the connection up to the specified limit. The connection is considered failed if all retries are unsuccessful.

      Note
      • The default number of retries for a failed database connection is 1. You can configure a value from 0 to 10.

      • The number of connection retries is applied by default to offline integration tasks and Global Quality (requires the Asset Quality module). You can configure a task-specific number of retries in offline integration tasks.

    Note

    If a parameter is specified in both the JDBC URL and advanced settings, the value in the JDBC URL takes precedence.

  5. Select a default resource group. This resource group runs tasks related to the data source, such as offline integration tasks.

  6. Click test connection or click OK to save the configuration and create the YashanDB data source.

    When you click test connection, the system checks if a connection can be established between the data source and Dataphin. If you click OK directly, the system automatically tests the connection for all selected clusters. The data source can be created even if all connection tests fail.

    Test Connection tests the connection for the Default Cluster or Registered Scheduling Clusters that have been registered in Dataphin and are in normal use. The Default Cluster is selected by default and cannot be deselected. If there are no resource groups under a Registered Scheduling Cluster, connection testing is not supported. You need to create a resource group first before testing the connection.

    • The selected clusters are used only to test network connectivity and are not used for running tasks.

    • The test connection usually completes within 2 minutes. If it times out, click the image icon to view the reason and retry.

    • Regardless of the test result (Connection Failed, Connection Successful, or Succeeded With Warning), the system records the timestamp of the final result.

      Note

      Only the test results for the Default Cluster include three connection statuses: Succeeded With Warning, Connection Successful, and Connection Failed. The test results for Registered Scheduling Clusters in Dataphin only include two connection statuses: Connection Successful and Connection Failed.

    • When the test result is Connection Failed, click the image icon to view the failure reason.

    • When the test result is Succeeded With Warning, the application cluster connection succeeded but the scheduling cluster connection failed. The data source cannot be used for data development and integration. Click the image icon to view the log information.