Help Center> GaussDB(DWS)> Management Guide> Cluster Connection> Using DAS to Connect to a Cluster
Updated on 2024-03-14 GMT+08:00

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.

  • Only cluster 8.0.1 and later versions support the cluster login function. The hybrid data warehouse (standalone) does not support this function.
  • By default, only Huawei Cloud accounts or users with DWS Administrator permissions can log in to clusters. IAM users in the account do not have the permission by default. An IAM user needs to be authorized by a user who has the permission.
  • 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

  1. Log in to the GaussDB(DWS) management console.
  2. In the navigation pane on the left, choose Cluster > Dedicated Cluster.
  3. In the cluster list, click Log In in the Operation column of a cluster.
  4. 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

  1. Log in to the GaussDB(DWS) management console.
  2. In the navigation pane on the left, choose Cluster > Dedicated Cluster.
  3. In the cluster list, click Login in the Operation column of a cluster.
  4. 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" and "decrypt_iv".

  5. 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.
  6. Click Log In. The database page will be displayed.

Operation Audit

  1. Log in to the GaussDB(DWS) management console.
  2. In the navigation pane on the left, choose Cluster > Dedicated Cluster.
  3. In the cluster list, click Log In in the Operation column of a cluster.
  4. Switch to the DAS page and log in. For details, see Logging In.
  5. 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.

  1. Open the Operation Audit page. For details, see Operation Audit. Click Export in the upper right corner to add an asynchronous export task.

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

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

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

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