4. Startup and Shutdown#
To provide service after creating a database, the Altibase server must be started to the server phase. This chapter describes the references for starting and shutting down the database.
Startup Procedure#
There are two ways to start up an Altibase server:
-
A database administrator logs in to the server using the sys account, accesses the server in -sysdba administrator mode, and then uses the privileges granted to him/her to manually start the server.
-
The server is started using a script called server.
To start up Altibase, first, execute iSQL using the -sysdba option in the same way as when creating a database.
The following demonstrates how to start up an Altibase database using iSQL:
$ is -sysdba
-----------------------------------------------------------------
Altibase Client Query utility.
Release Version 7.3.0.0.0
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
Connected to idle instance.
iSQL(sysdba)>
Note
The Altibase startup command can only be executed using the account with which Altibase (including iSQL) was installed.
During the startup procedure, the status of the Altibase progress in sequence through the following phases:
-
PRE_PROCESS
-
PROCESS
-
CONTROL
-
META
-
SERVICE
The startup command can be used with the following phase options:
STARTUP [PROCESS | CONTROL | META | SERVICE];
Users other than the SYS user can access the database only in the SERVICE phase.
Note
Altibase can only progress from earlier phases to subsequent phases; it is impossible to revert to a previous phase.
The following is an example of starting the server in the service phase:
iSQL(sysdba)> STARTUP SERVICE
Connecting to the DB server.... Connected.
TRANSITION TO PHASE : PROCESS
TRANSITION TO PHASE : CONTROL
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:134] ...................................................................................................................................... [SUCCESS]
TRANSITION TO PHASE : SERVICE
[CM] Listener started : TCP on port 20300 [IPV4]
[CM] Listener started : UNIX
[CM] Listener started : IPC
[RP] Initialization : [PASS]
--- STARTUP Process SUCCESS ---
Command executed successfully.
iSQL(sysdba)>
The database performs the following tasks in each phase:
Phase | Tasks |
---|---|
PRE-PROCESS | The initial phase. The server prepares to advance to the PROCESS phase. |
PROCESS | In this phase, the CREATE DATABASE and DROP DATABASE statements can be executed, a limited number of performance views can be used to obtain information, and property values can be changed. The server prepares to advance to the CONTROL phase. |
CONTROL | Media Recovery can be performed in this phase. The server prepares to advance to the META phase. If incomplete recovery is performed during the CONTROL phase, online logs must be reset when proceeding to the META phase. |
META | Meta data (the dictionary table) can be upgraded in this phase. The server prepares to advance to the SERVICE phase. |
SERVICE | The SERVICE phase is the normal operational state of Altibase. Users other than the SYS user can establish connections to Altibase in this phase. SHUTDOWN NORMAL/IMMEDIATE/ABORT can all be executed. |
Shutdown Procedure#
To shut down the Altibase server that is currently running, use the SHUTDOWN statement. The following options are available:
SHUTDOWN [NORMAL | IMMEDIATE | ABORT];
SHUTDOWN NORMAL and SHUTDOWN IMMEDIATE can only be executed while Altibase is running in the SERVICE phase, whereas SHUTDOWN ABORT can be executed in any phase.
Note
The Altibase SHUTDOWN command can only be executed using the account with which Altibase (including iSQL) was installed.
SHUTDOWN NORMAL#
This method shuts down the server normally. The server waits for termination until all clients disconnect from the server. The following operations are performed internally when the server is shut down:
- Threads that function to detect client-server communication sessions are shut down.
- Service threads are shut down.
- The storage manager is shut down.
- Finally, after all the remaining tasks have been completely performed, the Altibase server shuts down.
When Altibase is shut down in this way, the following messages are output:
iSQL(sysdba)> SHUTDOWN NORMAL
Ok..Shutdown Proceeding....
TRANSITION TO PHASE : Shutdown Altibase
[RP] Finalization : PASS
shutdown normal success.
iSQL(sysdba)>
SHUTDOWN IMMEDIATE#
When SHUTDOWN IMMEDIATE is executed, the Altibase server first forcibly disconnects currently connected sessions, then rolls back pending transactions and shuts down the Altibase server.
When Altibase is shut down in this way, the following is output:
iSQL(sysdba)> SHUTDOWN IMMEDIATE
Ok..Shutdown Proceeding....
TRANSITION TO PHASE : Shutdown Altibase
[RP] Finalization : PASS
shutdown im../imgte success.
iSQL(sysdba)>
The server can also be forcibly shut down using a server script:
$ server stop
-----------------------------------------------------------------
Altibase Client Query utility.
Release Version 7.3.0.0.1
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
Ok..Shutdown Proceeding....
TRANSITION TO PHASE : Shutdown Altibase
[RP] Finalization : PASS
shutdown im../imgte success.
$
SHUTDOWN ABORT#
SHUTDOWN ABORT forcibly kills the Altibase server. When Altibase is shut down in this way, the contents of the database will likely be invalid, and thus the next time the server is executed, restart recovery will be automatically performed.
When Altibase is shut down in this way, the following is output:
iSQL(sysdba)> SHUTDOWN ABORT
iSQL(sysdba)>
The server can also be forcibly shut down using a server script.
$ server kill
-----------------------------------------------------------------
Altibase Client Query utility.
Release Version 7.3.0.0.1
Copyright 2000, ALTIBASE Corporation or its subsidiaries.
All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
$