Understanding the Altibase Start/Shut down Process#
Overview#
This document describes how Altibase starts up (STARTUP) and shuts down (STOP). For each process, it describes step by step the operations performed by the Altibase internal modules and the tasks that users can perform.
※ The examples in this document were run on Altibase 7.1, and the output may differ depending on the Altibase version.
Info
For errors and improvements related to this document, please contact the technical support portal or technical support center.
- Technical support portal: http://support.altibase.com/en
- Technical support center: +82-2-2082-1114
Info
This document is provided for informational purposes only and is subject to change without prior notice. It may contain errors, and Altibase makes no express or implied warranties of any kind, including but not limited to warranties of merchantability or fitness for a particular purpose.
The development, release, and timing of any features or functionality described for Altibase products in this document are at the sole discretion of Altibase.
Altibase may hold patents, trademarks, copyrights, or other intellectual property rights related to the contents of this document.
Starting Altibase#
Altibase divides the startup process into four stages: PROCESS, CONTROL, META and SERVICE.
This chapter describes the state of each stage, the operations performed internally when transitioning to each stage, and the tasks that users can perform in each stage.
Startup Overview#
If the DB startup process consisted of a single step, the DB would start with one command. The tasks that can be done before and after the server starts would then be strictly separated, and the DBA could not perform tasks distinct from those of general clients. This would limit meta migration and recovery.
To solve this problem, Altibase divides the DB startup process into four stages: PROCESS, CONTROL, META and SERVICE. In each stage, the DBA can perform tasks such as creating a DB, upgrading the meta and selective recovery.
The STARTUP command is used to transition to each stage, and it can be used after connecting to iSQL with the SYSDBA privilege. Transitioning to the next stage is possible, but returning to a previous stage is not supported.
In the figure above, the arrows show the state transitions and the colors show the state of each stage. Users can perform the functions provided in each stage.
The following sections describe, stage by stage, the operations performed inside Altibase and the tasks that users can perform.
PROCESS Stage#
PROCESS Stage Transition Command#
The PROCESS stage is the first stage of Altibase startup, and it is reached with the STARTUP PROCESS command.
$ isql -u sys -p manager -sysdba
-----------------------------------------------------------------
Altibase Client Query utility.
Release Version 7.3.0.1.3
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
Connected to idle instance.
iSQL(sysdba)> STARTUP PROCESS;
Connecting to the DB server..... Connected.
TRANSITION TO PHASE : PROCESS
Command executed successfully.
In the PROCESS stage, each module (Storage Manager, Query Processor, Communication Manager, etc.) is initialized, and the Altibase process is started so that the server and iSQL can communicate. The DB cannot be accessed in this stage.
Internal Operations: Initial → PROCESS Stage#
Altibase records the startup process in the $ALTIBASE_HOME/trc/altibase_boot.log file, so you can check what the DB does internally in each stage.
The following figure groups the contents of altibase_boot.log recorded when starting up to the PROCESS stage into units of operation, together with what each step does.
The Lock Manager (13) prepared in the server module initialization step of the figure initializes the lock items used for concurrency control.
In the PROCESS stage, the DB space cannot be accessed, so only fixed tables can be accessed, and meta-related initialization or operations cannot be performed. However, CREATE DATABASE and DROP DATABASE can be executed in this stage.
Tasks in the PROCESS Stage#
In the PROCESS stage, users can create a database with the CREATE DATABASE statement.
-- Before Altibase 5.3
iSQL> CREATE DATABASE mydb INITSIZE=10M NOARCHIVELOG;
-- Altibase 5.3 or later
iSQL> CREATE DATABASE mydb INITSIZE=10M NOARCHIVELOG CHARACTER SET MS949 NATIONAL CHARACTER SET UTF8;
Users can also change the values of properties that can be changed with the ALTER command in iSQL, and query the following performance views. After the tasks in this stage are finished, transition to a higher stage such as the CONTROL stage.
| Performance view | Description |
|---|---|
| V$ACCESS_LIST | Access permission and restriction information of specific IP packets accessing Altibase |
| V$ALLCOLUMN | Information on the columns that make up the performance views |
| V$DBA_2PC_PENDING | List of transaction branches in the in-doubt state in distributed transactions |
| V$DIRECT_PATH_INSERT | Statistics related to direct-path upload |
| V$INSTANCE | Information on the current multi-stage startup of Altibase |
| V$NLS_TERRITORY | Names of the territories that can be set for the database or the current session |
| V$PROPERTY | Property information set in Altibase |
| V$TABLE | Record and column information of all performance views |
| V$TIME_ZONE_NAMES | List of region names, abbreviations and UTC offsets that can be set in the TIME_ZONE property |
| V$TRACELOG | Trace logging information |
| V$TRANSACTION | Transaction object information |
| V$TRANSACTION_MGR | Altibase transaction manager information |
| V$TXSEGS | Information on bound transaction segments |
| V$VERSION | Altibase version information |
CONTROL Stage#
CONTROL Stage Transition Command#
After finishing the tasks in the PROCESS stage, transition to the CONTROL stage with the STARTUP CONTROL command.
iSQL(sysdba)> STARTUP CONTROL;
The database server is already up and running.
TRANSITION TO PHASE : CONTROL
Command executed successfully.
Internal Operations: PROCESS Stage → CONTROL Stage#
In the CONTROL stage, each manager is initialized to the level at which the DB can be recovered, and the main managers that make up the Storage Manager module (Buffer, Recovery, Disk, etc.) are prepared.
The following figure groups the contents of altibase_boot.log recorded when starting up to the CONTROL stage into units of operation, together with what each step does.
Since only the managers required for recovery are prepared in this stage, operations that change the DB with DDL and DML are not allowed.
Tasks in the CONTROL Stage#
In the CONTROL stage, users can recover Altibase with the following DB recovery statements.
-- Complete recovery (recovers the data files up to the current point in time)
iSQL> ALTER DATABASE RECOVER DATABASE;
-- Incomplete recovery (recovers to a specific point in time in the past)
iSQL> ALTER DATABASE RECOVER DATABASE UNTIL TIME '2010-05-03:17:55:00';
Since Restart Recovery is performed in the META stage, if incomplete recovery was performed in the CONTROL stage, online log files that were not applied by the recovery may cause problems during DB startup. Therefore, after incomplete recovery, the online log files must be reset with the following command before transitioning to the META stage.
iSQL> ALTER DATABASE db_name META RESETLOGS;
The archive log mode of the database can also be changed in this stage.
-- Change to archive log mode
iSQL> ALTER DATABASE ARCHIVELOG;
-- Change to no-archive log mode
iSQL> ALTER DATABASE NOARCHIVELOG;
In addition to the performance views available in the PROCESS stage, the following performance views can be queried. Normal tables cannot be queried yet. After the tasks in this stage are finished, transition to a higher stage such as the META stage.
| Performance view | Description |
|---|---|
| V$BACKUP_INFO | Information on all incremental backups performed so far |
| V$DATAFILES | Information on the data files used by tablespaces |
| V$FILESTAT | I/O statistics for each data file on disk |
| V$LFG | Statistics related to group commit |
| V$LOCK_WAIT | Information on the lock wait status of transactions |
| V$LOG | Log anchor file information |
| V$MEM_TABLESPACE_CHECKPOINT_PATHS | Location (directory path) of the database image files to which changed pages (dirty pages) are written when a checkpoint occurs in a memory tablespace |
| V$MEM_TABLESPACE_STATUS_DESC | Information on the status values of memory tablespaces |
| V$OBSOLETE_BACKUP_INFO | Information on backups that no longer need to be kept (part of V$BACKUP_INFO; see V$BACKUP_INFO for details) |
| V$TABLESPACES | Tablespace information |
| V$TSSEGS | Information on all TSS segments |
META Stage#
META Stage Transition Command#
After finishing the tasks in the CONTROL stage, transition to the META stage with the STARTUP META command.
iSQL(sysdba)> STARTUP META;
TRANSITION TO PHASE : META
[SM] Recovery Phase - 1: Preparing Database
: Dynamic Memory Version => Parallel Loading
[SM] Recovery Phase - 2: Loading Database
[SM] Recovery Phase - 3: Skipping Recovery & Starting Threads...
Refining Disk Table
[SM] Refine Memory Table:................................................... [SUCCESS]
[SM] Rebuilding Indices [Total Count:101]................................... [SUCCESS]
Command execute success.
iSQL(sysdba)>
Internal Operations: CONTROL Stage → META Stage#
The META stage completes the recovery process started in the CONTROL stage. To start the DB, it checks the data files in memory and on disk and performs Restart Recovery.
The following figure groups the contents of altibase_boot.log recorded when starting up to the META stage into units of operation, together with what each step does.
TSS, which is rebuilt in the transaction preparation step of the figure, stands for Transaction Status Slot and is required to start a transaction. Of the modules prepared in the MVCC cleanup preparation step, the Memory Garbage Collector (11) deletes old index keys and the Delete Manager (12) deletes old table records. Rebuilding Indices [Total Count:100] in the log of the runtime information rebuild step is the number of rebuilt memory indexes.
Operations that change the DB with DDL and DML are not allowed in this stage either.
Tasks in the META Stage#
In the META stage, users can query all performance views, and after finishing the tasks, transition to the SERVICE stage.
SERVICE Stage#
SERVICE Stage Transition Command#
After finishing the tasks in the META stage, transition to the SERVICE stage with the STARTUP SERVICE or STARTUP command.
iSQL(sysdba)> STARTUP SERVICE;
TRANSITION TO PHASE : SERVICE
[CM] Listener started : TCP on port 20911
[CM] Listener started : UNIX
[RP] Initialization : [PASS]
--- STARTUP Process SUCCESS ---
Command execute success.
iSQL(sysdba)>
Internal Operations: META Stage → SERVICE Stage#
The SERVICE stage is the final stage in which users can use the DB. Once the server reaches this stage, general database users can connect.
The following figure groups the contents of altibase_boot.log recorded when starting up to the SERVICE stage into units of operation, together with what each step does.
The progress messages of each step are also sent to iSQL, so the listener startup and replication initialization results can also be seen in the output of the SERVICE stage transition command.
Tasks in the SERVICE Stage#
In the SERVICE stage, general users can connect with iSQL and other clients, and the DB can be operated normally.
Shutting Altibase Down#
This chapter describes the overview and characteristics of shutting down Altibase, the three shutdown options provided by Altibase, and the operations performed during shutdown.
Shutdown Overview#
Altibase starts up in four stages, but it shuts down in the reverse order of startup (SERVICE → META → CONTROL → PROCESS) at once.
To shut down a running Altibase server, connect to iSQL with the SYSDBA privilege and use the SHUTDOWN command. One of the NORMAL, IMMEDIATE and ABORT options can be specified for the SHUTDOWN command. NORMAL and IMMEDIATE can be used only when Altibase is in the SERVICE stage, while ABORT can be used in any stage.
The Altibase shutdown command can be executed only by the OS account that installed Altibase.
NORMAL#
This option shuts down the server normally, waiting until all clients disconnect from the server. Internally, it shuts down the thread that detects communication sessions between clients and the server, the service threads, the storage manager and so on, and then shuts down the Altibase server.
When the Altibase server is shut down with the NORMAL option, the following messages are displayed.
iSQL(sysdba)> SHUTDOWN NORMAL;
Ok..Shutdown Proceeding....
TRANSITION TO PHASE : Shutdown Altibase
[RP] Finalization : PASS
Shutdown normal success.
With the NORMAL option, Altibase checks whether the current user has the SYSDBA privilege and then waits until all sessions end. When all sessions have ended, it shuts down each module (Storage Manager, Query Processor, Communication Manager, etc.) and finally terminates the Altibase process.
IMMEDIATE#
This option forcibly disconnects the current sessions, rolls back the running transactions and then shuts down the Altibase server. Shutting down the server with the server stop command provided by Altibase works the same way as the IMMEDIATE option.
When the Altibase server is shut down with the IMMEDIATE option, the following messages are displayed.
iSQL(sysdba)> SHUTDOWN IMMEDIATE;
Ok..Shutdown Proceeding....
TRANSITION TO PHASE : Shutdown Altibase
[RP] Finalization : PASS
Shutdown immediate success.
With the IMMEDIATE option, Altibase checks whether the current user has the SYSDBA privilege, forcibly terminates all connected sessions and rolls back the running transactions. It then shuts down each module (Storage Manager, Query Processor, Communication Manager, etc.) and finally terminates the Altibase process.
Internal Operations of SHUTDOWN IMMEDIATE#
The following figures group the contents of altibase_boot.log recorded when SHUTDOWN IMMEDIATE is executed into units of operation, together with what each step does. Because the log is long, it is split into two figures.
Shutdown proceeds in the reverse order of startup. The upper modules that face users are shut down first (1–9), then the Storage Manager that stores the data (10–42), and finally the common modules (43–45).
ABORT#
This option forcibly terminates the Altibase server with the kill -9 system command. Since the consistency of the database cannot be guaranteed with this option, the database goes through recovery the next time the Altibase server starts.
With the ABORT option, Altibase checks whether the current user has the SYSDBA privilege, sends the kill -9 signal to the server process and waits until the server process terminates.