Table of Contents
This chapter describes how to configure TAS initialization parameters, how to start a TAS instance, how to configure the Tibero initialization parameters for using TAS, and how to create a database.
First, configure LISTENER_PORT, MAX_SESSION_COUNT, MEMORY_TARGET, and TOTAL_SHM_SIZE according to the system configuration.
For information about configuring initialization parameters, refer to Tibero Reference Guide.
Additionally, configure the following initialization parameters.
The following are initialization parameter configuration examples.
Using a single disk
"/devs/disk1"
Using multiple disks (comma as delimiter)
"/devs/disk1,/devs/disk2"
Using multiple disks with wildcard pattern matching
"/devs/disk*"
Using '?' at the beginning of the path to reference TAS home directory
"?/devs/disk*"
The following are optional initialization parameters.
This section describes how to manage a TAS instance.
This section describes the environment configurations needed for starting up a TAS instance using an example file.
The TAS instance that uses a tip file in the following example uses all disk devices in "/devs/disk*" as a TAS disk.
[Example 2.1] TAS Instance tip File Example
LISTENER_PORT=9620
MAX_SESSION_COUNT=100
MEMORY_TARGET=2G
TOTAL_SHM_SIZE=1G
INSTANCE_TYPE=AS
AS_DISKSTRING="/devs/disk*"
When starting up a TAS instance for the first time, it must be started up in NOMOUNT mode.
[TB_SID=as]$ tbboot nomount
Use tbsql to connect to the TAS instance that is running in NOMOUNT mode. Next, create the default disk space by using the CREATE DISKSPACE SQL statement.
The following DDL statement is an example of using the CREATE DISKSPACE clause.
$ CREATE DISKSPACE ds0 NORMAL REDUNDANCY
FAILGROUP fg1 DISK
'/devs/disk101' NAME disk101,
'/devs/disk102' NAME disk102,
'/devs/disk103' NAME disk103,
'/devs/disk104' NAME disk104
FAILGROUP fg2 DISK
'/devs/disk201' NAME disk201,
'/devs/disk202' NAME disk202,
'/devs/disk203' NAME disk203,
'/devs/disk204' NAME disk204
ATTRIBUTE 'AU_SIZE'='4M';
A TAC instance automatically shuts down when the default disk space is created. After a default disk space is created, a TAS instance can be started up in NORMAL mode. Even when an additional disk space is created, the instance does not shut down. For more information about creating a disk space, refer to “3.2. Creating a Disk Space”.
The following example shows the tip file of each required instance when starting up two TAS instances as a cluster. The TAS instances that use this tip file use all the shared disk devices in "/devs/disk*" as a TAS disk. Set CM_PORT to the port number specified in CM_UI_PORT of the CM_TIP file.
[Example 2.2] TAS Instance Clustering tip File Example: <as0.tip>
LISTENER_PORT=9620
MAX_SESSION_COUNT=100
MEMORY_TARGET=2G
TOTAL_SHM_SIZE=1G
INSTANCE_TYPE=AS
AS_DISKSTRING="/devs/disk*"
CLUSTER_DATABASE=Y
LOCAL_CLUSTER_ADDR=192.168.1.1
LOCAL_CLUSTER_PORT=20000
CM_CLUSTER_MODE=ACTIVE_SHARED
CM_PORT=20005
THREAD=0
[Example 2.3] TAS Instance Clustering tip File Example: <cm0.tip>
CM_NAME=cm0
CM_UI_PORT=20005
CM_RESOUCE_FILE=/home/tibero/config/cm0_res.crf
[Example 2.4] TAS Instance Clustering tip File Example: <as1.tip>
LISTENER_PORT=9620
MAX_SESSION_COUNT=100
MEMORY_TARGET=2G
TOTAL_SHM_SIZE=1G
INSTANCE_TYPE=AS
AS_DISKSTRING="/devs/disk*"
CLUSTER_DATABASE=Y
LOCAL_CLUSTER_ADDR=192.168.1.2
LOCAL_CLUSTER_PORT=20000
CM_CLUSTER_MODE=ACTIVE_SHARED
CM_PORT=20005
THREAD=1
[Example 2.5] TAS Instance Clustering tip File Example: <cm1.tip>
CM_NAME=cm1
CM_UI_PORT=20005
CM_RESOUCE_FILE=/home/tibero/config/cm1_res.crf
After starting up a TAS instance in the NOMOUNT mode and creating a disk space, start up TBCM and then add clustering resources as in the following example. When adding the clustering resources, enter '+' followed by the disk path set in AS_DISKSTRING of the tip file for the cfile attribute, so that the path can be recognized as a path for TAS. When adding the as resource, create a configuration file that is required to execute the Active Storage (AS) binary as in [Example 2.6]. Enter the file path for the envfile attribute and TB_SID of the instance to start up for the name attribute.
[CM_SID=cm0]$ tbcm -b # TBCM startup [CM_SID=cm0]$ cmrctl add network --name net0 --ipaddr 192.168.1.1 --portno 20010 [CM_SID=cm0]$ cmrctl add cluster --name cls0 --incnet net0 --cfile "+/devs/disk*" [CM_SID=cm0]$ cmrctl start cluster --name cls0 [CM_SID=cm0]$ cmrctl add service --type as --name tas --cname cls0 [CM_SID=cm0]$ cmrctl add as --name as0 --svcname tas --envfile "$TB_HOME/as0.profile" --dbhome "$TB_HOME"
[Example 2.6] Creating a Configuration File for the as Resource: <as0.profile>
[CM_SID=cm0]$ cat $TB_HOME/as0.profile export TB_SID=as0
For more information about TBCM (Tibero Cluster Manager), refer to Tibero Administrator's Guide.
Cluster Manager is used to enhance availability and manageability as it allows seamless operation even when an instance fails in the Active Storage cluster.
Now the TAS instance with a TB_SID of 'as0' can be started up.
[CM_SID=cm0]$ cmrctl start as --name as0 # or [TB_SID=as0]$ tbboot
[CM_SID=cm0]$ cmrctl show # resource information check
Before starting up the TAS instance 'as1', the REDO thread must be added to the instance.
$ tbsql sys/tibero@as0 tbSQL 6 TmaxData Corporation Copyright (c) 2008-. All rights reserved. Connected to Tibero. SQL> ALTER DISKSPACE ds0 ADD THREAD 1; Diskspace altered.
'ds0' is the name of the default disk space created in the previous step. The REDO thread number "1" must be the same as the THREAD initialization parameter value in the tip file [Example 2.4] of TAS instance 'as1'.
Start up TBCM and add clustering resources as follows. The service resources added when CM_SID=cm0 do not need to be added.
[CM_SID=cm1]$ tbcm -b # TBCM startup [CM_SID=cm1]$ cmrctl add network --name net1 --ipaddr 192.168.1.2 --portno 20010 [CM_SID=cm1]$ cmrctl add cluster --name cls0 --incnet net1 --cfile "+/devs/disk*" [CM_SID=cm1]$ cmrctl start cluster --name cls0 [CM_SID=cm1]$ cmrctl add as --name as1 --svcname tas --envfile "$TB_HOME/as1.profile" --dbhome "$TB_HOME"
[Example 2.7] Creating a Configuration File for the as Resource: <as1.profile>
[CM_SID=cm1]$ cat $TB_HOME/as1.profile export TB_SID=as1
Now the TAS instance 'as1' can be started up.
[CM_SID=cm1]$ cmrctl start as --name as1 # or [TB_SID=as1]$ tbboot
[CM_SID=cm1]$ cmrctl show # resource information check
Run the tbdown command to shut down a TAS instance. tbdown shuts down all Tibero instances currently using that TAS instance.
If a TAS instance being used by a Tibero instance is shut down forcibly before the Tibero instance is shut down, the Tibero instance shuts down abnormally. To avoid this, shut down the Tibero instance first.
For a Tibero instance to use a TAS disk space, configure the following initialization parameters in the tip file of Tibero.
The following shows the tip file that is required for running a Tibero instance that uses a TAS instance. The Tibero instance that uses this tip file stores the control file in the disk space named 'ds0'.
[Example 2.8] Example of a Tibero Instance tip File that uses a TAS instance.
DB_NAME=tibero CONTROL_FILES="+DS0/c1.ctl" LISTENER_PORT=8629 MAX_SESSION_COUNT=20 TOTAL_SHM_SIZE=1G MEMORY_TARGET=2G USE_ACTIVE_STORAGE=Y AS_PORT=9620
When setting the DB_CREATE_FILE_DEST initialization parameter to "+{disk space name}", if the LOG_ARCHIVE_DEST, PSM_SHLIB_DIR, and JAVA_CLASS_PATH initialization parameters are not configured manually, then the child directories of DB_CREATE_FILE_DEST are set to their default values. Since TAS currently does not support directories, these parameters must be manually configured as in the following example.
DB_CREATE_FILE_DEST="+DS0" LOG_ARCHIVE_DEST="/home/tibero/database/tibero/archive/" PSM_SHLIB_DIR="/home/tibero/database/tibero/psm/" JAVA_CLASS_PATH="/home/tibero/database/tibero/java/"
The following example shows how to create a Tibero database that uses a TAS file. The paths of the files that make up the database, which are stored in the disk space "ds0", must be specified in the "+DS0/..." format.
[Example 2.9] Example of the CREATE DATABASE of the Tibero Instance that uses a TAS File
CREATE DATABASE "tibero" USER SYS IDENTIFIED BY tibero MAXINSTANCES 8 MAXDATAFILES 100 CHARACTER SET MSWIN949 LOGFILE GROUP 1 '+DS0/log0001.log' SIZE 100M, GROUP 2 '+DS0/log0002.log' SIZE 100M, GROUP 3 '+DS0/log0003.log' SIZE 100M MAXLOGGROUPS 255 MAXLOGMEMBERS 8 NOARCHIVELOG DATAFILE '+DS0/system001.dtf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED SYSSUB DATAFILE '+DS0/syssub001.dtf' SIZE 100M AUTOEXTEND ON NEXT 100M DEFAULT TEMPORARY TABLESPACE tmp TEMPFILE '+DS0/temp001.dtf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL AUTOALLOCATE UNDO TABLESPACE undo00 DATAFILE '+DS0/undo001.dtf' SIZE 100M AUTOEXTEND ON NEXT 100M EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT TABLESPACE usr DATAFILE '+DS0/usr001.dtf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL AUTOALLOCATE;
For more information about how to configure the initialization parameters of Tibero, refer to Tibero Reference Guide. For information about the CREATE DATABASE statement, refer to Tibero SQL Reference Guide.