Document Type | Technical Information
Category | Patch/Upgrade
Applicable Product Version | Tibero7.2.4
Document Number | TPATI002
Overview
This document is a guide that summarizes the procedures and precautions for performing Tibero Patch in a Linux environment.
Patch work only applies when system safety must be ensured due to issues during operation, such as the following, and it is strongly recommended to request technical support through the call center and sales representative and receive support from an engineer.
Note
Serious internal errors Performance issues Lack of functions or function improvements
Method
Patch Procedure
The patch work procedure is as follows. The major steps are the same, but there may be slight differences depending on the Tibero configuration method (SINGLE/TAC/HA).
Note
Pre-check before patch Perform patch work, verification, and monitoring If problems occur after applying the patch, perform emergency restoration (โป proceed in reverse order of the patch procedure)
Pre-check before Patch
This section explains the pre-check items before patching.
Check passwords for SYS, SYSCAT (accounts with DBA privileges)
If the default accounts with DBA privileges (SYSCAT, TIBERO) are locked due to security issues, request the DBA or person in charge to unlock the accounts.
# USER Unlock
SQL col username for a20
SQL select username, account_status from dba_users where username in ('SYSCAT','TIBERO');
SQL ALTER USER SYSCAT ACCOUNT UNLOCK;
SQL ALTER USER TIBERO ACCOUNT UNLOCK;
Check Object Invalid before Patch
During the patch process, patch tasks are performed, and existing Valid objects may change to Invalid. Therefore, before patching, object verification is done to compare objects before and after patching and change them to Valid.
# Check Object Status
SQL col owner for a20
SQL col object_name for a40
SQL set linesize 200
SQL set pagesize 10000
SQL select owner, object_name, object_type, status
from dba_objects
where status='INVALID'
order by 1,3,2,4;
Check Data File Location
Caution
If the data files are located inside the $TB_HOME path, query the following and after replacing the binary to be patched, move it to the same path. However, the DB must be properly shut down before moving.
SQL select file_name from dba_data_iles;
Check DB Link Usage
ex) For Tibero to Oracle DB Link (ps -ef | grep gw4orcl)
ora_link_remote=(
(GATEWAY=(LISTENER=(HOST=12.34.56.78)
(PORT=9999))
(TARGET=orcl)
(TX_MODE=GLOBAL))
)
ex) For Tibero to MS-SQL DB Link (ps -ef | grep tbgw)
mssql_link_remote=(
(GATEWAY=(LISTENER=(HOST=12.34.56.78)
(PORT=9093))
(TARGET=12.34.56.87:1433:master)
(TX_MODE=LOCAL))
)
ex) For Tibero to MySQL DB Link (ps -ef | grep tbgw)
mysql_link_remote=(
(GATEWAY=(LISTENER=(HOST=12.34.56.78)
(PORT=9093))
(TARGET=12.34.56.87:3306:mydb)
(TX_MODE=LOCAL))
)
ex) For Tibero to DB2 DB Link (ps -ef | grep gw4db2)
db2_link_remote=(
(GATEWAY=(LISTENER=(HOST=12.34.56.78)
(PORT=9999))
(TARGET=sample)
(TX_MODE=GLOBAL))
)
Check External Procedure Usage
ex) Check C External Procedure
SQL col owner for a10
SQL col library_name for a30
SQL col file_spec for a50
SQL select * from dba_libraries;
OWNER LIBRARY_NAME FILE_SPEC STATUS
---------- ------------------------------ -------------------------------------------------- -------
SYS EXTPROC /home/tibero7/tibero_engine/libextproc.so VALID
1 row selected.
ex) Check Java External Procedure
JAVA_CLASS_PATH=/home/tibero/tibero7/instance/tibero/java can be checked in tip file
SQL col owner for a10
SQL col name for a30
SQL col source for a50
SQL select owner, name, source from dba_java_classes;
OWNER NAME SOURCE
---------- ------------------------------ -------------
SYS SimpleMath JavaExtproc
1 row selected.
Perform Patch Work, Verification, and Monitoring
Patch Work Procedure
SINGLE
1. Perform patch tasks before binary replacement
- Occasionally, patch tasks need to be performed before binary replacement. If they exist, perform before shutdown; if not, they can be skipped.
2. Stop AP (service)
- Performed by the customer. After stopping, recheck via V$SESSION or GV$SESSION to ensure no running sessions remain.
3. Shut down Tibero
# Before shutdown, ensure all data changes are flushed from memory to disk.
SQL alter system switch logfile ;
SQL alter system checkpoint ;
SQL tbdown immediate;
# Shutdown DB Link gateway
ps -ef | grep gw4orcl
kill -9 [PID]
# Confirm Tibero process shutdown
ps -ef | grep tbsvr
# Confirm DB Link Gateway shutdown
ps -ef | grep gw4orcl
# Confirm other processes (epa, jepa, etc.) shutdown
ps -ef | grep java4. Replace Tibero binary
# Backup before binary replacement in tibero7_date format
mv ${TB_HOME} ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)
cd ${TB_HOME%/*}
# Extract and replace binary archive
gzip -dc [binary file].tar.gz.filepart | tar -xvf -5. COPY DB environment settings (tip, tbdsn.tbr, cfg, license, etc.) and DB Link related Gateways from ASIS server to TOBE server
# These are essential environment setting files for DB startup and must be moved.
cd $TB_HOME/config
sh gen_tip.sh
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/config/*.tip $TB_HOME/config/
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/client/config/tbdsn.tbr $TB_HOME/client/config/
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/license/*.xml $TB_HOME/license/
# Optional after verification
ex) Jepa
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/client/epa/java/config/epa.cfg ${TB_HOME}/client/epa/java/config
ex) DB Link Gateway (Tibero to Oracle)
mv ${TBGW_HOME}/gw4orcl ${TBGW_HOME}/gw4orcl_$(date +%Y%m%d)
cp ${TB_HOME%/*}/tibero7/client/bin/gw4orcl ${TBGW_HOME}/gw4orcl
ex) DB Link Gateway (Tibero to etc)
mv ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW/tbJavaGW ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW/tbJavaGW_$(date +%Y%m%d)
cp ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW.zip ${TBGW_HOME}/tibero7/client/bin/tbJavaGW.zip6. Start Tibero
tbboot
# Confirm startup
ps -ef | grep tbsvr7. Perform patch tasks
Caution
The following is a partial example of patch tasks. The task list must be confirmed with an engineer in advance and performed, and must never be applied to a live operating DB.
[t7_1]tibero7@tibero_raw:/home/tibero7/ tbsql sys
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Enter Password:
Connected to Tibero.
ex) SQL @$TB_HOME/scripts/tpr_stop.sql8. Change objects that became Invalid back to Valid and recheck object status
SQL begin
for obj in (select object_type, owner, object_name from dba_objects where STATUS = 'INVALID') loop
BEGIN
if obj.object_type = 'VIEW' then
execute immediate 'alter view "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'PROCEDURE' then
execute immediate 'alter procedure "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'FUNCTION' then
execute immediate 'alter function "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'PACKAGE' or obj.object_type = 'PACKAGE BODY' then
execute immediate 'alter package "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'TRIGGER' then
execute immediate 'alter trigger "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'TYPE' or obj.object_type = 'TYPE BODY' then
execute immediate 'alter type "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type='SYNONYM' then
if obj.owner='PUBLIC' then
execute immediate 'alter public synonym "' || obj.object_name || '" compile';
else
execute immediate 'alter synonym "' || obj.owner || '"."' || obj.object_name || '" compile';
end if;
end if;
exception
when others then
null;
end;
end loop;
end;
/
# After compiling, recheck Object Status
SQL col owner for a20
SQL col object_name for a40
SQL set linesize 200
SQL set pagesize 10000
SQL select owner, object_name, object_type, status
from dba_objects
where status='INVALID'
order by 1,3,2,4;
9. Start AP (service)
- Performed by the customer to start service after patching
2-Node TAC (Active-Active)
Caution
In TAC configuration, multiple nodes may exist, but ultimately there is one DB. Before performing patch tasks in step 7, shut down the other nodes and run only one node to perform the patch tasks. However, binary replacement and environment setting files must be replaced identically on all nodes.
ex) In a 2Node-TAC configuration, before performing tasks, Node2 is down and only Node1 is running to perform the tasks.
If Auto-Restart is enabled for resources such as TAS Service or DB Service, change the service to deact before shutting down the DB.
ex) [t7_1]tibero7@tibero_raw:/home/tibero7 cmrctl show
Resource List of Node cm1
===========================================================
CLUSTER TYPE NAME STATUS DETAIL
---------- -------- -------------- ------------- ----------------------------------------------------t7_cls service t7 UP Database, Active Cluster (auto-restart: ON)
[t7_1]tibero7@tibero_raw:/home/tibero7 cmrctl deact service --name t7
Auto-boot mode is deactivated (t7)===========================================================
CLUSTER TYPE NAME STATUS DETAIL
---------- -------- -------------- ------------- ----------------------------------------------------t7_cls service t7 UP Database, Active Cluster (auto-restart: OFF)
3. Shut down Tibero on each node (Perform on all nodes)
# Before shutdown, ensure all data changes are flushed from memory to disk on each node.
SQL alter system switch logfile ;
SQL alter system checkpoint ;
SQL tbdown immediate;
# Shutdown DB Link gateway
ps -ef | grep gw4orcl
kill -9 [PID]
# Confirm Tibero process shutdown
ps -ef | grep tbsvr
# Confirm DB Link Gateway shutdown
ps -ef | grep gw4orcl
# Confirm other processes (epa, jepa, etc.) shutdown
ps -ef | grep java4. Replace Tibero binary (Perform on all nodes)
# Backup before binary replacement in tibero7_date format
mv ${TB_HOME} ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)
cd ${TB_HOME%/*}
# Extract and replace binary archive
gzip -dc [binary file].tar.gz.filepart | tar -xvf -5. COPY DB environment settings (tip, tbdsn.tbr, cfg, license, etc.) and DB Link related Gateways from ASIS server to TOBE server (Perform on all nodes)
# These are essential environment setting files for DB startup and must be moved.
cd $TB_HOME/config
sh gen_tip.sh
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/config/*.tip $TB_HOME/config/
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/client/config/tbdsn.tbr $TB_HOME/client/config/
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/license/*.xml $TB_HOME/license/
# Optional after verification
ex) Jepa
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/client/epa/java/config/epa.cfg ${TB_HOME}/client/epa/java/config
ex) DB Link Gateway (Tibero to Oracle)
mv ${TBGW_HOME}/gw4orcl ${TBGW_HOME}/gw4orcl_$(date +%Y%m%d)
cp ${TB_HOME%/*}/tibero7/client/bin/gw4orcl ${TBGW_HOME}/gw4orcl
ex) DB Link Gateway (Tibero to etc)
mv ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW/tbJavaGW ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW/tbJavaGW_$(date +%Y%m%d)
cp ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW.zip ${TBGW_HOME}/tibero7/client/bin/tbJavaGW.zip6. Start Tibero (Start only Node1)
tbboot
# Confirm startup
ps -ef | grep tbsvr7. Perform patch tasks
Caution
The following is a partial example of patch tasks. The task list must be confirmed with an engineer in advance and performed, and must never be applied to a live operating DB.
[t7_1]tibero7@tibero_raw:/home/tibero7/ tbsql sys
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Enter Password:
Connected to Tibero.
ex) SQL @$TB_HOME/scripts/tpr_stop.sql8. Change objects that became Invalid back to Valid and recheck object status
SQL begin
for obj in (select object_type, owner, object_name from dba_objects where STATUS = 'INVALID') loop
BEGIN
if obj.object_type = 'VIEW' then
execute immediate 'alter view "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'PROCEDURE' then
execute immediate 'alter procedure "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'FUNCTION' then
execute immediate 'alter function "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'PACKAGE' or obj.object_type = 'PACKAGE BODY' then
execute immediate 'alter package "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'TRIGGER' then
execute immediate 'alter trigger "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'TYPE' or obj.object_type = 'TYPE BODY' then
execute immediate 'alter type "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type='SYNONYM' then
if obj.owner='PUBLIC' then
execute immediate 'alter public synonym "' || obj.object_name || '" compile';
else
execute immediate 'alter synonym "' || obj.owner || '"."' || obj.object_name || '" compile';
end if;
end if;
exception
when others then
null;
end;
end loop;
end;
/
# After compiling, recheck Object Status
SQL col owner for a20
SQL col object_name for a40
SQL set linesize 200
SQL set pagesize 10000
SQL select owner, object_name, object_type, status
from dba_objects
where status='INVALID'
order by 1,3,2,4;
HA Configuration (Active-StandBy)
- HA configuration can be divided as below, and patch procedure is explained only for case 1).
Caution
Before patching, be sure to request the cluster engineer to disable the failover function, and after patch completion, enable the failover function and perform testing.
- case1) When only the Data area is shared
ใด When failing over to StandBy, only the Data area is (de)attached, so the StandBy node also has the Tibero Engine and must perform all procedures.
- case2) When both Engine and Data areas are shared
ใด When failing over to StandBy, both Engine and Data areas are (de)attached, so the StandBy node does not need to perform all procedures.
3. Shut down Tibero on each node (Perform on Active Node)
# Before shutdown, ensure all data changes are flushed from memory to disk.
SQL alter system switch logfile ;
SQL alter system checkpoint ;
SQL tbdown immediate;
# Shutdown DB Link gateway
ps -ef | grep gw4orcl
kill -9 [PID]
# Confirm Tibero process shutdown
ps -ef | grep tbsvr
# Confirm DB Link Gateway shutdown
ps -ef | grep gw4orcl
# Confirm other processes (epa, jepa, etc.) shutdown
ps -ef | grep java4. Replace Tibero binary (Perform on both Active and StandBy Nodes)
# Backup before binary replacement in tibero7_date format
mv ${TB_HOME} ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)
cd ${TB_HOME%/*}
# Extract and replace binary archive
gzip -dc [binary file].tar.gz.filepart | tar -xvf -5. Replace DB environment setting files on each node (Perform on both Active and StandBy Nodes)
# These are essential environment setting files for DB startup and must be moved.
cd $TB_HOME/config
sh gen_tip.sh
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/config/*.tip $TB_HOME/config/
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/client/config/tbdsn.tbr $TB_HOME/client/config/
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/license/*.xml $TB_HOME/license/
# Must be applied identically to StandBy node for consistent use of epa, link, etc. after failover
ex) Jepa
cp ${TB_HOME%/*}/tibero7_$(date +%Y%m%d)/client/epa/java/config/epa.cfg ${TB_HOME}/client/epa/java/config
ex) DB Link Gateway (Tibero to Oracle)
mv ${TBGW_HOME}/gw4orcl ${TBGW_HOME}/gw4orcl_$(date +%Y%m%d)
cp ${TB_HOME%/*}/tibero7/client/bin/gw4orcl ${TBGW_HOME}/gw4orcl
ex) DB Link Gateway (Tibero to etc)
mv ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW/tbJavaGW ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW/tbJavaGW_$(date +%Y%m%d)
cp ${TB_HOME%/*}/tibero7/client/bin/tbJavaGW.zip ${TBGW_HOME}/tibero7/client/bin/tbJavaGW.zip6. Start Tibero (Perform on Active Node)
tbboot
# Confirm startup
ps -ef | grep tbsvr7. Perform patch tasks
Caution
The following is a partial example of patch tasks. The task list must be confirmed with an engineer in advance and performed, and must never be applied to a live operating DB.
[t7_1]tibero7@tibero_raw:/home/tibero7/ tbsql sys
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Enter Password:
Connected to Tibero.
ex) SQL @$TB_HOME/scripts/tpr_stop.sql8. Change objects that became Invalid back to Valid
SQL begin
for obj in (select object_type, owner, object_name from dba_objects where STATUS = 'INVALID') loop
BEGIN
if obj.object_type = 'VIEW' then
execute immediate 'alter view "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'PROCEDURE' then
execute immediate 'alter procedure "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'FUNCTION' then
execute immediate 'alter function "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'PACKAGE' or obj.object_type = 'PACKAGE BODY' then
execute immediate 'alter package "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'TRIGGER' then
execute immediate 'alter trigger "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type = 'TYPE' or obj.object_type = 'TYPE BODY' then
execute immediate 'alter type "' || obj.owner || '"."' || obj.object_name || '" compile';
elsif obj.object_type='SYNONYM' then
if obj.owner='PUBLIC' then
execute immediate 'alter public synonym "' || obj.object_name || '" compile';
else
execute immediate 'alter synonym "' || obj.owner || '"."' || obj.object_name || '" compile';
end if;
end if;
exception
when others then
null;
end;
end loop;
end;
/
# After compiling, recheck Object Status
SQL col owner for a20
SQL col object_name for a40
SQL set linesize 200
SQL set pagesize 10000
SQL select owner, object_name, object_type, status
from dba_objects
where status='INVALID'
order by 1,3,2,4;
Restore if Problems Occur in DB after Patch Completion
Note
Proceed in reverse order of the patch procedure.
If patch work fails or problems occur in the DB after completion, it may be necessary to restore to the previous binary before patching. In this case, restoration must be performed only after confirming symptoms with an engineer.
Patch Restoration Work Procedure