Updated on 2023-03-17 GMT+08:00

Adding a Connection

Perform the following steps to create a database connection.

  1. Choose File > New Connection from the main menu.

    Alternatively, click on the toolbar, or press Ctrl+N to connect to the database. The New Database Connection dialog box is displayed.

    If the preference file is damaged or the preference settings are invalid during connection creation, an error message will be displayed indicating that the preferred value is invalid and prompting you to restore the default preference settings. Click OK to complete the operation of creating a database connection.

  2. The table in the left of the dialog box lists the details of existing connections and server information.

    The server information will be displayed only after the connection succeeds.

    • You can populate connection parameters, such as Connection Name, Host, and Host Port, by double-clicking the connection name.

    If the password or key for any of the existing connections is damaged, you need to enter the password for whichever connection you use.

    • If you click , different pop-up messages based on the connection statuses of database will be displayed.
      • If the database connection is active, the Remove Connection Confirmation dialog box is displayed. Click Yes to disconnect all databases.
      • If the database connection is not active, the Remove Connection dialog box is displayed.
    • If you click without selecting a connection name, a dialog box is displayed prompting you to select at least one connection.

  3. Configure the following parameters to create a database connection.

    • Click Clear to clear all fields in the New Database Connection dialog box.
    • Press Ctrl+V to paste data in the New Database Connection dialog box. Right-click options are not available in the dialog boxes of Data Studio.

    Field Name

    Description

    Example

    Database Type

    Specifies the database type.

    -

    Connection Name

    Specifies the connection name.

    My_Connection_DB

    Host

    Specifies the host IP address (IPv4) or database domain name.

    NOTE:
    • If domain name length is greater than 25 characters, the complete domain name will not be displayed.

      For example, test1(db.dws…com:25xxx) cannot be displayed completely.

    • Once the connection is created, hover the cursor over the connection name to see the server IP and version.
    • The value of this field will be identified as an IP address if it contains only digits with three periods (.). Otherwise, it will be identified as a domain name.
    • A domain name must meet the following requirements:
      • Starts with a letter.
      • Contains only letters, digits, hyphens (-), and periods (.) and cannot contain any other special character.
      • Cannot contain spaces or tabs.
      • Contains 1 to 253 characters and a maximum of 63 characters between periods.

    db.dws.mycloud.com

    10.xx.xx.xx

    Host Port

    Specifies the port address.

    8000

    Database Name

    Specifies the database name.

    gaussdb

    User Name

    Specifies the username for connecting to the selected database.

    -

    Password

    Specifies the password for connecting to the selected database. The password is masked.

    -

    • In the Save Password drop-down list, select one of the following options:
    • The Enable SSL option is selected by default.

  4. Perform the following steps to enable SSL:

    1. Select the Enable SSL option.
    2. Click the SSL tab.

    3. Provide the files listed in SSL Certificates to use secure connections.
      • Click of Client SSL Certificate and select a client SSL certificate.
      • Click of Client SSL Key and select a client SSL key.
      • Click of Root Certificate and select a root certificate.
      • Select an SSL mode from the SSL Mode drop-down list. Refer to table below for description of different SSL modes.
        • If SSL Mode is set to verify-ca or verify-full, Root Certificate must be selected.
        • Data Studio prompts you to enter the client key upon the first access to the gs_dump feature.

        SSL Mode

        Description

        require

        The certificate will not be verified as the used SSL factory does not need to be verified.

        verify-ca

        The certificate authority (CA) will be verified using the corresponding SSL factory.

        verify-full

        The CA and database will be verified using the corresponding SSL factory.

        • You can a valid Client SSL Certificate and Client SSL Key to export DDL and data from Data Studio using secure connections.
        • If the selected Client SSL Certificate and Client SSL Key are invalid, the export will fail. For details, see Troubleshooting.
        • If you deselect Enable SSL and proceed, the Connection Security Alert dialog box is displayed. Refer to Security Disclaimer to determine whether to display this dialog box.
          • Continue: continues to use insecure connections
          • Cancel: enables SSL
          • Do not show again: The Connection Security Alert dialog box is not displayed for the subsequent connections of logged Data Studio instances.
        • For details, see the server manual.

  5. Perform the following steps to set Fast Load Options:

    1. Click the Advanced tab.

    2. When creating a connection, enter the schema names separated by commas in the Include field to load these schemas preferentially.
    3. When creating a connection, enter the schema names separated by commas in the Exclude field to avoid loading these schemas preferentially.
    4. Select either of the following options for Load Objects:
      • All objects: loads all objects
      • Objects allowed as per user privilege: loads only objects that the user has permissions for accessing. For details about the minimum permissions for accessing objects listed in Object Browser, see Table 1.

      The default value is Objects allowed as per user privilege.

    5. Enter the number of database objects that can be loaded in Load Limit. The maximum number is 30,000.
      • If the number of object types (such as tables and views) of the schema entered in Include is greater than the value of Load Limit, only the parent objects of the schema will be loaded. This indicates that child objects containing more than three parameters will not be loaded, such as columns, constraints, indexes, and functions.
      • Schema names provided in Include and Exclude are validated.
      • If you cannot access the schema specified in Include, an error message of the schema will be displayed during connection.
      • If you cannot access the schema specified in Exclude, the schema will not be loaded in Object Browser after the connection is created.

  6. Click OK.

    The status of the completed operation is displayed in the status bar.

    When Data Studio is connecting to the database, the connection status is displayed as follows:

    Once the connection is created, all schemas will be displayed in the Object Browser pane.

    • Data Studio allows you to login even if the password has expired with a message informing that some operations may not work as expected. For details, see Password Expiry.
    • To cancel the connection, see Canceling the Connection.
    • PostgreSQL schema names are not displayed in the Object Browser pane.

Canceling the Connection

Perform the following steps to cancel the connection:

  1. Click Cancel.

    The Cancel Connection dialog box is displayed.

  2. Click Yes.

    A confirmation dialog box is displayed.

  3. Click OK.

Lazy Loading

The lazy loading feature allows objects to be loaded only when you need.

When you connect to a database only child objects of the schema saved under search_path will be loaded, as shown in the following figure.

Unloaded schemas are displayed as Schema name (...).

To load child objects, expand the schema. You will see that the objects under the schema are loading.

If you try to load an unloaded object while another object is being loaded, a pop-up message is displayed indicating that another object is being loaded. The next to the unloaded object will disappear, and will be displayed again when you refresh the object or database level to load the object.

Expand a schema to load and view the child objects. You can load child objects of only one schema at a time in Object Browser.

If you modify search_path after creating a connection, the modification will take effect only after the database is reconnected. The Auto Suggest feature is applicable to keywords, data types, schema names, table names, views, and table aliases of all schema objects that you have permissions for accessing.

A maximum of 50,000 objects will be loaded in the Object Browser pane within one minute.

The database connection timeout interval defaults to 3 minutes (180 seconds). If the connection fails within this interval, a timeout error is displayed.

You can set the loginTimeout value in the Data Studio.ini file located in the Data Studio\ directory.

When you log in to Data Studio, pg_catalog is loaded automatically.