DEV Community

mmllllzcn
mmllllzcn

Posted on

From dbaccess Login to Database Creation in GBase Database: A Six-Step Guide

After installing GBase Database(GBase 8s), the first task should not be connecting the application. Start with the command line.

Can you enter the database? Can you create a database? Can you verify that it exists? Can you connect to it directly?

This guide walks through six practical steps, from the first dbaccess session to application-side connection verification. Each step has a clear command and an expected result, making it easier to identify where a problem occurs.

Step 1: Enter Interactive Mode with dbaccess

Start by opening an interactive SQL session:

dbaccess - -
Enter fullscreen mode Exit fullscreen mode

The two hyphens have different purposes:

  • The first - means no database is selected at startup.
  • The second - tells dbaccess to read SQL commands from standard input.

If the session starts successfully, you should see the > prompt.

If this step fails, check the database instance status and client environment first, then inspect the connection configuration in sqlhosts.

The goal is simple: establish that the local SQL client can reach the instance before moving on.

Step 2: Create a Database with Transaction Logging

Once inside the interactive session, create a database:

CREATE DATABASE gbase8s WITH LOG;
Enter fullscreen mode Exit fullscreen mode

A successful operation returns:

Database created.
Enter fullscreen mode Exit fullscreen mode

The WITH LOG clause enables transaction logging for the new database.

For temporary test databases, logging requirements may differ. For business databases, transaction logging is generally an important part of recovery and operational planning.

In GBase Database(GBase 8s), this is a database creation decision. Adding logging to an existing database is a separate procedure.

You can also specify a storage space during database creation, but storage placement is a separate design consideration and does not need to complicate this initial verification path.

Step 3: Verify That the Database Exists

Creating a database is not the final checkpoint. Query the system catalog to confirm it:

SELECT name FROM sysdatabases;
Enter fullscreen mode Exit fullscreen mode

The sysdatabases system table lists the databases in the instance.

Check that gbase8s appears in the results.

One small detail matters: terminate the SQL statement with a semicolon.

Without it, dbaccess continues waiting for additional input, which can look like an unresponsive session.

Step 4: Check the Database Objects

Next, connect to the newly created database:

DATABASE gbase8s;
Enter fullscreen mode Exit fullscreen mode

Then query its system catalog:

SELECT tabname
FROM systables
WHERE tabid > 99;
Enter fullscreen mode Exit fullscreen mode

A newly created empty database should return zero user-defined tables. That is an expected result, not an error.

The tabid > 99 condition is commonly used to filter for user-created tables, excluding the lower-numbered system catalog entries.

This step confirms that you can inspect database objects after creation.

Step 5: Connect Directly to the Named Database

You do not need to enter interactive mode and issue a separate DATABASE statement every time.

You can connect directly to a named database:

dbaccess gbase8s
Enter fullscreen mode Exit fullscreen mode

For a remote database instance, use:

dbaccess gbase8s@gbaseserver
Enter fullscreen mode Exit fullscreen mode

Here, gbaseserver is the database server name configured for the instance.

Make sure the name matches the relevant sqlhosts entry and the DBSERVERNAME setting in onconfig.

A mismatch can produce a connection failure even when the database instance is running normally.

This is an important GBase Database connection troubleshooting detail: verify the instance name before assuming that the network is unavailable.

Step 6: Verify Connectivity from the Application Side

A successful command-line connection does not automatically guarantee that an application can connect.

Applications use their own connection configuration, so the JDBC URL needs an independent check.

For example:

jdbc:gbasedbt-sqli://192.168.8.123:9088/gbasedb:GBASEDBTSERVER=gbaseserver;
Enter fullscreen mode Exit fullscreen mode

Break the URL into four components:

Component Example Purpose
Server address 192.168.8.123 Database host
Port 9088 JDBC connection port
Database gbasedb Target database
Instance gbaseserver Database server name

Check all four values against the actual GBase Database environment.

One common source of confusion is the port number.

The command-line client uses the connection information configured in sqlhosts, while the application uses the port specified in its JDBC URL.

If these values do not point to the same service, dbaccess may work while the application connection fails.

Make the Connection Parameters Reusable

Once the connection works, put the main parameters at the beginning of your operational scripts:

INSTANCE=gbaseserver
DBNAME=gbase8s
PORT=9088
Enter fullscreen mode Exit fullscreen mode

Reference these variables throughout the script instead of repeating hardcoded values.

This makes scripts easier to maintain and reduces the risk of inconsistent connection settings across environments.

For team operations, documenting where each value comes from is just as important as recording the value itself.

GBase Database Connection Acceptance Checklist

After completing these six steps, you should be able to answer four questions:

Checkpoint Expected result
Instance connectivity dbaccess opens an interactive session
Database creation gbase8s appears in sysdatabases
Object verification systables returns the expected user objects
Application connectivity JDBC address, port, database, and instance match the environment

If all four checks pass, the basic database access path is verified.

If one fails, you have a specific layer to investigate instead of treating every failure as a generic connection problem.

Final Thoughts

Getting started with GBase Database(GBase 8s) does not require a complicated deployment script.

A structured sequence of SQL commands can verify instance access, database creation, catalog visibility, and application connectivity.

The important part is making every step reproducible and every result verifiable.

Once this basic path becomes part of your team's installation and acceptance procedure, future connection troubleshooting becomes much more straightforward.

Top comments (0)