DEV Community

mmllllzcn
mmllllzcn

Posted on

GBase Database Instance Creation: A Complete Step-by-Step Walkthrough

Installing GBase Database(GBase 8s) software is only the first step. The database becomes usable after an instance is created, configured, and started.

This guide provides a practical GBase Database instance creation walkthrough for a standalone Linux environment. It covers instance initialization, automatic configuration, instance verification, database connectivity, and a simple SQL test.

Prerequisites

Before creating a GBase Database(GBase 8s) instance, make sure:

  • GBase Database software is installed.
  • The gbasedbt operating system user is available.
  • The installation directory is accessible to gbasedbt.
  • Required system dependencies are installed.
  • The server has sufficient disk space and memory.

If you have followed the standard GBase Database installation process, the initialization script will handle the required environment and instance configuration.

Step 1: Plan Your Instance Parameters

Before starting instance creation, determine the basic parameters for your server:

Instance name: gbase01
IP address: 192.168.1.100
Port: 9088
Data directory: /opt/GBASE/gbase_data
Character set: zh_CN.utf8
Enter fullscreen mode Exit fullscreen mode

The actual values should match your server, network, storage, and application requirements.

Planning these parameters first helps avoid configuration conflicts during initialization.

Step 2: Run the GBase Database Initialization Script

Switch to the gbasedbt user:

su - gbasedbt
Enter fullscreen mode Exit fullscreen mode

Then run the initialization script:

cd $GBASEDBTDIR/etc
sh GBaseInit_gbasedbt.sh
Enter fullscreen mode Exit fullscreen mode

The initialization script guides you through the GBase Database instance creation process and automatically performs the required configuration.

Depending on the installation package and selected options, the script handles items such as:

  • Instance name
  • Network address and port
  • Database locale
  • Instance configuration
  • SQLHOSTS configuration
  • Data directories
  • Database instance startup

This means you do not need to manually create the onconfig file, edit SQLHOSTS, configure every environment variable, or run a separate instance initialization command.

Once the initialization script completes successfully, the GBase Database instance is already started.

Step 3: Verify the Generated Configuration

After the initialization script finishes, verify that the required environment variables are available:

echo $GBASEDBTDIR
echo $GBASEDBTSERVER
echo $ONCONFIG
echo $GBASEDBTSQLHOSTS
Enter fullscreen mode Exit fullscreen mode

You can also inspect the generated configuration files:

cd $GBASEDBTDIR/etc
ls -l onconfig*
Enter fullscreen mode Exit fullscreen mode

Check the SQLHOSTS configuration:

cat $GBASEDBTSQLHOSTS
Enter fullscreen mode Exit fullscreen mode

The instance name, network address, and port should correspond to the values selected during the initialization process.

Step 4: Verify the GBase Database Instance

Because the initialization script has already started the instance, the next step is simply to check its status.

Run:

onstat -
Enter fullscreen mode Exit fullscreen mode

A successfully initialized GBase Database instance should report an online status.

You can also check whether the configured database port is listening:

netstat -tlnp | grep 9088
Enter fullscreen mode Exit fullscreen mode

Replace 9088 with the port configured during instance creation.

Step 5: Test Database Connectivity

Use dbaccess to verify that the database connection works:

dbaccess sysmaster -
Enter fullscreen mode Exit fullscreen mode

Run a simple SQL statement:

SELECT 1;
Enter fullscreen mode Exit fullscreen mode

If the query returns 1, the GBase Database(GBase 8s) instance is accepting database connections.

Step 6: Create a Simple Test Database

Now create a small test database and table:

CREATE DATABASE test_db;

DATABASE test_db;

CREATE TABLE test_table (
    id INT,
    name VARCHAR(50)
);

INSERT INTO test_table VALUES (1, 'GBase');

SELECT * FROM test_table;
Enter fullscreen mode Exit fullscreen mode

The result should look similar to:

id     name
1      GBase
Enter fullscreen mode Exit fullscreen mode

This simple test confirms that the GBase Database instance can create databases and tables, insert data, and execute queries successfully.

Common Issues

Port Conflict

If the selected database port is already occupied, choose another available port during instance configuration.

You can check whether a port is in use with:

netstat -tlnp | grep 9088
Enter fullscreen mode Exit fullscreen mode

Permission Errors

Make sure the gbasedbt user has the required permissions for the GBase Database installation and data directories.

For example:

chown -R gbasedbt:gbasedbt /opt/GBASE/gbase_data
Enter fullscreen mode Exit fullscreen mode

Connection Problems

If dbaccess cannot connect, check:

  • Instance status with onstat -
  • Environment variables
  • SQLHOSTS configuration
  • Server IP address and port
  • Firewall settings

Locale Problems

If applications display unexpected characters, verify that the database and client locale settings match the requirements of your application.

Final Thoughts

Creating an instance is the step that turns GBase Database(GBase 8s) from installed software into a running database system.

With the provided initialization script, the workflow is straightforward:

Plan → Run GBaseInit_gbasedbt.sh → Verify configuration → Check instance status → Test connectivity → Create a test database.

The important point is that the initialization script does more than generate configuration files. It completes the instance setup and starts the database, so there is no need to manually run another oninit -ivy command afterward.

If you are familiar with Informix, the overall workflow will look familiar. Once you understand the instance initialization process, you can standardize it for repeatable GBase Database deployments and later automate the workflow with tools such as Ansible.

Top comments (0)