In-Depth Analysis of GBase 8s Operating Modes and Switching Mechanisms

Published on 2026-05-26

GBase 8s, as an enterprise-grade relational database management system, determines the type of tasks the database can perform and the services it offers through its operating modes. The system supports four primary operating modes and three transitional states, with flexible switching between modes to meet different operational scenarios.

1. Four Primary Operating Modes

1) Offline Mode
In offline mode, the database server is not running, and shared memory is not initialized. No database operations can be performed; administrative commands will return "shared memory not initialized," and SQL operations will return error 908. This mode is suitable for hardware maintenance or scenarios where the database must be completely shut down.

2) Online Mode
Online mode is the standard production running state. All authorized users can connect normally and perform all functions, including SQL queries, DML operations, database object management, backup and recovery, and performance monitoring. When checking status with onstat -, the output includes the "On-Line" indicator. This mode is the default state for daily operation.

3) Single-User Mode
Single-user mode allows only administrative users (gbasedbt or users with DBSA privileges) to connect to the database. Ordinary user connections are rejected with error code 27010:
27010: Only an administrative user can connect in administrative user mode.
In this mode, administrators can execute SQL statements for database maintenance while ensuring no interference from other user sessions, making it ideal for exclusive SQL maintenance tasks.

4) Quiescent Mode
Quiescent mode does not allow any user to connect through the SQL interface. Connection requests return error code 27002:
27002: No connections are allowed in quiescent mode.
This mode only supports low-level maintenance operations via command-line tools, such as onspaces (storage space management), ontape (physical backup), and onparams (parameter adjustment). It is suitable for scenarios requiring low-level database operations with zero user connections.

2. Mode Switching Commands

2.1 Starting from Offline Mode
When the database is offline, use the oninit command to start in the desired mode:
oninit → Start in online mode
oninit -j → Start in single-user mode
oninit -s → Start in quiescent mode
oninit -ivy → First-time start, initialize disk then enter online mode

2.2 Switching from Online Mode
When the database is already running, use the onmode command to switch to other modes:
onmode -m → Switch to online mode
onmode -j → Switch to single-user mode
onmode -s/u → Switch to quiescent mode
onmode -k → Shut down the database, entering offline mode

The difference between onmode -s and onmode -u: -s waits for current active transactions to complete before switching, without affecting ongoing operations of existing sessions; -u immediately terminates all user threads and switches to quiescent mode, suitable for scenarios requiring quick entry into a maintenance window.

3. Typical Application Scenarios

Scenario 1: SQL-level maintenance requiring isolation of ordinary users

  • Recommended mode: Single-User Mode

  • Operation path: onmode -j → Execute maintenance SQL → onmode -m

  • Note: After switching, only the administrator can connect. Restoring online mode after maintenance minimizes business impact.

Scenario 2: Physical backup or storage space modification

  • Recommended mode: Quiescent Mode

  • Operation path: onmode -s → Execute ontape / onspaces → onmode -m

  • Note: Quiescent mode ensures no SQL sessions interfere with low-level storage operations, maintaining data consistency.

4. Mode Switching Matrix

The table below lists the switching commands between modes; rows indicate the current mode and columns indicate the target mode:

Core Principles:

  • Use Online Mode for daily operations

  • Use Single-User Mode for SQL-level maintenance

  • Use Quiescent Mode for low-level operations

  • Use Offline Mode for complete shutdown

It is important to note that among the four operating modes, only online mode does not impact business operations. The other three modes cause varying degrees of service interruption: single-user mode blocks ordinary user connections, quiescent mode blocks all user connections, and offline mode completely stops database services. Therefore, before any mode switch, always assess the business impact, coordinate with relevant stakeholders in advance, and schedule a proper maintenance window.