Table of Contents
The file tbdsn.tbr is a configuration file that includes the information necessary for clients to access Tibero's database.
By default, the file tbdsn.tbr contains information such as SIDs, IP addresses, and port numbers.
An example is shown below:
tb=( (INSTANCE=(HOST=168.1.1.33) (PORT=8629) (DB_NAME=tibero) ) )
tbdsn.tbr has the following structure:
SID_1=( (INSTANCE=(item1=value1) (item2=value2) ... ) ) SID_2=( (INSTANCE=(item1=value1) (item2=value2) ... ) ) TB_LANG=EUCKR TBCLI_LOG_LVL=TRACE TBCLI_LOG_DIR=/home/test/log ...
An SID is a unique name that identifies a corresponding server for a client and includes detailed information about the server. Multiple SIDs can be listed.
In tbdsn.tbr, alphabetical characters (A - Z, a - z), digits (0 - 9), and hyphens (-) can be used for an SID.
Detailed information about SIDs is shown below:
Item | Description |
---|---|
HOST | IP address of a server. (Example: HOST=168.1.1.33) |
PORT | Port number of a server. (Example: PORT=8629) |
DB_NAME | Name of a database. (Example: DB_NAME=tibero) |
A client environment can also be specified in the file tbdsn.tbr without environment variables. If the environment is specified in both the file and with variables, the configuration in the file takes precedence.
Item | Description |
---|---|
TB_LANG | Character set used by a client. (Example: TB_LANG=EUCKR) |
TBCLI_LOG_LVL | Log level of CLI. (Example: TBCLI_LOG_LVL=TRACE) |
TBCLI_LOG_DIR | Directory that stores CLI logs can be specified. The default directory is c:\ for Windows and /tmp for UNIX. (Example: TBCLI_LOG_DIR=/home/test/log) |
Replication servers are multiple physically independent servers that are replicated. Any replicated servers can be accessed. A replicated server can be replaced with another replicated server when it is terminated.
To configure a replication server in tbdsn.tbr, specify each server with an INSTANCE entry with a single SID. CTF (Connection Time Failover) is always supported for the SID configured for the replication server.
tb=( (INSTANCE=(HOST=168.1.1.33) (PORT=8629) (DB_NAME=tibero) ) (INSTANCE=(HOST=192.168.1.25) (PORT=8629) (DB_NAME=tibero2) ) (INSTANCE=(HOST=localhost) (PORT=8629) (DB_NAME=tibero) )
Tibero provides load balancing to prevent a single server from being accessed too much. It prevents heavy loads on a system by distributing access to multiple servers.
Load balancing is specified in tbdsn.tbr as follows:
tb=( (INSTANCE=(HOST=168.1.1.33) (PORT=8629) (DB_NAME=tibero) ) (INSTANCE=(HOST=192.168.1.25) (PORT=8629) (DB_NAME=tibero2) ) (INSTANCE=(HOST=localhost) (PORT=8629) (DB_NAME=tibero) ) (LOAD_BALANCE=Y) )
As in the above example, if LOAD_BALANCE is specified as Y, the load balancing function is enabled. If it is specified as another value or omitted, the function is not used.
If Tibero terminates due to a failure when it is part of a TAC or is a replication server, the CLI module automatically recovers the corresponding session by accessing another instance or replicated server.
Failover is specified in tbdsn.tbr as follows:
tb=( (INSTANCE=(HOST=168.1.1.33) (PORT=8629) (DB_NAME=tibero) ) (INSTANCE=(HOST=192.168.1.25) (PORT=8629) (DB_NAME=tibero2) ) (INSTANCE=(HOST=localhost) (PORT=8629) (DB_NAME=tibero) ) (USE_FAILOVER=Y) (FORCE_FAILOVER_DELAY=10) )
As in the above example, if USE_FAILOVER is specified as Y, the failover function is enabled. However, recovery at the statement level is not supported.
FORCE_FAILOVER_DELAY is a failover option that can be used to cause a delay (in sec) before attempting to connect to another instance or replicated server. In the previous example, there will be a 10 second delay before failing over to another instance.
1. Connection Time Failover (CTF) is not related to the USE_FAILOVER configuration, and is supported for the SID configured as a replication server.
2. If the server is not started up in normal mode when connecting to the server using the USE_FAILOVER setting, the ERROR_CLIMSG_REDIRECT error occurs. In such a case, the target server to connect to must be explicitly specified.