Skip to content

Altibase Quick Install & Start for UNIX#

Overview#

This document describes the basic steps for installing, starting, and stopping Altibase on UNIX-based operating systems.
For information needed after the basic installation, refer to the separate documents.

Info

For errors and improvements related to this document, please contact the technical support portal or technical support center.

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.

Preparation#

Prepare the following before starting the installation.

  1. Create the OS user account that will be used to install Altibase on the server.
  2. Download the Altibase package installer from the Technical Support Portal and upload it to the server.
  3. Check the Altibase version, OS type, OS bit, and MAC address, and then obtain a license. A temporary license can be issued from the Technical Support Portal, and a formal license is issued by the Altibase Sales Department after the contract is confirmed.

Downloading the Package#

You can download the package after signing up and logging in to the Technical Support Portal, or obtain it directly from Altibase.
The package file name contains the OS, compile bit, and product version, so choose the package that matches the system on which you will install it.

The following are examples of package file names for Altibase 6.5.1 and Altibase 7.1 on Linux.

altibase-HDB-server-6.5.1.X.X-LINUX-X86-64bit-release.run
altibase-server-7.1.0.X.X-LINUX-X86-64bit-release.run

Installing the Altibase Package and Creating the Database#

Altibase cannot be started until the database is created, so create the database by following the steps below before starting it.

Installation Steps#

The examples below are based on the Altibase 6.5.1.7.1 package.

Grant execute permission to the package file.

$ ls -al
-rw-r--r--  1 altibase dba 74639019 Jul 30 14:46 altibase-HDB-server-6.5.1.7.1-LINUX-X86-64bit-release.run

$ chmod 744 altibase-HDB-server-6.5.1.7.1-LINUX-X86-64bit-release.run 

$ ls -al
-rwxr--r--  1 altibase dba 74639019 Jul 30 14:46 altibase-HDB-server-6.5.1.7.1-LINUX-X86-64bit-release.run

Run the package and enter the absolute path where Altibase will be installed as the installation directory.

$ ./altibase-HDB-server-6.5.1.7.1-LINUX-X86-64bit-release.run 
----------------------------------------------------------------------------
Welcome to the ALTIBASE HDB Server 6.5.1.7.1 setup wizard.
----------------------------------------------------------------------------
Installation Directory

Please specify the installation directory for ALTIBASE HDB Server 6.5.1.7.1

Installation directory [/home/altibase/]: /home/altibase/altibase_home  # Enter the value and press Enter

Select the installation type. (Default: 1)
Full installation installs the entire package, and Patch installs a patch. For a new installation, select Full installation.

Please select the installation type.

Installation type

[1] Full installation: full package install
[2] Patch: patch package install
Please choose an option [1] : 1  # Enter the value and press Enter

The kernel parameter setting guide is displayed. You can view it again later by running install/pre_install.sh under the installation path.

----------------------------------------------------------------------------
Pre-Installation Requirements for ALTIBASE HDB
It is first necessary to set your system environment to ensure that ALTIBASE HDB 
will run properly. Before installing ALTIBASE HDB, the kernel parameter values 
must be set using the root user account. The kernel parameter values may be 
modified after installation; however, they must be set prior to starting 
ALTIBASE HDB.

Please refer to the installation manual and pre_install.sh script file.
(pre_install.sh: '$Altibase_install_dir'/install/pre_install.sh)

================ LINUX ================
[ How to modify kernel parameter values ]

echo 512 32000 512 512 > /proc/sys/kernel/sem
echo 872415232 > /proc/sys/kernel/shmall

$ shmall 
If it is desired to use ALTIBASE HDB in shared memory mode, the value of 
'shmall' must be set. This value determines the maximum size of an Altibase 
database.

Press [Enter] to continue :
These values must be set in order for ALTIBASE HDB to operate properly.
They must be set such that they are suitable for the system configuration.
=====================================

Press [Enter] to continue :  # Press Enter

Enter the database name. (Default: mydb)
To change the database name later, the database must be rebuilt.

----------------------------------------------------------------------------
ALTIBASE HDB Property Settings
Step 1: Basic Database Operation Properties
Database name [mydb] : mydb  # Enter the value and press Enter

Enter the database port number. (Default: 20300)

ALTIBASE HDB connection port number (1024-65535)      [20300] : 20300  # Enter the value and press Enter

Enter the MEM_MAX_DB_SIZE value. (Default: 2G)
MEM_MAX_DB_SIZE is the maximum size of data that can be stored in memory. It is an upper limit, not memory that is allocated in advance.

Maximum size of memory database

- MIN value: 16M (K = kB, M = MB, G = GB) [2G] : 2G  # Enter the value and press Enter

Enter the buffer area size (BUFFER_AREA_SIZE). (Default: 128M)
BUFFER_AREA_SIZE is the size of the buffer area that caches disk table pages. The entire size is allocated in advance at startup.

Buffer area size for caching disk-based database pages
- MIN value: 1M (K = kB, M = MB, G = GB) [128M] : 128M  # Enter the value and press Enter

Choose whether to create the database after installation. (Default: YES)

Do you want to create a database after the installation process is complete?
[1] YES
[2] NO
Please choose an option [1] : 1  # Enter the value and press Enter

Enter the initial database size. (Default: 10M)

ALTIBASE HDB Property Settings
Step 2: Database Creation Properties
Initial database size
- 4M-4G (K = kB,M = MB,G = GB) [10M] : 10M  # Enter the value and press Enter

Select the archive log mode. (Default: No archivelog)

Database archive logging mode 
[1] No archivelog
[2] Archivelog
Please choose an option [1] : 1  # Enter the value and press Enter

Select the database character set. (Default: UTF-8)

Database character set
[1] UTF-8
[2] MS949
[3] US7ASCII
[4] KO16KSC5601
[5] BIG5
[6] GB231280
[7] MS936
[8] SHIFT-JIS
[9] EUC-JP
[10] MS932
Please choose an option [1] : 1  # Enter the value and press Enter

Select the national character set. (Default: UTF-8)

National character set
[1] UTF-8
[2] UTF-16
Please choose an option [1] : 1  # Enter the value and press Enter

Enter the paths for the data files (disk tablespace data files and memory tablespace checkpoint image files), archive log files, log files, and log anchor files.
You can specify any path. The defaults are the dbs, arch_logs, and logs directories under the Altibase installation directory.

ALTIBASE HDB Property Settings
Step 3: Set Database Directories
Default disk database directory [/home/altibase/altibase_home/dbs] : /home/altibase/altibase_home/dbs  # Enter the value and press Enter
Memory database directory [/home/altibase/altibase_home/dbs] : /home/altibase/altibase_home/dbs  # Enter the value and press Enter
Archive log directory [/home/altibase/altibase_home/arch_logs] : /home/altibase/altibase_home/arch_logs  # Enter the value and press Enter
Transaction log directory [/home/altibase/altibase_home/logs] : /home/altibase/altibase_home/logs  # Enter the value and press Enter
[Log Anchor file directories ]
ALTIBASE HDB maintains three sets of log anchor files. These files contain 
important information
about the database. By default, they are located in the "logs" folder. 
The location can be changed here or by modifying the contents of the ALTIBASE 
HDB properties file, 
which is named "altibase.properties".
Directory 1. [/home/altibase/altibase_home/logs] : /home/altibase/altibase_home/logs  # Enter the value and press Enter
Directory 2. [/home/altibase/altibase_home/logs] : /home/altibase/altibase_home/logs  # Enter the value and press Enter
Directory 3. [/home/altibase/altibase_home/logs] : /home/altibase/altibase_home/logs  # Enter the value and press Enter

Review the values you entered.

Property Review
Please check your property settings.

To change these properties after installation is complete, 
please modify the following file:
  /home/altibase/altibase_home/conf/altibase.properties.
1. ALTIBASE HDB Property Settings:
    Step 1: Basic Database Operation Properties
    1) Database name: 
         [mydb]
    2) ALTIBASE HDB connection port number (1024-65535): 
         [20300]
    3) Maximum size of memory database:
         [2G]
    4) Buffer area size for caching disk-based database pages:
         [128M]
2. ALTIBASE HDB Property Settings:
Press [Enter] to continue :  # Press Enter
    Step 2: Database Creation Properties
    1) Initial database size
         [10M]
    2) Database archive logging mode
         [noarchivelog]
    3) Database character set
         [UTF8]
    4) National character set
         [UTF8]
3. ALTIBASE HDB Property Settings:
    Step 3: Set Database Directories
    The database will not operate properly if any of these directories are 
removed.
    1) Disk database directory: 
         [/home/altibase/altibase_home/dbs] 
Press [Enter] to continue :  # Press Enter
    2) Memory database directory:
         [/home/altibase/altibase_home/dbs] 
    3) Archive log directory: 
         [/home/altibase/altibase_home/arch_logs] 
    4) Transaction log directory: 
         [/home/altibase/altibase_home/logs] 
    5) Log Anchor file directories:
         Directory 1: 
         [/home/altibase/altibase_home/logs] 
         Directory 2: 
         [/home/altibase/altibase_home/logs] 
         Directory 3: 
         [/home/altibase/altibase_home/logs] 
Press [Enter] to continue :  # Press Enter

Proceed with the package installation.

Setup is now ready to install ALTIBASE HDB Server 6.5.1.7.1.
Do you want to continue? [Y/n]: Y  # Enter Y and press Enter
----------------------------------------------------------------------------
Please wait until the setup wizard finishes installing ALTIBASE HDB Server 
6.5.1.7.1.
 Installing
 0% ______________ 50% ______________ 100%
 #########################################

When the package installation is complete, register the issued license. (Default: 1)

ALTIBASE HDB License
If a license has not been issued or if it has expired,
ALTIBASE HDB services will not start.
If this is the case, Please visit   http://support.altibase.com
Choose an option for ALTIBASE HDB license registration.
[1] I will input a license key.
[2] I will select a license file.
[3] I want to register an ALTIBASE HDB license later.
Please choose an option [1] : 1  # Enter the value and press Enter
----------------------------------------------------------------------------
ALTIBASE HDB License
Please enter your ALTIBASE HDB license key.
 []: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  # Enter the issued license and press Enter

Create the database. Based on the values entered above, the data files, checkpoint image files, log files, and log anchor files are created.

ALTIBASE HDB Quick Setting Guide
[  Installation complete  ]
Please refer to the file listed below to verify the ALTIBASE HDB version.
    /home/altibase/altibase_home/APatch/patchinfo 
[ Quick Guide to Making Settings in ALTIBASE HDB ] 
1. Set kernel variables using the root user account.
    run the '/home/altibase/altibase_home/install/pre_install.sh' file 
    - This script helps you make kernel parameter settings.
================ LINUX ================
[ How to modify kernel parameter values ]
echo 512 32000 512 512 > /proc/sys/kernel/sem
echo 872415232 > /proc/sys/kernel/shmall
$ shmall 
If it is desired to use ALTIBASE HDB in shared memory mode, the value of 
'shmall' must be set. This value determines the maximum size of an Altibase 
database.
Press [Enter] to continue :  # Press Enter
These values must be set in order for ALTIBASE HDB to operate properly.
They must be set such that they are suitable for the system configuration.
=====================================
2. Provide a license.
    Please rename and locate the license file as shown below.
    /home/altibase/altibase_home/conf/license 
    If no license file has been issued or if the license file has expired,
    ALTIBASE HDB services will not start.
    In this case, please visit http://support.altibase.com
3. Configure user environment variables (using the user account with which 
ALTIBASE HDB was installed).
    Run the '/home/altibase/altibase_home/install/post_install.sh' file 
    under the account with which ALTIBASE HDB was installed.
Press [Enter] to continue :  # Press Enter
    This script performs necessary post-installation configuration. 
    1) Create the ALTIBASE HDB user environment file and apply it to the user 
profile.
         (/home/altibase/altibase_home/conf/altibase_user.env)
    2) Create a database.
         If you selected 'YES' in response to the question about whether to 
create 
         a database after installation, at "ALTIBASE HDB Property setting step 
1", 
         a database will be automatically created.
         If you selected 'NO' in response to this question,
         you need to create a database manually.
         shell> server create [DB Character Set] [National Character Set]
4. Start up and shut down the server
    shell> server start
    shell> server stop
Press [Enter] to continue :  # Press Enter
5. Connect to the database using iSQL
    shell> isql -s 127.0.0.1 -u SYS -p MANAGER
Press [Enter] to continue :  # Press Enter
Would you like to launch 'post_install.sh' now ?
 - This will create the ALTIBASE HDB database. [Y/n]: Y  # Enter Y and press Enter
Result
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
[ERR-910FB : Connected to idle instance]
Connecting to the DB server.... Connected.
TRANSITION TO PHASE : PROCESS
Command executed successfully.
DB Info (Page Size     = 32768)
        (Page Count    = 257)
        (Total DB Size = 8421376)
        (DB File Size  = 1073741824)
        Creating MMDB FILES     [SUCCESS]
        Creating Catalog Tables [SUCCESS]
Press [Enter] to continue :
        Creating DRDB FILES     [SUCCESS]
  [SM] Rebuilding Indices [Total Count:0]  [SUCCESS]
DB Writing Completed. All Done.
Create success.
Press [Enter] to continue :  # Press Enter
----------------------------------------------------------------------------
Setup has finished installing the ALTIBASE HDB Server 6.5.1.7.1 on your host.
Info: [Linux Env.]
        Target : /home/altibase/altibase_home/conf/altibase_user.env
        created  ----------------------- Altibase environment setup file.
        added    ----------------------- ALTIBASE_HOME
        added    ----------------------- PATH
        added    ----------------------- LD_LIBRARY_PATH
        added    ----------------------- CLASSPATH
        export ----------------------- 'altibase_user.env'
        into '/home/altibase/.bash_profile'

==============================================
Please perform [re-login] 
or [source /home/altibase/.bash_profile] 
or [. /home/altibase/.bash_profile]
==============================================
Press [Enter] to continue :  # Press Enter

Verifying the Installation#

When the database is created, the values you entered are applied to the $ALTIBASE_HOME/conf/altibase.properties file.
The ? in property values stands for $ALTIBASE_HOME.

$ vi $ALTIBASE_HOME/conf/altibase.properties
# ... (omitted) ...
DB_NAME             = mydb
# ... (omitted) ...
MEM_DB_DIR          = ?/dbs       # Path of checkpoint image files for the default memory tablespace
# ... (omitted) ...
DEFAULT_DISK_DB_DIR = ?/dbs       # Path of data files for the default disk tablespace
# ... (omitted) ...
LOGANCHOR_DIR       = ?/logs      # Log anchor file path (1st of 3)
LOGANCHOR_DIR       = ?/logs      # Log anchor file path (2nd of 3)
LOGANCHOR_DIR       = ?/logs      # Log anchor file path (3rd of 3)
# ... (omitted) ...
LOG_DIR             = ?/logs      # Log file path
# ... (omitted) ...
ARCHIVE_DIR         = ?/arch_logs # Archive log file path
# ... (omitted) ...
MEM_MAX_DB_SIZE     = 2G
# ... (omitted) ...
BUFFER_AREA_SIZE    = 128M
# ... (omitted) ...
PORT_NO             = 20300
# ... (omitted) ...

When the database is created successfully, the data files, checkpoint image files, log anchor files, and log files are created in the dbs and logs directories as follows.

$ ls -al $ALTIBASE_HOME/dbs

SYS_TBS_MEM_DATA-0-0
SYS_TBS_MEM_DATA-1-0
SYS_TBS_MEM_DIC-0-0
SYS_TBS_MEM_DIC-1-0
dwfile-1.dwf
dwfile0.dwf
dwfile1.dwf
system001.dbf
temp001.dbf
undo001.dbf

$ ls -al $ALTIBASE_HOME/logs
loganchor0
loganchor1
loganchor2
logfile0
logfile1
logfile2
logfile3
logfile4
logfile5

Environment variables such as ALTIBASE_HOME and PATH are automatically registered in the profile of the OS user account that performed the installation.

$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH    

# ALTIBASE_ENV
. /home/altibase/altibase_home/conf/altibase_user.env

$ vi altibase_user.env
ALTIBASE_HOME=/home/altibase/altibase_home;export ALTIBASE_HOME
PATH=${ALTIBASE_HOME}/bin:${PATH};export PATH
LD_LIBRARY_PATH=${ALTIBASE_HOME}/lib:${LD_LIBRARY_PATH};export LD_LIBRARY_PATH
CLASSPATH=${ALTIBASE_HOME}/lib/Altibase.jar:${CLASSPATH};export CLASSPATH

Altibase Directory Structure#

When you install the Altibase package, the following directories are created.
The table below describes only the main directories you need to check after installation. For details, refer to the manual.

Directory Description
admin Example SQL and view creation files for easily querying Altibase performance views
bin Altibase executables and utilities
include Header files for Altibase application development
install altibase_env.mk file containing example macro settings for makefiles used in application development, and a README file
lib Libraries for Altibase application development
sample Example source code for Altibase applications, such as CLI, APRE, JDBC, and C/C++
trc Trace log files that record Altibase operating status
conf Altibase configuration files (altibase.properties, aexport.properties), property example files (sample), and the license file
logs Default path where log anchor files and log files are created
dbs Default path where data files are created
arch_logs Archive log directory where log files are backed up for recovery
altiComp Utility that resolves data inconsistencies caused by failures during replication
msg Altibase error message files

Installation Notes#

Altibase does not provide the server product as a 32-bit package. However, client products for development and integration are provided as separate packages.
Client package file names begin with altibase-HDB-client-6.5.1.x.x.
Packages are built with a specific compiler, so if you use gcc/g++ or another compiler, check the compiler version in advance.

For whether to use the client package and which versions are available, contact the Technical Support Center (+82-2-2082-1114) or the Technical Support Portal.

Reference: Creating the Database#

For details on creating an Altibase database, refer to the following document.

Creating an Altibase Database

Starting Altibase#

Altibase can be started after the package installation and database creation are complete.
This section describes how to start Altibase.

Before starting, check that the environment variables are set correctly for the OS user account that installed Altibase.

The environment variable file differs depending on the OS and shell, so check that ALTIBASE_HOME and PATH are set correctly in that file.
For Linux (bash), check .bash_profile and apply it as follows.

$ . $HOME/.bash_profile
# or
$ source $HOME/.bash_profile

Startup Procedure#

Run the server start command at the OS prompt to start Altibase.
server is a shell script provided to make it easy to start and stop Altibase.

$ server start
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
[ERR-910FB : Connected to idle instance]
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:137] ............................................................ [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.

Alternatively, you can connect to iSQL as sysdba and run the STARTUP SERVICE command.

$ isql -sysdba
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
Write UserID : SYS  # Enter the user "SYS"
Write Password : MANAGER  # Enter the default password "MANAGER"
ISQL_CONNECTION = UNIX, SERVER = localhost
[ERR-910FB : Connected to idle instance]
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 : Starting Recovery
                            Initializing Active Transaction List 
                            Redo 
                            Refine Disk Table..
                            Undo 
  [SM] Refine Memory Table : ........................................................................... [SUCCESS]
  [SM] Rebuilding Indices [Total Count:137] ............................................................ [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.

Startup Failure Examples#

The following are common causes of startup failure.

Environment Variables Not Set#

If the environment variables (ALTIBASE_HOME, PATH) are not set or the environment variable file has not been applied, startup fails as follows.

$ server start
-bash: server: command not found

$ isql -sysdba
[ISQL]ERROR: Could not SQLConnect

Database Not Created#

If you start Altibase without creating the database, startup fails as follows because the log anchor file does not exist.

$ server start
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
[ERR-910FB : Connected to idle instance]
Connecting to the DB server.... Connected.

TRANSITION TO PHASE : PROCESS

TRANSITION TO PHASE : CONTROL
[FAILURE] The log anchor file does not exist or is not valid.
Startup Failed....
[ERR-91015 : Communication failure.]

License Not Registered#

If the license is not registered, startup fails as follows.
You can check the cause of the failure in $ALTIBASE_HOME/trc/altibase_boot.log.

$ server start
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = UNIX, SERVER = localhost
[ERR-910FB : Connected to idle instance]
Connecting to the DB server...............................Startup Failure. Check Your Environment.

$ vi $ALTIBASE_HOME/trc/altibase_boot.log
# ... (omitted) ...
[2019/09/01 02:03:35 6][PID:108941][Thread-140685391135488][LWP-108941]
No valid license present!
# ... (omitted) ...

Stopping Altibase#

This section describes how to stop a running Altibase server.

Shutdown Procedure#

Run the server stop command at the OS prompt to stop Altibase.

$ server stop
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.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 immediate success.

Alternatively, you can connect to iSQL as sysdba and run the SHUTDOWN command with one of the abort, immediate, or normal options.

$ isql -sysdba
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
Write UserID : SYS  # Enter the user "SYS"
Write Password : MANAGER  # Enter the default password "MANAGER"

iSQL(sysdba)> SHUTDOWN ABORT;

iSQL(sysdba)> SHUTDOWN IMMEDIATE;

iSQL(sysdba)> SHUTDOWN NORMAL;

Each option works as follows.

Option Description
abort Forcibly terminates all connected sessions and stops immediately without the normal shutdown process. Recovery is performed at the next startup, and there is no problem with the data.
immediate Forcibly terminates all connected sessions, and then stops through the normal shutdown process.
normal Waits until all connected sessions end on their own, and then stops through the normal shutdown process.

Warning

Because the normal option waits until all sessions end, the shutdown may appear not to be progressing if any sessions are still connected. When using it, check whether there are connected sessions.

Reference: Starting and Stopping#

For details on the startup and shutdown process of Altibase, refer to the following document.

Understanding the Altibase Start/Shut down Process

Basic Usage Examples#

This section briefly shows how to create and drop database users, tablespaces, and tables.

Altibase complies with the SQL92 standard, so its syntax does not differ significantly from other DBMSs.
For details on SQL usage, refer to the Altibase Manual.

Using iSQL#

iSQL is a utility provided by Altibase for executing SQL in a terminal.
Right after the database is created, only the SYS user with DBA privileges exists, so connect as SYS.
$ALTIBASE_HOME/bin/is is a shell script provided to make it easy to connect to iSQL as SYS.

$ is
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = TCP, SERVER = localhost, PORT_NO = 20300
iSQL> SELECT SYSDATE FROM DUAL;
SYSDATE      
---------------
01-SEP-2019  
1 row selected.

$ isql -s 127.0.0.1 -u sys -p manager -port 20300
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = TCP, SERVER = 127.0.0.1, PORT_NO = 20300
iSQL> SELECT SYSDATE FROM DUAL;
SYSDATE      
---------------
01-SEP-2019  
1 row selected.

The main iSQL connection options are as follows.

Option Description
-u Database user name
-p Database user password
-s IP address of the database server to connect to. Enter 127.0.0.1 for the local server.
-port Port number of the database to connect to. Check the PORT_NO value in the $ALTIBASE_HOME/conf/altibase.properties file.

If the database character set is not US7ASCII, set the client environment variable ALTIBASE_NLS_USE to the same value as the database character set.
For example, if the database was created with the MS949 character set, the client must also connect with ALTIBASE_NLS_USE=MS949 to input and output Korean data correctly.

$ server create MS949 UTF8
-- Create the database with the MS949 character set.

$ is
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = TCP, SERVER = localhost, PORT_NO = 20300
iSQL> CREATE TABLE test (c1 VARCHAR(100));
Create success.
iSQL> INSERT INTO test VALUES ('Altibase');
1 row inserted.
iSQL> INSERT INTO test VALUES ('알티베이스');
1 row inserted.
-- Insert Korean data while the database character set is MS949.

$ is
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = TCP, SERVER = localhost, PORT_NO = 20300
iSQL> SET VERTICAL ON;
iSQL> SELECT * FROM V$NLS_PARAMETERS;
SESSION_ID                : 1 
NLS_USE                   : US7ASCII  -- The current session is connected with US7ASCII
NLS_CHARACTERSET          : MS949  -- The database character set is MS949
NLS_NCHAR_CHARACTERSET    : UTF8  
NLS_COMP                  : BINARY  
NLS_NCHAR_CONV_EXCP       : FALSE  
NLS_NCHAR_LITERAL_REPLACE : FALSE  
1 row selected.

iSQL> SELECT * FROM test;
C1                              
----------------------------------
Altibase                        
?????                           
2 rows selected.
-- In a session connected with US7ASCII, "알티베이스" may be displayed as ?????.

$ export ALTIBASE_NLS_USE=MS949
-- Set the ALTIBASE_NLS_USE environment variable so that the client connects with the MS949 character set.
-- To apply it every time, add export ALTIBASE_NLS_USE=MS949 to the profile.
-- Korean data is input and output correctly only when the character set is specified explicitly.
-- If Korean text still appears broken after setting this variable, check that the terminal is configured to display Korean.

$ is
-----------------------------------------------------------------
     Altibase Client Query utility.
     Release Version 6.5.1.7.1
     Copyright 2000, ALTIBASE Corporation or its subsidiaries.
     All Rights Reserved.
-----------------------------------------------------------------
ISQL_CONNECTION = TCP, SERVER = localhost, PORT_NO = 20300
iSQL> SET VERTICAL ON;
iSQL> SELECT * FROM V$NLS_PARAMETERS;
SESSION_ID                : 1 
NLS_USE                   : MS949  -- The session is connected with MS949, the same as the database character set
NLS_CHARACTERSET          : MS949  -- The database character set is MS949
NLS_NCHAR_CHARACTERSET    : UTF8  
NLS_COMP                  : BINARY  
NLS_NCHAR_CONV_EXCP       : FALSE  
NLS_NCHAR_LITERAL_REPLACE : FALSE  
1 row selected.

iSQL> SELECT * FROM test;
C1                              
----------------------------------
Altibase                        
알티베이스                      
2 rows selected.
-- In a session connected with the same character set as the database, Korean data is displayed correctly.

Creating and Dropping Database Users#

Altibase has the SYS user with DBA privileges by default, and you can connect with this account to create new users.
The following example creates and drops a user.

-- 1) Create example
iSQL> CREATE USER new_user IDENTIFIED BY new_user_password DEFAULT TABLESPACE SYS_TBS_DISK_DATA ACCESS SYS_TBS_MEM_DATA ON;
Create success.

-- 2) Drop example
iSQL> DROP USER new_user CASCADE;
Drop success.

Each clause of the statement is as follows.

Clause Description
CREATE USER Specifies the name of the user to create.
IDENTIFIED BY Specifies the user's password.
DEFAULT TABLESPACE Specifies the user's default tablespace. This clause and the clauses after it can be omitted when creating a user, and can be changed later with the ALTER USER statement.
ACCESS ~ ON Grants access to the specified tablespace.

Creating and Dropping Tablespaces#

Altibase is a hybrid DBMS (HDB) and can use both memory tablespaces and disk tablespaces.
The following example creates and drops a user memory tablespace and a user disk tablespace.

-- 1) Create a user memory tablespace
iSQL> CREATE MEMORY TABLESPACE new_tbs_mem SIZE 1G AUTOEXTEND ON NEXT 128M MAXSIZE 2G;
Create success.
-- The NEW_TBS_MEM-X-X checkpoint image files are created under $ALTIBASE_HOME/dbs.
-- The tablespace starts at 1G and automatically extends in 128M increments up to 2G.

-- 2) Create a user disk tablespace
iSQL> CREATE DISK TABLESPACE new_tbs_disk DATAFILE 'new_tbs.dbf' SIZE 1G AUTOEXTEND ON NEXT 128M MAXSIZE 2G;
Create success.
-- The new_tbs.dbf data file is created under $ALTIBASE_HOME/dbs.
-- The tablespace starts at 1G and automatically extends in 128M increments up to 2G.
-- The DISK keyword can be omitted. (CREATE TABLESPACE ...)

-- 3) Drop example
iSQL> DROP TABLESPACE new_tbs_disk INCLUDING CONTENTS AND DATAFILES;
Drop success.
-- Drops the tablespace along with the objects and data files it contains.
-- If the tablespace cannot be dropped, a session is using it. Clean up that session and run the statement again.

Creating and Dropping Tables#

Because Altibase can use both memory tablespaces and disk tablespaces, you can create both memory tables and disk tables.
The following example creates and drops a memory table and a disk table.

-- 1) Query tablespaces
iSQL> SELECT TYPE, NAME FROM V$TABLESPACES;
TYPE        NAME                                      
---------------------------------------------------------
0           SYS_TBS_MEM_DIC                           
1           SYS_TBS_MEM_DATA  -- Default memory tablespace
3           SYS_TBS_DISK_DATA  -- Default disk tablespace
7           SYS_TBS_DISK_UNDO                         
5           SYS_TBS_DISK_TEMP                         
5 rows selected.

-- 2) Create a memory table
iSQL> CREATE TABLE mem_tbl (c1 INT, c2 VARCHAR(100), c3 CHAR(100));
Create success.

iSQL> DESC mem_tbl;
[ TABLESPACE : SYS_TBS_MEM_DATA ]  -- Default memory tablespace
[ ATTRIBUTE ]                                                         
------------------------------------------------------------------------------
NAME                                     TYPE                        IS NULL 
------------------------------------------------------------------------------
C1                                       INTEGER         FIXED       
C2                                       VARCHAR(100)    FIXED       
C3                                       CHAR(100)       FIXED       
MEM_TBL has no index
MEM_TBL has no primary key
-- If no tablespace is specified, the table is created as a memory table in the default memory tablespace.

-- 3) Create a disk table
iSQL> CREATE TABLE disk_tbl (c1 INT, c2 VARCHAR(100), c3 CHAR(100)) TABLESPACE SYS_TBS_DISK_DATA;
Create success.

iSQL> DESC disk_tbl;
[ TABLESPACE : SYS_TBS_DISK_DATA ]  -- Default disk tablespace
[ ATTRIBUTE ]                                                         
------------------------------------------------------------------------------
NAME                                     TYPE                        IS NULL 
------------------------------------------------------------------------------
C1                                       INTEGER                     
C2                                       VARCHAR(100)                
C3                                       CHAR(100)                   
DISK_TBL has no index
DISK_TBL has no primary key
-- If a disk tablespace is specified, the table is created as a disk table in that tablespace.

-- 4) Drop tables
iSQL> DROP TABLE mem_tbl;
Drop success.

iSQL> DROP TABLE disk_tbl;
Drop success.
-- Memory tables and disk tables are dropped in the same way.