Help Center/ GaussDB/ Getting Started/ Buying a GaussDB Instance and Connecting to It Through the DAS Console(Recommended)
Updated on 2024-09-13 GMT+08:00

Buying a GaussDB Instance and Connecting to It Through the DAS Console (Recommended)

Data Admin Service (DAS) enables you to manage instances on a web-based console, simplifying database management and improving working efficiency. You can connect to and manage instances through DAS.

This section describes how to use DAS to connect to a GaussDB instance you have bought on the GaussDB management console. For more methods of connecting to an instance, see Connecting to a GaussDB Instance.

Buying an Instance

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB.
  4. On the Instances page, click Buy DB Instance.
  5. On the displayed page, set Billing Mode, enter DB Instance Name, select Edition Type, DB Engine Version, DB Instance Type, and Deployment Model, and complete other configurations.

    • Billing Mode: Pay-per-use
    • Region and Project: Retain the default settings.
    • DB Instance Name: Enter a name that is easy to identify.
    • Edition Type: Enterprise edition
    • DB Engine Version: 8.103
    • DB Instance Type: Primary/Standby
    • Deployment Model: 1 primary + 2 standby
    • AZ: AZ1
    • Time Zone: Retain the default value.
    Figure 1 Billing mode and basic information

  6. Configure instance specifications.

    • Instance Specifications: Dedicated(1:4) and 4 vCPUs | 16 GB
    • Storage Type: Ultra-high I/O
    • Storage Space: 40 GB
    • Disk Encryption: Disable
    Figure 2 Specifications and storage

  7. Retain the default settings for the network information.

    Figure 3 Network configuration

  8. Configure the instance password and enterprise project.

    • Administrator Password: Set a strong password to improve security.
    • Confirm Password: Enter the administrator password again.
    • Enterprise Project: default
    • Retain the default values for other parameters.
    Figure 4 Database configuration

  9. Click Next, confirm the instance information, and click Submit.
  10. Go to the instance list.

    If status of the instance becomes Available, the instance has been created.

Logging In to a GaussDB Instance Through DAS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB.
  4. On the Instances page, locate the DB instance you want to log in to and click Log In in the Operation column.

    Alternatively, click the DB instance name on the Instances page. On the displayed Basic Information page, click Log In in the upper right corner of the page.

  5. On the Custom Login page, select the node to be logged in to. Enter the correct database username and password, and click Test Connection. After the connection test is successful, click Log In.

    • Login Username: root
    • Database Name: postgres
    • Password: Enter the password of the root user. It is the administrator password you set when you buy an instance.
    • Show Executed SQL Statements: Enable it.
    Figure 5 Login page

Getting Started with SQL

After logging in to an instance, you can create database users, databases, and tables through DAS.

  1. Create a database user.

    Only administrators that are created during the instance installation can access the initial database by default. You can also create other database users.

    CREATE USER joe WITH PASSWORD "xxxxxxxxx";

    If information similar to the following is displayed, the creation is successful.

    Figure 6 Creating a database user

    In this case, you have created a user named joe, and the user password is xxxxxxx.

    For more information about database users, see Users and Permissions.

  2. Create a database.

    CREATE DATABASE db_tpcds;

    If information similar to the following is displayed, the creation is successful.

    Figure 7 Creating a database

    Switch to the newly created database in the upper left corner.

    Figure 8 Switching to the new database

  3. Create a table.

    • Run the following command to create a schema:

      CREATE SCHEMA myschema;

    • Create a table named mytable that has only one column. The column name is firstcol and the column type is integer.

      CREATE TABLE myschema.mytable (firstcol int);

    • Insert data to the table.

      INSERT INTO myschema.mytable values (100);

    • View data in the table.

      SELECT * FROM myschema.mytable;

    Note:

    • By default, new database objects, such as the mytable table, are created in the $user schema. For more information about schemas, see Creating and Managing Schemas.
    • For details about how to create a table, see Creating and Managing Tables.
    • In addition to the created tables, a database contains many system catalogs. These system catalogs contain information about instance installation as well as the queries and processes running in GaussDB. You can collect information about the database by querying the system catalogs. For details about querying system catalogs, see Querying a System Catalog.

  4. In the db_tpcds database, run the following statement as user root to grant all permissions of the db_tpcds database to user joe:

    GRANT ALL ON DATABASE db_tpcds TO joe;

    GRANT USAGE ON schema myschema TO joe;

    GRANT ALL ON TABLE myschema.mytable TO joe;

  5. Log in to the db_tpcds database as user joe.

  6. After login, insert data into the table and verify the data.

    INSERT INTO myschema.mytable values (200);

    SELECT * FROM myschema.mytable;

    Figure 9 Inserting and verifying data

Follow-up Operations

After logging in to the instance, you can create alarm rules, set automated backup policies, create databases, and migrate data. For details, see: