Create an Amazon RDS for DB2 data source to allow Dataphin to read data from or write data to Amazon RDS for DB2.
Permissions
Only custom global roles with the Create Data Source permission and the super administrator, database permission, domain architect, and project administrator system roles can create data sources.
Procedure
-
On the Dataphin homepage, choose Management Hub > Datasource Management from the top navigation bar.
-
On the Datasource page, click +Create Data Source.
-
On the Create Data Source page, select Amazon RDS for DB2 in the Relational Database section.
If you have recently used Amazon RDS for DB2, you can also select Amazon RDS for DB2 in the Recently Used section. You can also enter keywords for Amazon RDS for DB2 in the search box to quickly search for it.
-
On the Create Amazon RDS For DB2 Data Source page, configure the parameters for connecting to the data source.
-
Configure the basic information of the data source.
Parameter
Description
Datasource Name
The name must meet the following requirements:
-
The name can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).
-
The name cannot exceed 64 characters in length.
Datasource Code
After you configure the data source code, you can reference tables in the data source in a Flink_SQL task by using the
data source code.table nameordata source code.schema.table nameformat. If you need to automatically access the data source in the corresponding environment based on the current environment, access the data source by using the variable format${data source code}.tableor${data source code}.schema.table. For more information, see Dataphin data source table development method.ImportantThe 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.
Data Source Description
A brief description of the data source. Maximum length: 128 characters.
Data Source Configuration
Select the data source configuration:
-
If the business data source distinguishes between production and development data sources, select Production + Development Data Source.
-
If the business data source does not distinguish between production and development data sources, select Production Data Source.
Tag
You can categorize and label data sources based on tags. For information about how to create tags, see Manage data source tags.
-
-
Configure the parameters for connecting the data source to Dataphin.
If you select Production + Development Data Source for Data Source Configuration, configure the connection information for both the production and development data sources. If you select Production Data Source, configure only the production data source connection.Production data source
NoteIn most cases, configure different data sources for the production and development environments to isolate them and reduce mutual impact. However, Dataphin also supports using the same data source with identical parameter values for both environments.
You can select Configuration Method as either JDBC URL or Host. The default selection is JDBC URL.
JDBC URL configuration method
Parameter
Description
JDBC URL
The format of the connection address is
jdbc:db2://host:port/dbname:currentSchema=schema;.Username, Password
The username and password for authentication. Ensure the user has the required data permissions so that tasks run properly.
Host configuration method
-
Host configuration method
Parameter
Description
Server Address
The IP address and port number of the server.
Click +Add to add more entries, or click the
icon to remove an entry. At least one entry must be retained.dbname
The database name.
Schema
The schema name.
-
Parameter configuration
Parameter
Description
Parameter
-
Parameter name: Supports selecting an existing parameter name or entering a custom parameter name.
Custom parameter names can only contain uppercase and lowercase letters, digits, periods (.), underscores (_), and hyphens (-).
-
Parameter value: When a parameter name is selected, the parameter value is required. It can only contain uppercase and lowercase letters, digits, periods (.), underscores (_), and hyphens (-), and cannot exceed 256 characters in length.
NoteClick +Add Parameter to add more parameters, or click the
icon to remove a parameter. You can add up to 30 parameters.Username, Password
The username and password for authentication. Ensure the user has the required data permissions so that tasks run properly.
-
NoteIf you switch from the Host configuration method to JDBC URL after creating the data source, the system automatically concatenates the server IP address and port number into a JDBC URL.
-
-
Configure advanced settings for the data source.
Parameter
Description
connectionTimeout
The connection timeout duration in seconds. Default: 900 seconds (15 minutes).
Note-
If you configure a connectTimeout in the JDBC URL, that value takes precedence.
-
For data sources created before Dataphin V3.11, the default connectTimeout is
-1, which means no timeout limit.
Connection Retries
The number of automatic retry attempts when a database connection times out. If all retries fail, the connection is considered unsuccessful.
Note-
The default number of retries is 1. You can configure a value between 0 and 10.
-
The retry count applies by default to offline integration tasks and global quality (requires the Asset Quality module). In offline integration tasks, you can configure task-level retry counts separately.
NoteRules for duplicate parameters:
-
If a parameter exists in the JDBC URL, Advanced Settings parameters, and Host Configuration method's parameter configuration, the value in the JDBC URL takes precedence.
-
If a parameter exists in both the JDBC URL and Advanced Settings parameters, the value in the JDBC URL takes precedence.
-
If a parameter exists in both the Advanced Settings parameters and Host Configuration method's parameter configuration, the value in the Advanced Settings parameter configuration takes precedence.
-
-
-
Select a Default Resource Group. This resource group is used to run tasks related to the current data source, including database SQL, offline database migration, data preview, and more.
-
Perform a Test Connection or directly click OK to save and complete the creation of the Amazon RDS for DB2 data source.
Click Test Connection to verify connectivity with Dataphin. If you click OK directly, the system tests the connection for all selected clusters automatically. The data source can still be created even if all cluster connections 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 only used to test network connectivity with the current data source and are not used for running related tasks later.
The test connection usually takes less than 2 minutes. If it times out, you can click the
icon to view the specific reason and retry.Regardless of whether the test result is Connection Failed, Connection Successful, or Succeeded With Warning, the system will record the generation time of the final result.
NoteOnly 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, you can click the
icon to view the specific failure reason.When the test result is Succeeded With Warning, it means that the application cluster connection is successful but the scheduling cluster connection failed. The current data source cannot be used for data development and integration. You can click the
icon to view the log information.