SlideShare a Scribd company logo
1 of 21
Download to read offline
—
Tuning and Monitoring
—
Tibero SQL Operations Plan
Guide
2014. 06. 20.
Tuning and Monitoring
Better Technology, Better Tomorrow
2
Table of Contents
1. Viewing SQL Query Execution Result using SQL Trace and tbPROF...........................................................................................................3
1.1. Using the SQL_TRACE parameter.............................................................................................................................................................3
1.1.1. Setting the SQL_TRACE parameters...........................................................................................................................................3
1.1.2. Verifying the Created SQL Trace File..........................................................................................................................................5
1.1.3. Executing the tbPROF Command................................................................................................................................................5
1.1.4. Analyzing the Output File after Executing tbPROF.................................................................................................................6
1.2. Using the SET_SQL_TRACE_IN_SESSION Procedure............................................................................................................................8
2. Using Autotrace in tbSQL...................................................................................................................................................................................12
3. Using V$SQL_PLAN .............................................................................................................................................................................................16
4. Others.....................................................................................................................................................................................................................18
4.1. The SQL_TRACE_DEST Parameter.........................................................................................................................................................18
4.2. Privilege Issues when using AUTOTRACE in TBSQL ..........................................................................................................................18
Tuning and Monitoring
Better Technology, Better Tomorrow
3
Tibero SQL Execution Plan Guide
1. Viewing SQL Query Execution Results using SQL Trace and tbPROF
To collect SQL execution information, SQL trace files can be created statically or dynamically using SQL_TRACE
parameters.
- SQL statement executions are traced.
- A target statement for tuning can be easily found in the execution plan.
- Since the contents of a SQL trace are stored in a file, a query process can be slow.
1.1. Using the SQL_TRACE parameter
1.1.1. Setting the SQL_TRACE parameters
SQL_TRACE determines whether to record SQL trace information. An SQL trace enables profiling of SQL execution
information. However, using this function can severely impact performance, so it is recommended not to use this
function in the real production environment.
Property Description
Type Boolean
Default Value N
Class Optional, Adjustable, Dynamic, Session
Configuration Method Configure the TIP file and restart the server, or change the value using the
ALTER statement.
Syntax • • TIP File
- SQL_TRACE={Y|N}
• • ALTER Statement
- ALTER SYSTEM SET SQL_TRACE={Y|N}
- ALTER SESSION SET SQL_TRACE={Y|N}
 Examples
-- Query the SQL_TRACE information in V$SESSION.
SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS')
LOGON_TIME
FROM V$SESSION
ORDER BY LOGON_TIME;
SID SERIAL# USERNAME SQL_TRACE LOGON_TIME
---------- ---------- --------- --------- -----------
9 4 SYS ENABLED 18 15:43:29
20 83 SYS ENABLED 18 15:44:47
19 567 SYS DISABLED 18 15:52:50
3 rows selected.
-- Use a text editor to modify the %$TB_HOME%/config/%TB_SID%.tip file.
-- Set SQL_TRACE=Y and restart Tibero via tbboot.
#-------------------------------------------------------------------------------
#
# RDBMS initialization parameter
#
Tuning and Monitoring
Better Technology, Better Tomorrow
4
#-------------------------------------------------------------------------------
DB_NAME=tibero
LISTENER_PORT=8629
CONTROL_FILES="C:/Tibero/tbdata/c1.ctl"
CERTIFICATE_FILE="C:/Tibero/tibero5/config/svr_wallet/tibero.crt"
#PRIVKEY_FILE="C:/Tibero/tibero5/config/svr_wallet/tibero.key"
#WALLET_FILE="C:/Tibero/tibero5/config/svr_wallet/WALLET"
DB_CREATE_FILE_DEST=C:/Tibero/tbdata
LOG_ARCHIVE_DEST= C:/Tibero/arch
MAX_SESSION_COUNT=10
TOTAL_SHM_SIZE=512M
UNDO_RETENTION=900
_TSN_TIME_MAP_SIZE=1000
SQL_TRACE=Y
---------------------------------------------------------------------------------
-- Access tbSQL.
$ tbsql sys/tibero
tbSQL 5
Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved.
Connected to Tibero.
-- Verify that SQL_TRACE has been set to Y using the V$SESSION view.
SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS')
LOGON_TIME
FROM V$SESSION
ORDER BY LOGON_TIME;
SID SERIAL# USERNAME SQL_TRACE LOGON_TIME
---------- ---------- --------- --------- -----------
9 4 SYS ENABLED 18 15:43:29
20 83 SYS ENABLED 18 15:44:47
19 567 SYS ENABLED 18 15:52:50
3 rows selected.
-- Set SQL_TRACE=Y and execute an SQL query.
SQL> SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id,
d.department_name
FROM departments d
LEFT OUTER JOIN employees e
ON(e.department_id=d.department_id);
Tuning and Monitoring
Better Technology, Better Tomorrow
5
1.1.2. Verifying the Created SQL Trace File
The trace file is placed in the following directory with the '.trc' extension.
 File Location: $TB_HOME/instance/$TB_SID/log/sqltrace
 File Naming Rule
- A file name is created using the PID, SID, and serial# of the session.
E.g., tb_sqltrc_PID_SID_serial#.trc
- The PID, SID, and serial# information can be queried using the v$session view.
-- Query the PID, SID, and serial# information using the V$SESSION view.
SQL> SELECT PID, SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD
HH24:MI:SS') LOGON_TIME
FROM V$SESSION
ORDER BY LOGON_TIME;
PID SID SERIAL# USERNAME SQL_TRACE LOGON_TIME
---------- ---------- --------- --------- ---------- ------------
3179 9 4 SYS ENABLED 18 15:43:29
3180 20 83 SYS ENABLED 18 15:44:47
3181 19 567 SYS ENABLED 18 15:52:50
3 rows selected.
-- Check the tb_sqltrc_3181_19_567.trc file created in the
$TB_HOME/instance/$TB_SID/log/sqltrace directory.
$ cd tibero5/instance/tibero/log/sqltrace
$ ls
tb_sqltrc_3180_1_3.trc tb_sqltrc_3181_20_3524.trc
tb_sqltrc_3180_9_4.trc tb_sqltrc_3181_20_83.trc
tb_sqltrc_3181_19_2766.trc tb_sqltrc_3181_21_7024.out
tb_sqltrc_3181_19_442.trc tb_sqltrc_3181_21_7024.trc
tb_sqltrc_3181_19_50.trc tb_sqltrc_3181_21_7829.trc
tb_sqltrc_3181_19_567.trc tb_sqltrc_3183_4_0.trc
1.1.3. Executing the tbPROF Command
This command provides the information about the SQL in the parse, execution, and fetch stages. It sorts the
result of the user-specified field to display the result.
The following is an example of checking the tbPROF parameters and executing the tbPROF command.
 Checking the tbPROF parameter
$ tbprof
Usage: tbprof tracefile outputfile [print= ] [sort= ] [aggregate= ]
print=integer List only the first 'integer' SQL statements.
sys=yes|no Filter SQL statements that 'SYS' user executes.
aggregate=yes|no Aggregate statistics of same SQL statements.
sort=option Set of zero or more of the following sort options:
prscnt number of times parse was called
prscpu cpu time parsing
prsela elapsed time parsing
prsdsk number of disk reads during parse
prsqry number of buffers for consistent read during parse
prscu number of buffers for current read during parse
execnt number of execute was called
Tuning and Monitoring
Better Technology, Better Tomorrow
6
execpu cpu time spent executing
exeela elapsed time executing
exedsk number of disk reads during execute
exeqry number of buffers for consistent read during execute
execu number of buffers for current read during execute
exerow number of rows processed during execute
fchcnt number of times fetch was called
fchcpu cpu time spent fetching
fchela elapsed time fetching
fchdsk number of disk reads during fetch
fchqry number of buffers for consistent read during fetch
fchcu number of buffers for current read during fetch
fchrow number of rows fetched
userid userid of user that parsed the cursor
Item Description Default
tracefile
Name of the file that contains statistical information created by the SQL
trace.
-
outputfile Uses tbPROF to format the contents of the trace file into a readable text file. -
print Prints the trace results of the specified number of SQL statements only. ALL
sys Determines whether to list the SQL statements issued by the user SYS. yes
aggregate Determines whether to aggregate the information of the same SQL. no
sort
Determines the result sort method.
- Depending on SORT_OPTION, sorts results in descending order.
- More than one option can be specified. Fields are separated by a comma
',' and cannot contain whitespace.
-
1.1.4. Analyzing the Output File after Executing tbPROF
Use tbPROF to analyze the information of the SQL executed. Check the information about the executed SQL
statements including statistical information and execution plans in the output file.
 Creating an output file using tbPROF
$tbprof tbprof tb_sqltrc_3181_19_567.trc tb_sqltrc_3181_19_567.out sys=no
TBPROF 5
Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved.
$
 Checking the output file
$ vi tb_sqltrc_3181_19_567.out
TBPROF 5
Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved.
input file name : tb_sqltrc_3181_21_7024.trc
output file name : tb_sqltrc_3181_21_7024.out
sort option : default
aggregate : no
Tuning and Monitoring
Better Technology, Better Tomorrow
7
sys : no
print : all
=================================================================
count: number of times the procedure was executed
cpu: CPU time(seconds).
this is not quite accurate due to threaded architecture
elapsed: Total time elapsed (seconds)
disk: number of physical reads from disk
query: number of blocks for consistent read
current: number of blocks in current mode
rows: number of rows processed
=================================================================
UserID:20
SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id,
d.department_name
FROM departments d
LEFT OUTER JOIN employees e
ON(e.department_id=d.department_id)
stage count cpu elapsed current query disk rows
-----------------------------------------------------------------------------
parse 1 0.00 0.00 0 0 0 0
exec 1 0.00 0.00 0 0 0 0
fetch 1 0.00 0.00 0 10 0 20
-----------------------------------------------------------------------------
sum 3 0.00 0.00 0 10 0 20
- cpu: CPU time. (sec)
- elapsed: Total time elapsed. (sec)
- current: Number of current blocks retrieved.
- query: Number of cr blocks retrieved.
- disk: Number of physical reads from disk.
- rows: Number of rows processed
rows execution plan
----------------------------------------------------------
20 index join (left outer) (et=93, cr=0, cu=0, co=4, cpu=0, ro=20)
8 table access (rowid) DEPARTMENTS(1749) (et=426, cr=1, cu=0, co=2, cpu=0, ro=8)
8 index (full) DEPT_ID_PK(1750) (et=52, cr=1, cu=0, co=1, cpu=0, ro=8)
19 table access (rowid) EMPLOYEES(1755) (et=354, cr=7, cu=0, co=2, cpu=0, ro=2)
19 index (range scan) EMP_DEPARTMENT_IX(1764) (et=125, cr=1, cu=0, co=1, cpu=0, ro=2)
*******************************************************************************
OVERALL TOTAL
stage count cpu elapsed current query disk rows
-----------------------------------------------------------------------------
parse 1 0.00 0.00 0 0 0 0
exec 1 0.00 0.00 0 0 0 0
fetch 1 0.00 0.00 0 10 0 20
-----------------------------------------------------------------------------
sum 3 0.00 0.00 0 10 0 20
*******************************************************************************
1 SQL statements in trace file.
1 unique SQL statements in trace file.
Tuning and Monitoring
Better Technology, Better Tomorrow
8
16 lines in trace file.
 tbPROF Statistics Information
Call Value Description
Parse
- Converts the SQL statement into an execution plan, including checks for tables,
columns, and reference objects.
Execute
- Executes INSERT, UPDATE, and DELETE statements, which modify the data
according to the execution plan.
- Indicates the number of selected rows during execution of the statement.
Fetch
- Indicates the number of rows returned by a query.
- Fetches are performed for SELECT statements.
Argument Description
Count - Number of times an SQL statement was parsed, executed, or fetched.
CPU - CPU time spent to parse, execute, or fetch calls. (sec)
Elapsed - Total elapsed time, from the start to the end of a process.
Current
- Number of dirty blocks accessed. A dirty block is a block that have been modified
by a session but not yet written to the database.
- Dirty blocks seldom occur during the execution of SELECT statements, but most
often occur during the execution of UPDATE, INSERT, and DELETE statements.
Query
- Number of unchanged blocks that have not been read, or the number of
snapshot locks and copies of uncommitted data that have been read.
- This sometimes occurs during the execution of UPDATE, DELETE, and INSERT
statements, but often occurs during the execution of SELECT statements.
Disk - Number of data blocks read from the disk.
Rows
- Total number of rows accessed by the SQL statement.
- Does not include rows extracted by sub queries.
et - Time spent on the node. (usec)
cr - Number of cr blocks read from the node.
cu - Number of current blocks read from the node.
co - Cost of the nodes computed by the optimizer.
ro - Number of rows of the node estimated by the optimizer.
1.2. Using the SET_SQL_TRACE_IN_SESSION Procedure
 Determining whether to create an SQL TRACE file
- Starts/stops the creation of a SQL trace log for a session. The identifier and the serial number of the
session can be found using the V$SESSION view.
- A target statement for tuning can be easily found in the execution plan.
DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION
Tuning and Monitoring
Better Technology, Better Tomorrow
9
Parameter Type Description
SID NUMBER Identifier of the session.
SERIAL# NUMBER Serial number of the session.
SQL_TRACE BOOLEAN Specify as TRUE to create an SQL trace log, or specify false to stop.
 SQL Syntax
- EXEC SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(SID, SERIAL#, SQL_TRACE);
- BEGIN
SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION (SID, SERIAL#, SQL_TRACE);
END
 Examples
-- Access tbSQL.
$ tbsql sys/tibero
tbSQL 5
Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved.
Connected to Tibero.
-- Check the SET_SQL_TRACE_IN_SESSION information.
SQL> DESC DBMS_SYSTEM
PROCEDURE 'SET_SQL_TRACE_IN_SESSION'
ARGUMENT_NAME TYPE IN/OUT
------------------------ ------------------ ----------------
SID NUMBER IN
SERIAL# NUMBER IN
SQL_TRACE BOOLEAN IN
-- Query the parameter values using the V$SESSION view.
SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS')
LOGON_TIME
FROM V$SESSION
ORDER BY LOGON_TIME;
SID SERIAL# USERNAME SQL_TRACE LOGON_TIME
---------- ---------- --------- --------- -----------
9 4 SYS ENABLED 18 15:43:29
20 83 SYS ENABLED 18 15:44:47
19 567 SYS DISABLED 18 15:52:50
3 rows selected.
-- Set SQL_TRACE to Y.
SQL> EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(19, 567, TRUE);
PSM completed.
-- Verify that SQL_TRACE has been set to Y.
SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS')
LOGON_TIME
Tuning and Monitoring
Better Technology, Better Tomorrow
10
FROM V$SESSION
ORDER BY LOGON_TIME;
SID SERIAL# USERNAME SQL_TRACE LOGON_TIME
---------- ---------- --------- --------- -----------
9 4 SYS ENABLED 18 15:43:29
20 83 SYS ENABLED 18 15:44:47
19 567 SYS ENABLED 18 15:52:50
3 rows selected.
-- Set SQL_TRACE to Y and execute an SQL query.
SQL> SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id,
d.department_name
FROM departments d
LEFT OUTER JOIN employees e
ON(e.department_id=d.department_id);
-- Query the PID, SID, and serial# information using the V$SESSION view.
SQL> SELECT PID, SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD
HH24:MI:SS') LOGON_TIME
FROM V$SESSION
ORDER BY LOGON_TIME;
PID SID SERIAL# USERNAME SQL_TRACE LOGON_TIME
---------- ---------- --------- --------- ---------- ------------
3179 9 4 SYS ENABLED 18 15:43:29
3180 20 83 SYS ENABLED 18 15:44:47
3181 19 567 SYS ENABLED 18 15:52:50
3 rows selected.
-- Check the tb_sqltrc_3181_19_567.trc file created in the
$TB_HOME/instance/$TB_SID/log/sqltrace directory.
$ cd tibero5/instance/tibero/log/sqltrace
$ ls
tb_sqltrc_3180_1_3.trc tb_sqltrc_3181_20_3524.trc
tb_sqltrc_3180_9_4.trc tb_sqltrc_3181_20_83.trc
tb_sqltrc_3181_19_2766.trc tb_sqltrc_3181_21_7024.out
tb_sqltrc_3181_19_442.trc tb_sqltrc_3181_21_7024.trc
tb_sqltrc_3181_19_50.trc tb_sqltrc_3181_21_7829.trc
tb_sqltrc_3181_19_567.trc tb_sqltrc_3183_4_0.trc
-- Create an output file.
$tbprof tbprof tb_sqltrc_3181_19_567.trc tb_sqltrc_3181_19_567.out sys=no
TBPROF 5
Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved.
$
-- Check the contents of the output file. (Statistical information)
$ vi tb_sqltrc_3181_19_567.out
Tuning and Monitoring
Better Technology, Better Tomorrow
11
TBPROF 5
Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved.
input file name : tb_sqltrc_3181_21_7024.trc
output file name : tb_sqltrc_3181_21_7024.out
sort option : default
aggregate : no
sys : no
print : all
=================================================================
count: number of times the procedure was executed
cpu: CPU time(seconds)
this is not quite accurate due to threaded architecture
elapsed: elapsed time(seconds)
disk: number of physical reads from disk
query: number of blocks for consistent read
current: number of blocks in current mode
rows: number of rows processed
=================================================================
UserID:20
SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id,
d.department_name
FROM departments d
LEFT OUTER JOIN employees e
ON(e.department_id=d.department_id)
stage count cpu elapsed current query disk rows
-----------------------------------------------------------------------------
parse 1 0.00 0.00 0 0 0 0
exec 1 0.00 0.00 0 0 0 0
fetch 1 0.00 0.00 0 10 0 20
-----------------------------------------------------------------------------
sum 3 0.00 0.00 0 10 0 20
- cpu: CPU time. (sec)
- elapsed: Total time elapsed. (sec)
- current: Number of current blocks retrieved.
- query: Number of cr blocks retrieved.
- disk: Number of physical reads from the disk.
- rows: Number of rows processed.
rows execution plan
----------------------------------------------------------
20 index join (left outer) (et=93, cr=0, cu=0, co=4, cpu=0, ro=20)
8 table access (rowid) DEPARTMENTS(1749) (et=426, cr=1, cu=0, co=2, cpu=0, ro=8)
8 index (full) DEPT_ID_PK(1750) (et=52, cr=1, cu=0, co=1, cpu=0, ro=8)
19 table access (rowid) EMPLOYEES(1755) (et=354, cr=7, cu=0, co=2, cpu=0, ro=2)
19 index (range scan) EMP_DEPARTMENT_IX(1764) (et=125, cr=1, cu=0, co=1, cpu=0, ro=2)
*******************************************************************************
OVERALL TOTAL
stage count cpu elapsed current query disk rows
-----------------------------------------------------------------------------
parse 1 0.00 0.00 0 0 0 0
exec 1 0.00 0.00 0 0 0 0
fetch 1 0.00 0.00 0 10 0 20
Tuning and Monitoring
Better Technology, Better Tomorrow
12
-----------------------------------------------------------------------------
sum 3 0.00 0.00 0 10 0 20
*******************************************************************************
1 SQL statements in trace file.
1 unique SQL statements in trace file.
16 lines in trace file.
2. Using Autotrace in tbSQL
 SQL Syntax
- SET AUTOT[RACE] {OFF|ON|TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]] [PLANS[TAT]]
Setting Description
SET AUTOTRACE OFF AUTOTRACE is not performed. (Default value)
SET AUTOTRACE ON
Shows the execution plan, execution results, and execution
statistics of the SQL statement.
SET AUTOTRACE TRACEONLY
Shows both the execution plan and the execution statistics of
the SQL statement. Fast processing.
SET AUTOTRACE ON EXPLAIN
Shows the execution results and the execution plan of the SQL
statement.
SET AUTOTRACE ON STATISTICS
Shows the execution results and the execution statistics of the
SQL statement.
SET AUTOTRACE ON PLANSTAT
Shows the execution results of the SQL statement and the
query executions per node.
(Time spent executing, number of rows processed, number of
executions)
- When AUTOTRACE is used, OFF, ON, or TRACE[ONLY] must be specified.
- [EXP[LAIN]] [STAT[ISTICS]] [PLANS[TAT]] shows the execution plan, execution statistics, and query
executions in each node, respectively. Execution information includes execution time, number of rows
processed, and number of executions. All, some, or none of the options can be selected.
- AUTOTRACE allows users to selectively view execution results, execution plans, or execution statistics
according to the option.
- Execution results and execution statistics are the results of query executions, and the execution plan
contains estimated values.
 Privilege - DBA privilege or the PLUSTRACE role are required.
 Shows Execution Result/Execution Plan/Execution Statistics/Execution Information
Category Description
SQL Query SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
Execution Result
AVG
----------
4666.66667
1 row selected.
Tuning and Monitoring
Better Technology, Better Tomorrow
13
Execution Plan
SQL ID: 92
Plan Hash Value: 1910332783
Execution Plan
--------------------------------------------------------------
1 GROUP BY (HASH) (Cost: 26, %CPU: 0, Rows: 1)
2 TABLE ACCESS (FULL): EMPLOYEE (Cost: 26, %CPU: 0, Rows: 3)
Execution
Statistics
NAME VALUE
------------------------------ ---------------------------------------
db block gets 1
consistent gets 14
physical reads 0
redo size 0
sorts (disk) 0
sorts (memory) 0
rows processed 1
- db block gets: Number of times a current block was requested.
- consistent gets: Number of logical blocks read in Consistent mode.
- physical reads: Total number of data blocks read from disk.
- redo size: Size of the redo logs generated. (size)
- sorts (disk): Number of sort operations that were performed in disk.
- sorts (memory): Number of sort operations that were performed in memory.
- rows processed: Number of rows processed during the operation.
Execution
Information
SQL ID: 92
Plan Hash Value: 1910332783
Execution Stat
--------------------------------------------------
1 GROUP BY (HASH) (Time: .83 ms, Rows: 1, Starts: 1)
2 TABLE ACCESS (FULL): EMPLOYEE (Time: .15 ms, Rows: 3, Starts: 1)
 Examples
-- Access TBSQL
$ tbsql sys/tibero
tbSQL 5
Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved.
Connected to Tibero.
-- Enable the SET AUTOTRACE ON option.
SQL> SET AUTOTRACE ON;
-- Check the execution results, execution plan, and execution statistics of the SQL
query that was performed in the session.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
AVG
Tuning and Monitoring
Better Technology, Better Tomorrow
14
----------
4666.66667
1 row selected.
SQL ID: 92
Plan Hash Value: 1910332783
Execution Plan
--------------------------------------------------------------------------------
1 GROUP BY (HASH) (Cost: 26, %CPU: 0, Rows: 1)
2 TABLE ACCESS (FULL): EMPLOYEE (Cost: 26, %CPU: 0, Rows: 3)
NAME VALUE
------------------------------ ----------
db block gets 1
consistent gets 14
physical reads 0
redo size 0
sorts (disk) 0
sorts (memory) 0
rows processed 1
-- Enable the SET AUTOTRACE TRACEONLY option
SQL> SET AUTOTRACE TRACEONLY;
-- Check the execution plan and the execution statistics of the SQL query that was
performed in the session.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
SQL ID: 115
Plan Hash Value: 1910332783
Execution Plan
--------------------------------------------------------------------------------
1 GROUP BY (HASH) (Cost: 26, %CPU: 0, Rows: 1)
2 TABLE ACCESS (FULL): EMPLOYEE (Cost: 26, %CPU: 0, Rows: 3)
NAME VALUE
------------------------------ ----------
db block gets 1
consistent gets 14
physical reads 0
redo size 0
sorts (disk) 0
sorts (memory) 0
rows processed 1
-- Enable the SET AUTOTRACE ON EXPLAIN option
SQL> SET AUTOTRACE ON EXPLAIN;
-- Check the execution results and the execution plan of the SQL query that was
performed in the session.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
AVG
Tuning and Monitoring
Better Technology, Better Tomorrow
15
----------
4666.66667
1 row selected.
SQL ID: 92
Plan Hash Value: 1910332783
Execution Plan
--------------------------------------------------------------------------------
1 GROUP BY (HASH) (Cost:26, %CPU:0, Rows:1)
2 TABLE ACCESS (FULL): EMPLOYEE (Cost:26, %CPU:0, Rows:3)
-- Enable the SET AUTOTRACE ON STATISTICS option
SQL> SET AUTOTRACE ON STATISTICS;
-- Check the execution results and the execution statistics of the SQL query that was
performed in the session.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
AVG
----------
4666.66667
1 row selected.
NAME VALUE
------------------------------ ----------
db block gets 1
consistent gets 14
physical reads 0
redo size 0
sorts (disk) 0
sorts (memory) 0
rows processed 1
-- Enable the SET AUTOTRACE ON PLANSTAT option
SQL> SET AUTOTRACE ON PLANSTAT;
-- Check the execution results and the execution information of the SQL query
performed in the session.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
AVG
----------
4666.66667
1 row selected.
SQL ID: 92
Plan Hash Value: 1910332783
Execution Stat
--------------------------------------------------------------------------------
1 GROUP BY (HASH) (Time: .83 ms, Rows: 1, Starts: 1)
Tuning and Monitoring
Better Technology, Better Tomorrow
16
2 TABLE ACCESS (FULL): EMPLOYEE (Time: .15 ms, Rows: 3, Starts: 1)
-- Enable the SET AUTOTRACE OFF option
SQL> SET AUTOTRACE OFF;
-- Check the execution results of the SQL query performed in the session and the
result of enabling the AUTOTRACE OFF option.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
AVG
----------
4666.66667
1 row selected.
3. Using V$SQL_PLAN
Displays information about the physical plan for executing SQL statements.
 Columns Information
Column Name Data Type Description
HASH_VALUE NUMBER Hash value of the physical plan
SQL_ID NUMBER SQL identifier
OPERATION VARCHAR(128) Name of an operation job
OBJECT# NUMBER Identifier of an object accessed by the job
OBJECT_OWNER VARCHAR(128) Name of the user who owns the object
OBJECT_NAME VARCHAR(128) Object name
OBJECT_TYPE VARCHAR(20) Object type
ID NUMBER Unique number assigned to each task of the physical plan
PARENT_ID NUMBER
ID of the next execution step that operates on the output of
the current step
DEPTH NUMBER Tree level of the physical plan
POSITION NUMBER Position of all operations with the same PARENT_ID
SEARCH_COLUMNS NUMBER Number of keys used for index search
COST NUMBER Cost of an operation estimated by the optimizer
CPU_COST NUMBER CPU cost of an operation estimated by the optimizer
Tuning and Monitoring
Better Technology, Better Tomorrow
17
IO_COST NUMBER I/O cost of an operation estimated by the optimizer
CARDINALITY NUMBER Number of rows to display estimated by the optimizer
PSTART VARCHAR(38) First partition to be accessed in the partition table.
PEND VARCHAR(38) Last partition to be accessed in the partition table.
OTHERS VARCHAR(4000)
Execution step related information, which a user can flexibly
use.
ACCESS_PREDICATES VARCHAR(4000) Predicate information for index accesses or join operations
FILTER_PREDICATES VARCHAR(4000) Predicate information for a filter processing
 Examples
-- Execute an SQL query.
SQL> SELECT JOB_ID, round(AVG(SALARY)) AVG
FROM EMPLOYEES
GROUP BY JOB_ID order by 2 desc;
JOB_ID AVG
---------- ----------
AD_PRES 24000
AD_VP 17000
MK_MAN 13000
AC_MGR 12000
SA_MAN 10500
SA_REP 8867
AC_ACCOUNT 8300
IT_PROG 6400
MK_REP 6000
ST_MAN 5800
AD_ASST 4400
ST_CLERK 2925
12 rows selected.
-- Search for an SQL_ID using partial character sets of the SQL query.
SQL> select sql_id, sql_text
from v$sqltext
where sql_text like '%FROM EMPLOYEES%';
SQL_ID SQL_TEXT
---------- ----------------------------------------------------------------
521 SELECT JOB_ID, round(AVG(SALARY)) AVG FROM EMPLOYEES GROUP BY JO
-- How to view the full-sql text.
(When querying v$sqltext, the sql text is broken into pieces.)
SQL> select sql_id, aggr_concat(sql_text, '' order by piece) as sql
from v$sqltext
where sql_id=521 group by sql_id;
SQL_ID SQL
---------- --------------------------------------------------------------------------
521 SELECT JOB_ID, round(AVG(SALARY)) AVG FROM EMPLOYEES GROUP BY JOB_ID
Tuning and Monitoring
Better Technology, Better Tomorrow
18
order by 2 desc
1 row selected.
-- Identify the SQL query using V$SQL_PLAN. (with the SQL_ID searched.)
SQL> SELECT SUBSTRB(TO_CHAR(ID), 1, 3) || LPAD(' ', LEVEL * 2) || UPPER(OPERATION) ||
DECODE(OBJECT_NAME, NULL, NULL, ': '||OBJECT_NAME) || ' (Cost:' || COST ||
', %%CPU:' || DECODE(COST, 0, 0, TRUNC((COST-IO_COST)/COST * 100))|| ', Rows:'
|| CARDINALITY || ') ' || DECODE(PSTART, '', '', '(PS:' || PSTART || ', PE:' ||
PEND || ')') AS "Execution Plan"
FROM (SELECT * FROM V$SQL_PLAN WHERE SQL_ID = 521)
START WITH DEPTH = 1
CONNECT BY PRIOR ID = PARENT_ID AND PRIOR SQL_ID = SQL_ID
ORDER SIBLINGS BY POSITION;
Execution Plan
-----------------------------------------------------------------------------
1 ORDER BY (SORT) (Cost:26, %%CPU:0, Rows:12)
2 GROUP BY (HASH) (Cost:26, %%CPU:0, Rows:12)
3 TABLE ACCESS (FULL): EMPLOYEES (Cost:26, %%CPU:0, Rows:20)
3 rows selected
4. Others
4.1. The SQL_TRACE_DEST Parameter
SQL_TRACE_DEST specifies the directory in which the SQL trace file is stored. It must be specified as an absolute
path.
SQL trace files are generally stored in the $TB_HOME/instance/$TB_SID/log/sqltrace directory. The directory can
be modified using the following parameters.
Property Description
Type String
Default Value ""
Class Optional, Adjustable, Dynamic, System
Configuration method Set in the TIP file and restart the server, or change the directory using the
ALTER statement.
Syntax • • TIP File
- SQL_TRACE_DEST=<Directory>
• • ALTER Statement
- ALTER SYSTEM SET SQL_TRACE_DEST=<Directory>
4.2. Privilege Issues when using AUTOTRACE in TBSQL
 Notes
The following message appears when an SQL query is performed without the PLUSTRACE role. The
PLUSTRACE role must be granted to the user.
-- Access TBSQL and apply the Explain option.
SQL> set autotrace on explain;
Tuning and Monitoring
Better Technology, Better Tomorrow
19
-- The following message occurs when an SQL query is performed in the session without
the PLUSTRACE role.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
AVG
----------
4666.66667
1 row selected.
[B]TBR-8033: Specified schema object was not found.
at line 1, column 424:
"Execution Plan" FROM (SELECT * FROM V$SQL_PLAN WHERE SQL_ID = 115 AND HASH_V
^
TBS-70035: Unable to display plan: check PLUSTRACE role.
[B]TBR-8033: Specified schema object was not found.
at line 1, column 98:
RS AS "Remote SQL Information" FROM V$SQL_PLAN WHERE SQL_ID = 115 AND
^
TBS-70035: Unable to display plan: check PLUSTRACE role.
[B]TBR-8033: Specified schema object was not found.
at line 1, column 66:
with x as (select id, access_predicates, filter_predicates from v$sql_plan where
^
TBS-70035: Unable to display plan: check PLUSTRACE role.
-- Create the PLUSTRACE role.
SQL> @plustrace.sql
TBR-7070: Specified role 'PLUSTRACE' was not found.
Role 'PLUSTRACE' created.
Granted.
Granted.
Granted.
Granted.
File finished.
-- Run an SQL query to check the SQL execution plan of the query.
SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD;
AVG
----------
4666.66667
1 row selected.
Tuning and Monitoring
Better Technology, Better Tomorrow
20
SQL ID: 115
Plan Hash Value: 1910332783
Execution Plan
--------------------------------------------------------------------------------
1 GROUP BY (HASH) (Cost:26, %CPU:0, Rows:1)
2 TABLE ACCESS (FULL): EMPLOYEE (Cost:26, %CPU:0, Rows:3)
Tuning and Monitoring
Better Technology, Better Tomorrow
21
Copyright © 2014 TmaxData Co., Ltd. All Rights
Reserved.
Trademarks
Tibero RDBMS® is a registered trademark of TmaxData
Co., Ltd. Other products, titles or services may be
registered trademarks of their respective companies.
Contact Information
TmaxData can be contacted at the following addresses to
arrange for a consulting team to visit your company and
discuss your options.
Korea
TmaxData Co., Ltd
5, Hwangsaeul-ro 329beon-gil, Bundang-gu,
Seongnam-si, Gyeonggi-do. South Korea
Tel: +82-31-779-7113
Fax: +82-31-779-7119
Email: info@tmax.co.kr
Web (Korean): http://www.tmaxdata.com
Technical Support: http://technet.tmaxsoft.com
USA
TmaxSoft, Inc.
560 Sylvan Avenue
Englewood Cliffs, NJ 07632. U.S.A
Tel: +1-201-567-8266
Fax: +1-201-567-7339
Email: info@tmaxsoft.com
Web (English): http://www.tmaxsoft.com
Japan
TmaxSoft Japan Co., Ltd.
5F Sanko Bldg, 3-12-16 Mita, Minato-Ku, Tokyo,
108-0073
Japan
Tel: +81-3-5765-2550
Fax: +81-3-5765-2567
Email: info.jp@tmaxsoft.com
Web (Japanese): http://www.tmaxsoft.co.jp
China
TmaxSoft China Co., Ltd.
Beijing Silver Tower, RM 1508, 2 North Rd Dong
San Huan, Chaoyang District, Beijing, China,
100027. China
Tel: +86-10-6410-6145~8
Fax: +86-10-6410-6144
Email: info.cn@tmaxsoft.com
Web (Chinese): http://www.tmaxsoft.com.cn
Brazil
TmaxSoft Brazil
Avenida Copacabana, 177 - 3 andar 18 do Forte
Empresarial, Alphaville - Barueri, Sao Paulo, SP-
Brasil CEP 06472-001
Email: contato.brasil@tmaxsoft.com
Russia
Tmax Russia L.L.C.
Grand Setun Plaza, No A204 Gorbunova st.2,
Moscow, 121596
Tel: +7(495)970-01-35
Email: info.rus@tmaxsoft.com
Web (Russian): http://ru.tmaxsoft.com
Singapore
Tmax Singapore Pte. Ltd.
430 Lorong 6, Toa Payoh #10-02, OrangeTee
Building. Singapore 319402
Tel: +65-6259-7223
Email: info.sg@tmaxsoft.com
United Kingdom
TmaxSoft UK Ltd.
Surrey House, Suite 221, 34 Eden Street, Kingston-
Upon-Thames, KT1 1ER United Kingdom
Tel: + 44-(0)20-8481-3776
Email: info.uk@tmaxsoft.com
Web (English): http:/www.tmaxsoft.com
TD-TRMO-D0620101

More Related Content

What's hot

「Oracle Database + Java + Linux」 環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1
「Oracle Database + Java + Linux」環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1「Oracle Database + Java + Linux」環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1
「Oracle Database + Java + Linux」 環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1Shogo Wakayama
 
MongoDBのアレをアレする
MongoDBのアレをアレするMongoDBのアレをアレする
MongoDBのアレをアレするAkihiro Kuwano
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
DDDモデリング勉強会 #6
DDDモデリング勉強会 #6DDDモデリング勉強会 #6
DDDモデリング勉強会 #6株式会社Jurabi
 
Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsYogiji Creations
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overviewhonglee71
 
Git interview questions | Edureka
Git interview questions | EdurekaGit interview questions | Edureka
Git interview questions | EdurekaEdureka!
 
Migrating to MongoDB: Best Practices
Migrating to MongoDB: Best PracticesMigrating to MongoDB: Best Practices
Migrating to MongoDB: Best PracticesMongoDB
 
A brief introduction to Machine Learning
A brief introduction to Machine LearningA brief introduction to Machine Learning
A brief introduction to Machine LearningWen-Tien Chang
 
SQLアンチパターン(インデックスショットガン)
SQLアンチパターン(インデックスショットガン)SQLアンチパターン(インデックスショットガン)
SQLアンチパターン(インデックスショットガン)Tomoaki Uchida
 
차곡차곡 쉽게 알아가는 Elasticsearch와 Node.js
차곡차곡 쉽게 알아가는 Elasticsearch와 Node.js차곡차곡 쉽게 알아가는 Elasticsearch와 Node.js
차곡차곡 쉽게 알아가는 Elasticsearch와 Node.jsHeeJung Hwang
 
Index tuning
Index tuningIndex tuning
Index tuningMicrosoft
 

What's hot (20)

「Oracle Database + Java + Linux」 環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1
「Oracle Database + Java + Linux」環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1「Oracle Database + Java + Linux」環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1
「Oracle Database + Java + Linux」 環境における性能問題の調査手法 ~ミッションクリティカルシステムの現場から~ Part.1
 
Oracle 資料庫建立
Oracle 資料庫建立Oracle 資料庫建立
Oracle 資料庫建立
 
MongoDBのアレをアレする
MongoDBのアレをアレするMongoDBのアレをアレする
MongoDBのアレをアレする
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
 
DDDモデリング勉強会 #6
DDDモデリング勉強会 #6DDDモデリング勉強会 #6
DDDモデリング勉強会 #6
 
153 Oracle dba interview questions
153 Oracle dba interview questions153 Oracle dba interview questions
153 Oracle dba interview questions
 
Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creations
 
Key-Value NoSQL Database
Key-Value NoSQL DatabaseKey-Value NoSQL Database
Key-Value NoSQL Database
 
OCI GoldenGate Overview 2021年4月版
OCI GoldenGate Overview 2021年4月版OCI GoldenGate Overview 2021年4月版
OCI GoldenGate Overview 2021年4月版
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
Git interview questions | Edureka
Git interview questions | EdurekaGit interview questions | Edureka
Git interview questions | Edureka
 
Migrating to MongoDB: Best Practices
Migrating to MongoDB: Best PracticesMigrating to MongoDB: Best Practices
Migrating to MongoDB: Best Practices
 
GitLab から GitLab に移行したときの思い出
GitLab から GitLab に移行したときの思い出GitLab から GitLab に移行したときの思い出
GitLab から GitLab に移行したときの思い出
 
A brief introduction to Machine Learning
A brief introduction to Machine LearningA brief introduction to Machine Learning
A brief introduction to Machine Learning
 
SQLアンチパターン(インデックスショットガン)
SQLアンチパターン(インデックスショットガン)SQLアンチパターン(インデックスショットガン)
SQLアンチパターン(インデックスショットガン)
 
Oracle Advanced Security Data Redactionのご紹介
Oracle Advanced Security Data Redactionのご紹介Oracle Advanced Security Data Redactionのご紹介
Oracle Advanced Security Data Redactionのご紹介
 
차곡차곡 쉽게 알아가는 Elasticsearch와 Node.js
차곡차곡 쉽게 알아가는 Elasticsearch와 Node.js차곡차곡 쉽게 알아가는 Elasticsearch와 Node.js
차곡차곡 쉽게 알아가는 Elasticsearch와 Node.js
 
ECC 6.0 ABAP yenilikleri
ECC 6.0 ABAP yenilikleriECC 6.0 ABAP yenilikleri
ECC 6.0 ABAP yenilikleri
 
Index tuning
Index tuningIndex tuning
Index tuning
 

Similar to Tibero sql execution plan guide en

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLCommand Prompt., Inc
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLCommand Prompt., Inc
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
Common Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsCommon Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsOdoo
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuningafa reg
 
My sql monitoring cu沙龙
My sql monitoring cu沙龙My sql monitoring cu沙龙
My sql monitoring cu沙龙colderboy17
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009mattsmiley
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersKyle Hailey
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 
Checking clustering factor to detect row migration
Checking clustering factor to detect row migrationChecking clustering factor to detect row migration
Checking clustering factor to detect row migrationHeribertus Bramundito
 
AWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptAWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptbugzbinny
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsJohn Kanagaraj
 
Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application DevelopmentSaurabh K. Gupta
 

Similar to Tibero sql execution plan guide en (20)

Oracle Tracing
Oracle TracingOracle Tracing
Oracle Tracing
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Common Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsCommon Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo apps
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuning
 
My sql monitoring cu沙龙
My sql monitoring cu沙龙My sql monitoring cu沙龙
My sql monitoring cu沙龙
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Basic Query Tuning Primer
Basic Query Tuning PrimerBasic Query Tuning Primer
Basic Query Tuning Primer
 
Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009Basic Query Tuning Primer - Pg West 2009
Basic Query Tuning Primer - Pg West 2009
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Operation outbreak
Operation outbreakOperation outbreak
Operation outbreak
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmasters
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 
Checking clustering factor to detect row migration
Checking clustering factor to detect row migrationChecking clustering factor to detect row migration
Checking clustering factor to detect row migration
 
AWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptAWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.ppt
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
 
Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application Development
 

Recently uploaded

chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Tibero sql execution plan guide en

  • 1. — Tuning and Monitoring — Tibero SQL Operations Plan Guide 2014. 06. 20.
  • 2. Tuning and Monitoring Better Technology, Better Tomorrow 2 Table of Contents 1. Viewing SQL Query Execution Result using SQL Trace and tbPROF...........................................................................................................3 1.1. Using the SQL_TRACE parameter.............................................................................................................................................................3 1.1.1. Setting the SQL_TRACE parameters...........................................................................................................................................3 1.1.2. Verifying the Created SQL Trace File..........................................................................................................................................5 1.1.3. Executing the tbPROF Command................................................................................................................................................5 1.1.4. Analyzing the Output File after Executing tbPROF.................................................................................................................6 1.2. Using the SET_SQL_TRACE_IN_SESSION Procedure............................................................................................................................8 2. Using Autotrace in tbSQL...................................................................................................................................................................................12 3. Using V$SQL_PLAN .............................................................................................................................................................................................16 4. Others.....................................................................................................................................................................................................................18 4.1. The SQL_TRACE_DEST Parameter.........................................................................................................................................................18 4.2. Privilege Issues when using AUTOTRACE in TBSQL ..........................................................................................................................18
  • 3. Tuning and Monitoring Better Technology, Better Tomorrow 3 Tibero SQL Execution Plan Guide 1. Viewing SQL Query Execution Results using SQL Trace and tbPROF To collect SQL execution information, SQL trace files can be created statically or dynamically using SQL_TRACE parameters. - SQL statement executions are traced. - A target statement for tuning can be easily found in the execution plan. - Since the contents of a SQL trace are stored in a file, a query process can be slow. 1.1. Using the SQL_TRACE parameter 1.1.1. Setting the SQL_TRACE parameters SQL_TRACE determines whether to record SQL trace information. An SQL trace enables profiling of SQL execution information. However, using this function can severely impact performance, so it is recommended not to use this function in the real production environment. Property Description Type Boolean Default Value N Class Optional, Adjustable, Dynamic, Session Configuration Method Configure the TIP file and restart the server, or change the value using the ALTER statement. Syntax • • TIP File - SQL_TRACE={Y|N} • • ALTER Statement - ALTER SYSTEM SET SQL_TRACE={Y|N} - ALTER SESSION SET SQL_TRACE={Y|N}  Examples -- Query the SQL_TRACE information in V$SESSION. SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS') LOGON_TIME FROM V$SESSION ORDER BY LOGON_TIME; SID SERIAL# USERNAME SQL_TRACE LOGON_TIME ---------- ---------- --------- --------- ----------- 9 4 SYS ENABLED 18 15:43:29 20 83 SYS ENABLED 18 15:44:47 19 567 SYS DISABLED 18 15:52:50 3 rows selected. -- Use a text editor to modify the %$TB_HOME%/config/%TB_SID%.tip file. -- Set SQL_TRACE=Y and restart Tibero via tbboot. #------------------------------------------------------------------------------- # # RDBMS initialization parameter #
  • 4. Tuning and Monitoring Better Technology, Better Tomorrow 4 #------------------------------------------------------------------------------- DB_NAME=tibero LISTENER_PORT=8629 CONTROL_FILES="C:/Tibero/tbdata/c1.ctl" CERTIFICATE_FILE="C:/Tibero/tibero5/config/svr_wallet/tibero.crt" #PRIVKEY_FILE="C:/Tibero/tibero5/config/svr_wallet/tibero.key" #WALLET_FILE="C:/Tibero/tibero5/config/svr_wallet/WALLET" DB_CREATE_FILE_DEST=C:/Tibero/tbdata LOG_ARCHIVE_DEST= C:/Tibero/arch MAX_SESSION_COUNT=10 TOTAL_SHM_SIZE=512M UNDO_RETENTION=900 _TSN_TIME_MAP_SIZE=1000 SQL_TRACE=Y --------------------------------------------------------------------------------- -- Access tbSQL. $ tbsql sys/tibero tbSQL 5 Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved. Connected to Tibero. -- Verify that SQL_TRACE has been set to Y using the V$SESSION view. SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS') LOGON_TIME FROM V$SESSION ORDER BY LOGON_TIME; SID SERIAL# USERNAME SQL_TRACE LOGON_TIME ---------- ---------- --------- --------- ----------- 9 4 SYS ENABLED 18 15:43:29 20 83 SYS ENABLED 18 15:44:47 19 567 SYS ENABLED 18 15:52:50 3 rows selected. -- Set SQL_TRACE=Y and execute an SQL query. SQL> SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id, d.department_name FROM departments d LEFT OUTER JOIN employees e ON(e.department_id=d.department_id);
  • 5. Tuning and Monitoring Better Technology, Better Tomorrow 5 1.1.2. Verifying the Created SQL Trace File The trace file is placed in the following directory with the '.trc' extension.  File Location: $TB_HOME/instance/$TB_SID/log/sqltrace  File Naming Rule - A file name is created using the PID, SID, and serial# of the session. E.g., tb_sqltrc_PID_SID_serial#.trc - The PID, SID, and serial# information can be queried using the v$session view. -- Query the PID, SID, and serial# information using the V$SESSION view. SQL> SELECT PID, SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS') LOGON_TIME FROM V$SESSION ORDER BY LOGON_TIME; PID SID SERIAL# USERNAME SQL_TRACE LOGON_TIME ---------- ---------- --------- --------- ---------- ------------ 3179 9 4 SYS ENABLED 18 15:43:29 3180 20 83 SYS ENABLED 18 15:44:47 3181 19 567 SYS ENABLED 18 15:52:50 3 rows selected. -- Check the tb_sqltrc_3181_19_567.trc file created in the $TB_HOME/instance/$TB_SID/log/sqltrace directory. $ cd tibero5/instance/tibero/log/sqltrace $ ls tb_sqltrc_3180_1_3.trc tb_sqltrc_3181_20_3524.trc tb_sqltrc_3180_9_4.trc tb_sqltrc_3181_20_83.trc tb_sqltrc_3181_19_2766.trc tb_sqltrc_3181_21_7024.out tb_sqltrc_3181_19_442.trc tb_sqltrc_3181_21_7024.trc tb_sqltrc_3181_19_50.trc tb_sqltrc_3181_21_7829.trc tb_sqltrc_3181_19_567.trc tb_sqltrc_3183_4_0.trc 1.1.3. Executing the tbPROF Command This command provides the information about the SQL in the parse, execution, and fetch stages. It sorts the result of the user-specified field to display the result. The following is an example of checking the tbPROF parameters and executing the tbPROF command.  Checking the tbPROF parameter $ tbprof Usage: tbprof tracefile outputfile [print= ] [sort= ] [aggregate= ] print=integer List only the first 'integer' SQL statements. sys=yes|no Filter SQL statements that 'SYS' user executes. aggregate=yes|no Aggregate statistics of same SQL statements. sort=option Set of zero or more of the following sort options: prscnt number of times parse was called prscpu cpu time parsing prsela elapsed time parsing prsdsk number of disk reads during parse prsqry number of buffers for consistent read during parse prscu number of buffers for current read during parse execnt number of execute was called
  • 6. Tuning and Monitoring Better Technology, Better Tomorrow 6 execpu cpu time spent executing exeela elapsed time executing exedsk number of disk reads during execute exeqry number of buffers for consistent read during execute execu number of buffers for current read during execute exerow number of rows processed during execute fchcnt number of times fetch was called fchcpu cpu time spent fetching fchela elapsed time fetching fchdsk number of disk reads during fetch fchqry number of buffers for consistent read during fetch fchcu number of buffers for current read during fetch fchrow number of rows fetched userid userid of user that parsed the cursor Item Description Default tracefile Name of the file that contains statistical information created by the SQL trace. - outputfile Uses tbPROF to format the contents of the trace file into a readable text file. - print Prints the trace results of the specified number of SQL statements only. ALL sys Determines whether to list the SQL statements issued by the user SYS. yes aggregate Determines whether to aggregate the information of the same SQL. no sort Determines the result sort method. - Depending on SORT_OPTION, sorts results in descending order. - More than one option can be specified. Fields are separated by a comma ',' and cannot contain whitespace. - 1.1.4. Analyzing the Output File after Executing tbPROF Use tbPROF to analyze the information of the SQL executed. Check the information about the executed SQL statements including statistical information and execution plans in the output file.  Creating an output file using tbPROF $tbprof tbprof tb_sqltrc_3181_19_567.trc tb_sqltrc_3181_19_567.out sys=no TBPROF 5 Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved. $  Checking the output file $ vi tb_sqltrc_3181_19_567.out TBPROF 5 Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved. input file name : tb_sqltrc_3181_21_7024.trc output file name : tb_sqltrc_3181_21_7024.out sort option : default aggregate : no
  • 7. Tuning and Monitoring Better Technology, Better Tomorrow 7 sys : no print : all ================================================================= count: number of times the procedure was executed cpu: CPU time(seconds). this is not quite accurate due to threaded architecture elapsed: Total time elapsed (seconds) disk: number of physical reads from disk query: number of blocks for consistent read current: number of blocks in current mode rows: number of rows processed ================================================================= UserID:20 SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id, d.department_name FROM departments d LEFT OUTER JOIN employees e ON(e.department_id=d.department_id) stage count cpu elapsed current query disk rows ----------------------------------------------------------------------------- parse 1 0.00 0.00 0 0 0 0 exec 1 0.00 0.00 0 0 0 0 fetch 1 0.00 0.00 0 10 0 20 ----------------------------------------------------------------------------- sum 3 0.00 0.00 0 10 0 20 - cpu: CPU time. (sec) - elapsed: Total time elapsed. (sec) - current: Number of current blocks retrieved. - query: Number of cr blocks retrieved. - disk: Number of physical reads from disk. - rows: Number of rows processed rows execution plan ---------------------------------------------------------- 20 index join (left outer) (et=93, cr=0, cu=0, co=4, cpu=0, ro=20) 8 table access (rowid) DEPARTMENTS(1749) (et=426, cr=1, cu=0, co=2, cpu=0, ro=8) 8 index (full) DEPT_ID_PK(1750) (et=52, cr=1, cu=0, co=1, cpu=0, ro=8) 19 table access (rowid) EMPLOYEES(1755) (et=354, cr=7, cu=0, co=2, cpu=0, ro=2) 19 index (range scan) EMP_DEPARTMENT_IX(1764) (et=125, cr=1, cu=0, co=1, cpu=0, ro=2) ******************************************************************************* OVERALL TOTAL stage count cpu elapsed current query disk rows ----------------------------------------------------------------------------- parse 1 0.00 0.00 0 0 0 0 exec 1 0.00 0.00 0 0 0 0 fetch 1 0.00 0.00 0 10 0 20 ----------------------------------------------------------------------------- sum 3 0.00 0.00 0 10 0 20 ******************************************************************************* 1 SQL statements in trace file. 1 unique SQL statements in trace file.
  • 8. Tuning and Monitoring Better Technology, Better Tomorrow 8 16 lines in trace file.  tbPROF Statistics Information Call Value Description Parse - Converts the SQL statement into an execution plan, including checks for tables, columns, and reference objects. Execute - Executes INSERT, UPDATE, and DELETE statements, which modify the data according to the execution plan. - Indicates the number of selected rows during execution of the statement. Fetch - Indicates the number of rows returned by a query. - Fetches are performed for SELECT statements. Argument Description Count - Number of times an SQL statement was parsed, executed, or fetched. CPU - CPU time spent to parse, execute, or fetch calls. (sec) Elapsed - Total elapsed time, from the start to the end of a process. Current - Number of dirty blocks accessed. A dirty block is a block that have been modified by a session but not yet written to the database. - Dirty blocks seldom occur during the execution of SELECT statements, but most often occur during the execution of UPDATE, INSERT, and DELETE statements. Query - Number of unchanged blocks that have not been read, or the number of snapshot locks and copies of uncommitted data that have been read. - This sometimes occurs during the execution of UPDATE, DELETE, and INSERT statements, but often occurs during the execution of SELECT statements. Disk - Number of data blocks read from the disk. Rows - Total number of rows accessed by the SQL statement. - Does not include rows extracted by sub queries. et - Time spent on the node. (usec) cr - Number of cr blocks read from the node. cu - Number of current blocks read from the node. co - Cost of the nodes computed by the optimizer. ro - Number of rows of the node estimated by the optimizer. 1.2. Using the SET_SQL_TRACE_IN_SESSION Procedure  Determining whether to create an SQL TRACE file - Starts/stops the creation of a SQL trace log for a session. The identifier and the serial number of the session can be found using the V$SESSION view. - A target statement for tuning can be easily found in the execution plan. DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION
  • 9. Tuning and Monitoring Better Technology, Better Tomorrow 9 Parameter Type Description SID NUMBER Identifier of the session. SERIAL# NUMBER Serial number of the session. SQL_TRACE BOOLEAN Specify as TRUE to create an SQL trace log, or specify false to stop.  SQL Syntax - EXEC SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(SID, SERIAL#, SQL_TRACE); - BEGIN SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION (SID, SERIAL#, SQL_TRACE); END  Examples -- Access tbSQL. $ tbsql sys/tibero tbSQL 5 Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved. Connected to Tibero. -- Check the SET_SQL_TRACE_IN_SESSION information. SQL> DESC DBMS_SYSTEM PROCEDURE 'SET_SQL_TRACE_IN_SESSION' ARGUMENT_NAME TYPE IN/OUT ------------------------ ------------------ ---------------- SID NUMBER IN SERIAL# NUMBER IN SQL_TRACE BOOLEAN IN -- Query the parameter values using the V$SESSION view. SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS') LOGON_TIME FROM V$SESSION ORDER BY LOGON_TIME; SID SERIAL# USERNAME SQL_TRACE LOGON_TIME ---------- ---------- --------- --------- ----------- 9 4 SYS ENABLED 18 15:43:29 20 83 SYS ENABLED 18 15:44:47 19 567 SYS DISABLED 18 15:52:50 3 rows selected. -- Set SQL_TRACE to Y. SQL> EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(19, 567, TRUE); PSM completed. -- Verify that SQL_TRACE has been set to Y. SQL> SELECT SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS') LOGON_TIME
  • 10. Tuning and Monitoring Better Technology, Better Tomorrow 10 FROM V$SESSION ORDER BY LOGON_TIME; SID SERIAL# USERNAME SQL_TRACE LOGON_TIME ---------- ---------- --------- --------- ----------- 9 4 SYS ENABLED 18 15:43:29 20 83 SYS ENABLED 18 15:44:47 19 567 SYS ENABLED 18 15:52:50 3 rows selected. -- Set SQL_TRACE to Y and execute an SQL query. SQL> SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id, d.department_name FROM departments d LEFT OUTER JOIN employees e ON(e.department_id=d.department_id); -- Query the PID, SID, and serial# information using the V$SESSION view. SQL> SELECT PID, SID, SERIAL#, USERNAME, SQL_TRACE, TO_CHAR(LOGON_TIME, 'DD HH24:MI:SS') LOGON_TIME FROM V$SESSION ORDER BY LOGON_TIME; PID SID SERIAL# USERNAME SQL_TRACE LOGON_TIME ---------- ---------- --------- --------- ---------- ------------ 3179 9 4 SYS ENABLED 18 15:43:29 3180 20 83 SYS ENABLED 18 15:44:47 3181 19 567 SYS ENABLED 18 15:52:50 3 rows selected. -- Check the tb_sqltrc_3181_19_567.trc file created in the $TB_HOME/instance/$TB_SID/log/sqltrace directory. $ cd tibero5/instance/tibero/log/sqltrace $ ls tb_sqltrc_3180_1_3.trc tb_sqltrc_3181_20_3524.trc tb_sqltrc_3180_9_4.trc tb_sqltrc_3181_20_83.trc tb_sqltrc_3181_19_2766.trc tb_sqltrc_3181_21_7024.out tb_sqltrc_3181_19_442.trc tb_sqltrc_3181_21_7024.trc tb_sqltrc_3181_19_50.trc tb_sqltrc_3181_21_7829.trc tb_sqltrc_3181_19_567.trc tb_sqltrc_3183_4_0.trc -- Create an output file. $tbprof tbprof tb_sqltrc_3181_19_567.trc tb_sqltrc_3181_19_567.out sys=no TBPROF 5 Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved. $ -- Check the contents of the output file. (Statistical information) $ vi tb_sqltrc_3181_19_567.out
  • 11. Tuning and Monitoring Better Technology, Better Tomorrow 11 TBPROF 5 Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved. input file name : tb_sqltrc_3181_21_7024.trc output file name : tb_sqltrc_3181_21_7024.out sort option : default aggregate : no sys : no print : all ================================================================= count: number of times the procedure was executed cpu: CPU time(seconds) this is not quite accurate due to threaded architecture elapsed: elapsed time(seconds) disk: number of physical reads from disk query: number of blocks for consistent read current: number of blocks in current mode rows: number of rows processed ================================================================= UserID:20 SELECT e.employee_id, e.first_name||' '||e.last_name emp_name, d.department_id, d.department_name FROM departments d LEFT OUTER JOIN employees e ON(e.department_id=d.department_id) stage count cpu elapsed current query disk rows ----------------------------------------------------------------------------- parse 1 0.00 0.00 0 0 0 0 exec 1 0.00 0.00 0 0 0 0 fetch 1 0.00 0.00 0 10 0 20 ----------------------------------------------------------------------------- sum 3 0.00 0.00 0 10 0 20 - cpu: CPU time. (sec) - elapsed: Total time elapsed. (sec) - current: Number of current blocks retrieved. - query: Number of cr blocks retrieved. - disk: Number of physical reads from the disk. - rows: Number of rows processed. rows execution plan ---------------------------------------------------------- 20 index join (left outer) (et=93, cr=0, cu=0, co=4, cpu=0, ro=20) 8 table access (rowid) DEPARTMENTS(1749) (et=426, cr=1, cu=0, co=2, cpu=0, ro=8) 8 index (full) DEPT_ID_PK(1750) (et=52, cr=1, cu=0, co=1, cpu=0, ro=8) 19 table access (rowid) EMPLOYEES(1755) (et=354, cr=7, cu=0, co=2, cpu=0, ro=2) 19 index (range scan) EMP_DEPARTMENT_IX(1764) (et=125, cr=1, cu=0, co=1, cpu=0, ro=2) ******************************************************************************* OVERALL TOTAL stage count cpu elapsed current query disk rows ----------------------------------------------------------------------------- parse 1 0.00 0.00 0 0 0 0 exec 1 0.00 0.00 0 0 0 0 fetch 1 0.00 0.00 0 10 0 20
  • 12. Tuning and Monitoring Better Technology, Better Tomorrow 12 ----------------------------------------------------------------------------- sum 3 0.00 0.00 0 10 0 20 ******************************************************************************* 1 SQL statements in trace file. 1 unique SQL statements in trace file. 16 lines in trace file. 2. Using Autotrace in tbSQL  SQL Syntax - SET AUTOT[RACE] {OFF|ON|TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]] [PLANS[TAT]] Setting Description SET AUTOTRACE OFF AUTOTRACE is not performed. (Default value) SET AUTOTRACE ON Shows the execution plan, execution results, and execution statistics of the SQL statement. SET AUTOTRACE TRACEONLY Shows both the execution plan and the execution statistics of the SQL statement. Fast processing. SET AUTOTRACE ON EXPLAIN Shows the execution results and the execution plan of the SQL statement. SET AUTOTRACE ON STATISTICS Shows the execution results and the execution statistics of the SQL statement. SET AUTOTRACE ON PLANSTAT Shows the execution results of the SQL statement and the query executions per node. (Time spent executing, number of rows processed, number of executions) - When AUTOTRACE is used, OFF, ON, or TRACE[ONLY] must be specified. - [EXP[LAIN]] [STAT[ISTICS]] [PLANS[TAT]] shows the execution plan, execution statistics, and query executions in each node, respectively. Execution information includes execution time, number of rows processed, and number of executions. All, some, or none of the options can be selected. - AUTOTRACE allows users to selectively view execution results, execution plans, or execution statistics according to the option. - Execution results and execution statistics are the results of query executions, and the execution plan contains estimated values.  Privilege - DBA privilege or the PLUSTRACE role are required.  Shows Execution Result/Execution Plan/Execution Statistics/Execution Information Category Description SQL Query SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; Execution Result AVG ---------- 4666.66667 1 row selected.
  • 13. Tuning and Monitoring Better Technology, Better Tomorrow 13 Execution Plan SQL ID: 92 Plan Hash Value: 1910332783 Execution Plan -------------------------------------------------------------- 1 GROUP BY (HASH) (Cost: 26, %CPU: 0, Rows: 1) 2 TABLE ACCESS (FULL): EMPLOYEE (Cost: 26, %CPU: 0, Rows: 3) Execution Statistics NAME VALUE ------------------------------ --------------------------------------- db block gets 1 consistent gets 14 physical reads 0 redo size 0 sorts (disk) 0 sorts (memory) 0 rows processed 1 - db block gets: Number of times a current block was requested. - consistent gets: Number of logical blocks read in Consistent mode. - physical reads: Total number of data blocks read from disk. - redo size: Size of the redo logs generated. (size) - sorts (disk): Number of sort operations that were performed in disk. - sorts (memory): Number of sort operations that were performed in memory. - rows processed: Number of rows processed during the operation. Execution Information SQL ID: 92 Plan Hash Value: 1910332783 Execution Stat -------------------------------------------------- 1 GROUP BY (HASH) (Time: .83 ms, Rows: 1, Starts: 1) 2 TABLE ACCESS (FULL): EMPLOYEE (Time: .15 ms, Rows: 3, Starts: 1)  Examples -- Access TBSQL $ tbsql sys/tibero tbSQL 5 Copyright (c) 2008, 2009, 2011, 2012 Tibero Corporation. All rights reserved. Connected to Tibero. -- Enable the SET AUTOTRACE ON option. SQL> SET AUTOTRACE ON; -- Check the execution results, execution plan, and execution statistics of the SQL query that was performed in the session. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; AVG
  • 14. Tuning and Monitoring Better Technology, Better Tomorrow 14 ---------- 4666.66667 1 row selected. SQL ID: 92 Plan Hash Value: 1910332783 Execution Plan -------------------------------------------------------------------------------- 1 GROUP BY (HASH) (Cost: 26, %CPU: 0, Rows: 1) 2 TABLE ACCESS (FULL): EMPLOYEE (Cost: 26, %CPU: 0, Rows: 3) NAME VALUE ------------------------------ ---------- db block gets 1 consistent gets 14 physical reads 0 redo size 0 sorts (disk) 0 sorts (memory) 0 rows processed 1 -- Enable the SET AUTOTRACE TRACEONLY option SQL> SET AUTOTRACE TRACEONLY; -- Check the execution plan and the execution statistics of the SQL query that was performed in the session. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; SQL ID: 115 Plan Hash Value: 1910332783 Execution Plan -------------------------------------------------------------------------------- 1 GROUP BY (HASH) (Cost: 26, %CPU: 0, Rows: 1) 2 TABLE ACCESS (FULL): EMPLOYEE (Cost: 26, %CPU: 0, Rows: 3) NAME VALUE ------------------------------ ---------- db block gets 1 consistent gets 14 physical reads 0 redo size 0 sorts (disk) 0 sorts (memory) 0 rows processed 1 -- Enable the SET AUTOTRACE ON EXPLAIN option SQL> SET AUTOTRACE ON EXPLAIN; -- Check the execution results and the execution plan of the SQL query that was performed in the session. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; AVG
  • 15. Tuning and Monitoring Better Technology, Better Tomorrow 15 ---------- 4666.66667 1 row selected. SQL ID: 92 Plan Hash Value: 1910332783 Execution Plan -------------------------------------------------------------------------------- 1 GROUP BY (HASH) (Cost:26, %CPU:0, Rows:1) 2 TABLE ACCESS (FULL): EMPLOYEE (Cost:26, %CPU:0, Rows:3) -- Enable the SET AUTOTRACE ON STATISTICS option SQL> SET AUTOTRACE ON STATISTICS; -- Check the execution results and the execution statistics of the SQL query that was performed in the session. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; AVG ---------- 4666.66667 1 row selected. NAME VALUE ------------------------------ ---------- db block gets 1 consistent gets 14 physical reads 0 redo size 0 sorts (disk) 0 sorts (memory) 0 rows processed 1 -- Enable the SET AUTOTRACE ON PLANSTAT option SQL> SET AUTOTRACE ON PLANSTAT; -- Check the execution results and the execution information of the SQL query performed in the session. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; AVG ---------- 4666.66667 1 row selected. SQL ID: 92 Plan Hash Value: 1910332783 Execution Stat -------------------------------------------------------------------------------- 1 GROUP BY (HASH) (Time: .83 ms, Rows: 1, Starts: 1)
  • 16. Tuning and Monitoring Better Technology, Better Tomorrow 16 2 TABLE ACCESS (FULL): EMPLOYEE (Time: .15 ms, Rows: 3, Starts: 1) -- Enable the SET AUTOTRACE OFF option SQL> SET AUTOTRACE OFF; -- Check the execution results of the SQL query performed in the session and the result of enabling the AUTOTRACE OFF option. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; AVG ---------- 4666.66667 1 row selected. 3. Using V$SQL_PLAN Displays information about the physical plan for executing SQL statements.  Columns Information Column Name Data Type Description HASH_VALUE NUMBER Hash value of the physical plan SQL_ID NUMBER SQL identifier OPERATION VARCHAR(128) Name of an operation job OBJECT# NUMBER Identifier of an object accessed by the job OBJECT_OWNER VARCHAR(128) Name of the user who owns the object OBJECT_NAME VARCHAR(128) Object name OBJECT_TYPE VARCHAR(20) Object type ID NUMBER Unique number assigned to each task of the physical plan PARENT_ID NUMBER ID of the next execution step that operates on the output of the current step DEPTH NUMBER Tree level of the physical plan POSITION NUMBER Position of all operations with the same PARENT_ID SEARCH_COLUMNS NUMBER Number of keys used for index search COST NUMBER Cost of an operation estimated by the optimizer CPU_COST NUMBER CPU cost of an operation estimated by the optimizer
  • 17. Tuning and Monitoring Better Technology, Better Tomorrow 17 IO_COST NUMBER I/O cost of an operation estimated by the optimizer CARDINALITY NUMBER Number of rows to display estimated by the optimizer PSTART VARCHAR(38) First partition to be accessed in the partition table. PEND VARCHAR(38) Last partition to be accessed in the partition table. OTHERS VARCHAR(4000) Execution step related information, which a user can flexibly use. ACCESS_PREDICATES VARCHAR(4000) Predicate information for index accesses or join operations FILTER_PREDICATES VARCHAR(4000) Predicate information for a filter processing  Examples -- Execute an SQL query. SQL> SELECT JOB_ID, round(AVG(SALARY)) AVG FROM EMPLOYEES GROUP BY JOB_ID order by 2 desc; JOB_ID AVG ---------- ---------- AD_PRES 24000 AD_VP 17000 MK_MAN 13000 AC_MGR 12000 SA_MAN 10500 SA_REP 8867 AC_ACCOUNT 8300 IT_PROG 6400 MK_REP 6000 ST_MAN 5800 AD_ASST 4400 ST_CLERK 2925 12 rows selected. -- Search for an SQL_ID using partial character sets of the SQL query. SQL> select sql_id, sql_text from v$sqltext where sql_text like '%FROM EMPLOYEES%'; SQL_ID SQL_TEXT ---------- ---------------------------------------------------------------- 521 SELECT JOB_ID, round(AVG(SALARY)) AVG FROM EMPLOYEES GROUP BY JO -- How to view the full-sql text. (When querying v$sqltext, the sql text is broken into pieces.) SQL> select sql_id, aggr_concat(sql_text, '' order by piece) as sql from v$sqltext where sql_id=521 group by sql_id; SQL_ID SQL ---------- -------------------------------------------------------------------------- 521 SELECT JOB_ID, round(AVG(SALARY)) AVG FROM EMPLOYEES GROUP BY JOB_ID
  • 18. Tuning and Monitoring Better Technology, Better Tomorrow 18 order by 2 desc 1 row selected. -- Identify the SQL query using V$SQL_PLAN. (with the SQL_ID searched.) SQL> SELECT SUBSTRB(TO_CHAR(ID), 1, 3) || LPAD(' ', LEVEL * 2) || UPPER(OPERATION) || DECODE(OBJECT_NAME, NULL, NULL, ': '||OBJECT_NAME) || ' (Cost:' || COST || ', %%CPU:' || DECODE(COST, 0, 0, TRUNC((COST-IO_COST)/COST * 100))|| ', Rows:' || CARDINALITY || ') ' || DECODE(PSTART, '', '', '(PS:' || PSTART || ', PE:' || PEND || ')') AS "Execution Plan" FROM (SELECT * FROM V$SQL_PLAN WHERE SQL_ID = 521) START WITH DEPTH = 1 CONNECT BY PRIOR ID = PARENT_ID AND PRIOR SQL_ID = SQL_ID ORDER SIBLINGS BY POSITION; Execution Plan ----------------------------------------------------------------------------- 1 ORDER BY (SORT) (Cost:26, %%CPU:0, Rows:12) 2 GROUP BY (HASH) (Cost:26, %%CPU:0, Rows:12) 3 TABLE ACCESS (FULL): EMPLOYEES (Cost:26, %%CPU:0, Rows:20) 3 rows selected 4. Others 4.1. The SQL_TRACE_DEST Parameter SQL_TRACE_DEST specifies the directory in which the SQL trace file is stored. It must be specified as an absolute path. SQL trace files are generally stored in the $TB_HOME/instance/$TB_SID/log/sqltrace directory. The directory can be modified using the following parameters. Property Description Type String Default Value "" Class Optional, Adjustable, Dynamic, System Configuration method Set in the TIP file and restart the server, or change the directory using the ALTER statement. Syntax • • TIP File - SQL_TRACE_DEST=<Directory> • • ALTER Statement - ALTER SYSTEM SET SQL_TRACE_DEST=<Directory> 4.2. Privilege Issues when using AUTOTRACE in TBSQL  Notes The following message appears when an SQL query is performed without the PLUSTRACE role. The PLUSTRACE role must be granted to the user. -- Access TBSQL and apply the Explain option. SQL> set autotrace on explain;
  • 19. Tuning and Monitoring Better Technology, Better Tomorrow 19 -- The following message occurs when an SQL query is performed in the session without the PLUSTRACE role. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; AVG ---------- 4666.66667 1 row selected. [B]TBR-8033: Specified schema object was not found. at line 1, column 424: "Execution Plan" FROM (SELECT * FROM V$SQL_PLAN WHERE SQL_ID = 115 AND HASH_V ^ TBS-70035: Unable to display plan: check PLUSTRACE role. [B]TBR-8033: Specified schema object was not found. at line 1, column 98: RS AS "Remote SQL Information" FROM V$SQL_PLAN WHERE SQL_ID = 115 AND ^ TBS-70035: Unable to display plan: check PLUSTRACE role. [B]TBR-8033: Specified schema object was not found. at line 1, column 66: with x as (select id, access_predicates, filter_predicates from v$sql_plan where ^ TBS-70035: Unable to display plan: check PLUSTRACE role. -- Create the PLUSTRACE role. SQL> @plustrace.sql TBR-7070: Specified role 'PLUSTRACE' was not found. Role 'PLUSTRACE' created. Granted. Granted. Granted. Granted. File finished. -- Run an SQL query to check the SQL execution plan of the query. SQL> SELECT AVG(SALARY) AVG FROM employee GROUP BY DEPT_CD; AVG ---------- 4666.66667 1 row selected.
  • 20. Tuning and Monitoring Better Technology, Better Tomorrow 20 SQL ID: 115 Plan Hash Value: 1910332783 Execution Plan -------------------------------------------------------------------------------- 1 GROUP BY (HASH) (Cost:26, %CPU:0, Rows:1) 2 TABLE ACCESS (FULL): EMPLOYEE (Cost:26, %CPU:0, Rows:3)
  • 21. Tuning and Monitoring Better Technology, Better Tomorrow 21 Copyright © 2014 TmaxData Co., Ltd. All Rights Reserved. Trademarks Tibero RDBMS® is a registered trademark of TmaxData Co., Ltd. Other products, titles or services may be registered trademarks of their respective companies. Contact Information TmaxData can be contacted at the following addresses to arrange for a consulting team to visit your company and discuss your options. Korea TmaxData Co., Ltd 5, Hwangsaeul-ro 329beon-gil, Bundang-gu, Seongnam-si, Gyeonggi-do. South Korea Tel: +82-31-779-7113 Fax: +82-31-779-7119 Email: info@tmax.co.kr Web (Korean): http://www.tmaxdata.com Technical Support: http://technet.tmaxsoft.com USA TmaxSoft, Inc. 560 Sylvan Avenue Englewood Cliffs, NJ 07632. U.S.A Tel: +1-201-567-8266 Fax: +1-201-567-7339 Email: info@tmaxsoft.com Web (English): http://www.tmaxsoft.com Japan TmaxSoft Japan Co., Ltd. 5F Sanko Bldg, 3-12-16 Mita, Minato-Ku, Tokyo, 108-0073 Japan Tel: +81-3-5765-2550 Fax: +81-3-5765-2567 Email: info.jp@tmaxsoft.com Web (Japanese): http://www.tmaxsoft.co.jp China TmaxSoft China Co., Ltd. Beijing Silver Tower, RM 1508, 2 North Rd Dong San Huan, Chaoyang District, Beijing, China, 100027. China Tel: +86-10-6410-6145~8 Fax: +86-10-6410-6144 Email: info.cn@tmaxsoft.com Web (Chinese): http://www.tmaxsoft.com.cn Brazil TmaxSoft Brazil Avenida Copacabana, 177 - 3 andar 18 do Forte Empresarial, Alphaville - Barueri, Sao Paulo, SP- Brasil CEP 06472-001 Email: contato.brasil@tmaxsoft.com Russia Tmax Russia L.L.C. Grand Setun Plaza, No A204 Gorbunova st.2, Moscow, 121596 Tel: +7(495)970-01-35 Email: info.rus@tmaxsoft.com Web (Russian): http://ru.tmaxsoft.com Singapore Tmax Singapore Pte. Ltd. 430 Lorong 6, Toa Payoh #10-02, OrangeTee Building. Singapore 319402 Tel: +65-6259-7223 Email: info.sg@tmaxsoft.com United Kingdom TmaxSoft UK Ltd. Surrey House, Suite 221, 34 Eden Street, Kingston- Upon-Thames, KT1 1ER United Kingdom Tel: + 44-(0)20-8481-3776 Email: info.uk@tmaxsoft.com Web (English): http:/www.tmaxsoft.com TD-TRMO-D0620101