Document Type | Technical Information
Category | Utility
Document Number | TUTTI009
Overview
The Tibero home directory (TB_HOME) is a system environment variable that contains location information for various configuration files and program files required when installing and running Tibero.
When you need to immediately identify the TB_HOME path from a DB session, this article introduces two methods to check the Tibero home directory using SQL or a simple PL/SQL function.
Method
1. Inferring TB_HOME by processing parameter values
NAMED_PIPE_DIR is a parameter that users generally do not change and sometimes points to the TB_HOME directory. You can estimate TB_HOME by using this value.SELECT NVL(SUBSTR(VALUE,1, INSTR(VALUE, '\', -1, 4) -1) , SUBSTR(VALUE, 1, INSTR(VALUE, '/', -1, 4) - 1)) TB_HOME FROM V$PARAMETERS WHERE NAME='NAMED_PIPE_DIR'; TB_HOME -------------------------------------------------------------------------------- D:\DB\tibero\tibero5 1 row selected. SQL>
2. Creating a function that calls a built-in package to check TB_HOME
2-1. Create a function that calls DBMS_SYSTEM.GET_SVR_ENV.
CREATE or REPLACE FUNCTION GET_ENV_VALUE(ENV_NAME IN VARCHAR2) RETURN VARCHAR2 IS ENV_VALUE VARCHAR2(100); BEGIN DBMS_SYSTEM.GET_SVR_ENV(ENV_NAME,ENV_VALUE); RETURN ENV_VALUE; END;
2-2. Call the created function.
SQL> SELECT GET_ENV_VALUE('TB_HOME') TB_HOME FROM DUAL;
TB_HOME
--------------------------------------------------------------------------------
/home/tibero/tibero5
1 row selected.
SQL>