Profiling Information
This article explains how to retrieve profiling information from your Exasol system.
In some scenarios you may be asked by Support to provide profiling information for a problematic query. To get this information you must first run a test of the problematic statement with profiling enabled, and then retrieve the log files for that session.
Prerequisites
You must have enough free disk space for the logs. For more information, see EXAsupport.
Procedure
Step 1: Run a test of the problematic statement with profiling enabled
- Open a new database connection using your preferred SQL client.
- Copy the problematic SQL query into the following statement and execute it:
alter session set profile='on';
// <insert your query here>;
alter session set profile='off';
alter session set NLS_NUMERIC_CHARACTERS='.,';
alter session set NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH:MI:SS.ff3';
commit;
flush statistics;
commit;
export (
select *
from EXA_STATISTICS.EXA_USER_PROFILE_LAST_DAY
where session_id = current_session
)
into LOCAL CSV
FILE 'profile_output.csv'; - Attach the generated CSV file profile_output.csv to your support ticket.
Step 2: Get the log files for the test session
In this step, you will request the logs for a specific session.
Make sure that you have enough free disk space for the logs. For more information, see EXAsupport.
The following examples use the c4 and confd_client command-line tools in a Linux terminal. For more information about these tools, see Exasol Deployment Tool (c4) and ConfD.
-
Connect to EXAClusterOS (COS) on the cluster using
c4 connect -t <DEPLOYMENT>[.<NODE>]/cos
. For example:If you do not specify a node, c4 will connect to the first active node in the deployment.
For more information about how to use
c4 connect
, see How to use c4. -
To find the name of the database, use the ConfD job db_list. For example:
-
To collect information about a specific SQL session, use the EXAsupport tool and provide the relevant session ID. Specify the start date (
-s
) and end date (-t
) using the formatYYYY-MM-DD
.In Exasol versions prior to 8.25.0, you can only collect SQL logs for a specific session on the day that the session occurred. Later versions do not have this limitation.
For example:
If the log file was successfully created, you will see the following message containing the file name:
- Use CTRL+D or type
exit
to disconnect from COS. -
Copy the log file to your local computer by connecting to COS and using the
cat
command:Example:
Verification
To verify that the log was successfully copied, use the
ls
command in the target folder on your local machine.Example