Using DAS to Connect to a Cluster
GaussDB(DWS) supports page login (WebSQL). This function depends on Data Admin Service (DAS). Currently, database management, SQL operations, and operation audit are supported. To connect to a cluster in this way, you need to enter the database username and password. You can view metadata and run SQL statements after connection.
- The cluster login feature is supported only in cluster version 8.0.1 and later. The agent version must be 8.1.3.101 or later.
- After the agent of a cluster is upgraded from an earlier version to 8.1.3.101 or later, perform the operations described in Enabling the Login Function first. Then you can perform operations in Logging In.
- Supported regions: Huawei Cloud regions where DAS is available
- If your cluster is in arrears, this function may be unavailable. Please top up your account in time.
Enabling the Login Function
- Log in to the GaussDB(DWS) management console.
- In the navigation pane on the left, choose Clusters.
- In the cluster list, click Log In in the Operation column of a cluster.

- If the login function is not enabled, the Enable Login dialog box is displayed. Click Enable and click Enable Now.


CN processes will be restarted, and services will be interrupted for about 60 seconds. You are advised to perform this operation in a proper time window.
Logging In
- Log in to the GaussDB(DWS) management console.
- In the navigation pane on the left, choose Clusters.
- In the cluster list, click Login in the Operation column of a cluster.

- After you are redirected to the DAS page, enter the login username, database name, and password, and enable the scheduled collection and SQL execution history functions.
- You are advised to enable Collect Metadata Periodically. If it is disabled, DAS obtains only the structured data from databases in real time, and the performance of databases is affected.
The collection time cannot be customized. Once Collect Metadata Periodically is enabled, DAS automatically collects metadata at 20:00 every day (UTC time). If you are not using a UTC time, convert the time according to your local time zone. You can also click Collect Now to collect metadata at any time you want.
- You are advised to enable Show Executed SQL Statements. With it enabled, you can view the executed SQL statements under SQL Operations > SQL History and execute them again without entering the SQL statements.
Note: SQL statements that contain sensitive keywords are not recorded. Sensitive keywords include (case insensitive): "create user", "password", "grant", "revoke", "create login", "sp_addrole", "sp_droprole", "sp_addlogin", "sp_grantdbaccess", "sp_addrolemember", "sp_revokedbaccess", "sp_password","sp_droplogin", "create role", "dblink_connect", "gs_encrypt_aes128", "gs_decrypt_aes128", "gs_encrypt", "gs_decrypt", "gs_hash", "gs_extend_library", "exec_on_extension", "exec_hadoop_sql", "secret_access_key", "dli_secret_access_key","filepath", "username", "digest", "hmac", "crypt", "pgp_sym_encrypt", "pgp_sym_encrypt_bytea", "pgp_sym_decrypt", "pgp_sym_decrypt_bytea", "pgp_pub_encrypt", "pgp_pub_encrypt_bytea", "pgp_pub_decrypt", "pgp_pub_decrypt_bytea", "pgp_key_id", "encrypt", "decrypt", "encrypt_iv", "decrypt_iv"
- You are advised to enable Collect Metadata Periodically. If it is disabled, DAS obtains only the structured data from databases in real time, and the performance of databases is affected.
- Click Test Connection. If a message is displayed indicating connection successful, continue with the operation. If a message is displayed indicating connection failed and the failure cause is provided, make modifications based on the error message.
- Click Log In. The database page will be displayed.

Operation Audit
- Log in to the GaussDB(DWS) management console.
- In the navigation pane on the left, choose Clusters.
- In the cluster list, click Log In in the Operation column of a cluster.

- Switch to the DAS page and log in. For details, see Logging In.
- Choose Operation Audit form the navigation pane. Check the login, logout, creation, deletion, and query records on DAS. These records include the Huawei username for logging in to the DAS, function modules, operation content, database names, cluster information, login database names, operation time, and execution status.

Exporting Audit Records
The export function allows you to filter data in the audit list and export it to a CSV file in asynchronous mode. That is, you need to save the file to OBS and then download it to a local PC.
- Open the Operation Audit page. For details, see Operation Audit. Click Export in the upper right corner to add an asynchronous export task.

- Click View Export History in the upper right corner of the list to view the asynchronous export progress. Wait until the task is complete.

- In the View Export History dialog box, locate the row that contains the target task and click Download in the Operation column to download the CSV file to the local PC.

Deleting Export Records
- Open the Operation Audit page. For details, see Operation Audit.
- Click View Export History in the upper right corner of the list.

- Select export tasks and click Delete Task in the upper right corner of the list. You can determine whether to delete files in the OBS bucket at the same time.

Last Article: Obtaining the Cluster Connection Address
Next Article: Using the Data Studio GUI Client to Connect to a Cluster
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.