Chapter 10. Tibero Active Cluster

Table of Contents

10.1. Overview
10.2. Components
10.3. Processes
10.4. Configuring a TAC Environment
10.5. Creating a Database for TAC
10.6. Executing TAC
10.6.1. Preparation for Execution
10.6.2. Creating a Database
10.6.3. Starting TAC
10.6.4. Monitoring TAC

This chapter describes Tibero Active Cluster's concepts, components, and processes, and explains how to use it.

Tibero Active Cluster (hereafter TAC) is the main feature of Tibero for providing high scalability and availability. All instances executed in a TAC environment execute transactions using a shared database. Access to the shared database is mutually controlled for data consistency and conformity.

Processing time can be reduced because a larger job can be divided into smaller jobs, and then the jobs can be performed by several nodes.

Multiple systems share data files based on shared disks. Nodes act as if they use a single shared cache by sending and receiving the data blocks necessary to organize TAC through a high speed private network that connects the nodes.

Even if a node stops while operating, other nodes will continue their services. This transition happens quickly and transparently.

The structure of TAC is shown below:


TAC consists of the following modules:

One process (ACSD, Active Cluster Service Daemon) is created in TACUAC. This process consists of ACCT, NMGR, DIAG, WRCF, CRCF, WLGC, CLGC, WATH, CATH, and CMPT threads. Each thread is included in the following groups:

The configuration for TAC includes settings for a single instance by default. Apart from the basic settings, the following initialization parameters should also be specified to use TAC:

<$TB_SID.tip>

MEMORY_TARGET=6144M
TOTAL_SHM_SIZE=4096M
DB_CACHE_SIZE=2048M
CLUSTER_DATABASE=Y
THREAD=0
UNDO_TABLESPACE=UNDO0
LOCAL_CLUSTER_ADDR=192.168.1.1
LOCAL_CLUSTER_PORT=12345
CM_PORT=30000
Initialization ParameterDescription
MEMORY_TARGETSize of the total memory. This value includes shared memory, memory used in sort and hash operations, and other memory used in the DBMS. Shared memory is allocated when the DBMS starts up. Remaining memory is allocated and deallocated as needed.
TOTAL_SHM_SIZETotal size of shared memory.
DB_CACHE_SIZETAC needs shared memory for other purposes besides buffer cache. Therefore, the total size of buffer cache must be less than the shared memory of a single instance. Typical size is about half of the total shared memory.
CLUSTER_DATABASE

Option to use TAC.

Must be set to Y.

THREADNumber of Redo threads. A unique number is allocated to each instance.
UNDO_TABLESPACEName of the Undo tablespace. A unique number is allocated to each instance.
LOCAL_CLUSTER_ADDRIP address used to communicate between TAC instances.
LOCAL_CLUSTER_PORTInternal port number used to communicate between TAC instances.
CM_PORTPort number for communication with CM. Must be the same as the value set in CM_UI_PORT, the CM initialization parameter.

Note the following about TAC:

TAC is a clustered database based on a shared disk. The database only needs to be created once by a single server because instances of several database servers use the same physical database files.

Instances of all servers read and write the same control and data files. However, in TAC, each instance has a separate file for Redo logs and Undo information to minimize data access on the shared disk. Redo logs and Undo information are saved by an instance of each server in a separate file, but they must exist on the shared disk because other instances also read them for recovery.

The process to create a database for TAC is as follows:

  1. Set a configuration file for Tibero and then start TBCM. For information about configuring and starting up CM, refer to “Chapter 9. Tibero Cluster Manager”.

    $ tbcm -b

    TBCM starts, but it cannot directly control Tibero.

  2. Start Tibero in NOMOUNT mode.

    $ tbboot -t NOMOUNT -c
  3. Connect with the SYS user and create a database with the CREATE DATABASE statement.

    [tibero@tester ~]$ tbsql sys/tibero
    
    SQL> CREATE DATABASE "ac"               ... (1) ...
         USER sys IDENTIFIED BY tibero
         MAXINSTANCES 8                        ... (2) ...
         MAXDATAFILES 256
         CHARACTER SET MSWIN949        
         LOGFILE GROUP 0 'log001' SIZE 50M,
         GROUP 1 'log011' SIZE 50M,
         GROUP 2 'log021' SIZE 50M
         MAXLOGFILES 100
         MAXLOGMEMBERS 8
         NOARCHIVELOG
         DATAFILE 'system001' SIZE 512M
         AUTOEXTEND ON NEXT 8M MAXSIZE 3G
         DEFAULT TEMPORARY TABLESPACE TEMP
         TEMPFILE 'temp001' SIZE 512M
         AUTOEXTEND ON NEXT 8M MAXSIZE 3G
         EXTENT MANAGEMENT LOCAL AUTOALLOCATE
         UNDO TABLESPACE UNDO0
         DATAFILE 'undo001' SIZE 512M
         AUTOEXTEND ON NEXT 8M MAXSIZE 3G
         EXTENT MANAGEMENT LOCAL AUTOALLOCATE
         
    Database created.

    (1) Specify the database name.

    (2) The maximum number of instances for a server is specified as 8.

    This is a standard CREATE DATABASE statement. However, note that the MAXINSTANCES parameter indicates the maximum number of instances that share the database files. This parameter value affects the headers of control and data files. Because only the number of instances of Tibero specified in this parameter can be created, allocate a sufficient amount of instances when the database is created.

    As described above, an instance of each server needs to have a separate Redo and Undo space. The Undo tablespace and Redo log file that are created when the CREATE DATABASE statement is executed are used for the first instance. Separate Redo log groups and Undo tablespaces need to be created for the other instances to access the database.

    The created Redo log group automatically becomes the zeroth Redo thread. Therefore, the initialization parameters THREAD and UNDO_TABLESPACE have to be specified in the server instance's environment configuration file $TB_SID.tip when the CREATE DATABASE statement is executed, as follows:

    THREAD=0
    UNDO_TABLESPACE=UNDO0
  4. After the CREATE DATABASE statement has been executed, Tibero is automatically terminated. The following example connects with the SYS user, creates an Undo tablespace and a Redo log group, and executes the DDL statement after Tibero restarts:

    [tibero@tester ~]$ tbboot
    [tibero@tester ~]$ tbsql sys/tibero
    
    SQL> CREATE UNDO TABLESPACE UNDO1
         DATAFILE 'undo011' SIZE 512M
         AUTOEXTEND ON NEXT 8M MAXSIZE 3G
         EXTENT MANAGEMENT LOCAL AUTOALLOCATE
         
    Tablespace 'UNDO1' created.
    SQL> ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 3 'log031' size 50M;
    Database altered.
    
    SQL> ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 4 'log041' size 50M;
    Database altered.
    
    SQL> ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 5 'log051' size 50M;
    Database altered.
    
    SQL> ALTER DATABASE ENABLE PUBLIC THREAD 1;     ... (1) ...
    Database altered.

    (1) The DDL statement that activates the Redo thread is executed.

    This DDL statement is the same as the standard DDL statement to add a Redo log group. However, note that it designates a THREAD number. This example adds the Undo tablespace UNDO1 used by the second instance and the Redo log group for the Redo thread 1 and activates them.

    Redo threads are designated with numbers starting from 1. The Redo log group created when the CREATE DATABASE statement is executed becomes the zeroth thread. The zeroth thread is automatically activated when the CREATE DATABASE statement is executed.

    Note

    Note that the numbering of Redo log groups must be unique across the entire database, not just within a Redo thread. Therefore, 0, 1, and 2 cannot be used. At least two Redo log groups must exist to activate the corresponding Redo thread. To add another instance, create an Undo tablespace and a Redo thread and activate the thread as shown above.

  5. If DB_CREATE_FILE_DEST is not properly specified in a TAC raw device environment or a shared file system, Tibero may not start normally.

    If Tibero does not start normally, first add the tablespace (SYSSUB) where TPR-related information is saved as follows:

    [tibero@tester ~]$ tbsql sys/tibero
    
    SQL> CREATE TABLESPACE SYSSUB DATAFILE '<SYSSUB Path>/syssub001.dtf' ...;
         
    Tablespace 'SYSSUB' created.

    Note

    If this step is omitted and the next step is executed, refer to "Chapter 7. TAC Installation and Uninstallation" and "Appendix A. Troubleshooting" in Tibero Installation Guide.

  6. Execute the script file system.sh in the directory $TB_HOME/scripts. In the Windows environment, system.vbs should be executed.

    [tibero@tester scripts]$ system.sh $TB_HOME/bin/tbsvr
    Creating the role DBA...
    Creating system users & roles...
    Creating virtual tables(1)...
    Creating virtual tables(2)...
    Granting public access to _VT_DUAL...
    Creating the system generated sequences...
    Creating system packages:
        Running /home/tibero/tibero6/scripts/pkg_standard.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_output.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_lob.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_utility.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_obfuscation.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_transaction.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_random.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_lock.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_system.sql...
        Running /home/tibero/tibero6/scripts/pkg_dbms_job.sql...
        Running /home/tibero/tibero6/scripts/pkg_utl_raw.sql...
        Running /home/tibero/tibero6/scripts/pkg_utl_file.sql...
        Running /home/tibero/tibero6/scripts/pkg_tb_utility.sql...
    Creating public synonyms for system packages...
        ............................................

This section describes preparations for TAC execution and explains how to create a database and start and monitor TAC.

When TAC starts, a database should be created in a node that will be used in the cluster. TBCM is required when Tibero starts with TAC. Therefore, start TBCM first, and then start Tibero in NOMOUNT mode. For information about configuring CM, refer to “Chapter 9. Tibero Cluster Manager”.

The following example initializes TBCM, and then starts Tibero in NOMOUNT mode:

tac1@tester ~]$ tbboot -t NOMOUNT
listener port = xxxx
change core dump dir to /home/tibero6/bin/prof

Tibero 6 

TmaxData Corporation Copyright (c) 2008-. All rights reserved.

Tibero instance started up (NOMOUNT mode).

tac1@tester ~]$ 

A database is created by accessing the first TAC instance that starts in NOMOUNT mode, and then Redo and Undo logs for other instances are created. They must have the same names as specified in the initialization parameters THREAD and UNDO_TABLESPACE in the configuration file $TB_SID.tip.