How to enable Session usage sampling in teradata 12.0

Database
Enthusiast

How to enable Session usage sampling in teradata 12.0

Hi,

Could someone provide me the information/steps to enable "Session usage sampling in Teradata 12.0". Kindly let me know what are the impact of enabling Session usage sampling.
3 REPLIES
Senior Apprentice

Re: How to enable Session usage sampling in teradata 12.0

I never heard about "Session usage sampling", what does it mean?

Dieter
Enthusiast

Re: How to enable Session usage sampling in teradata 12.0

I am new to Teradata.

I am trying to run the below SQL:

SEL UserName (TITLE 'Idle Users'),
SessionNo (TITLE 'Session'),
HostId (TITLE 'Host',FORMAT 'ZZZ9'),
PartName (FORMAT 'X(8)')
FROM TABLE (SYSLIB.MonitorSession(-1,'*',0)) AS t1 WHERE (AmpState='IDLE' AND
(PEState='IDLE' OR PEState='IDLE:IN-DOUBT')) ORDER BY 1,2,3;

However, the execution of the SQL troughs the error:

“7504: in UDF/ZSP/UDM SYSLIB. MonitorSession: SQLSTATE U0004: MSG3274-Data Unavailable: Session Usage Sampling is not currently enabled."

From the error statement i could understand that Session Usage Sampling has to be enable.

Senior Apprentice

Re: How to enable Session usage sampling in teradata 12.0

Ok, now i know what you mean :-)

3274 Data Unavailable: Session Usage
sampling is not currently enabled.
Explanation: The MONITOR SESSION request failed
becauase both the Local and the System-wide Session
Monitoring Rates are zero.
Generated By: PFMUsTsk.
For Whom: End User.
Remedy: Set the Session Monitoring Rate to a valid
non-zero value, wait for a full collection period to
expire, and resubmit this request.

There are several ways to switch on monitoring, e.g. using SetResourceRate/SetSessionRate UDFs or PMon.
Check the "Workload Management API: PM/API and Open API" manual

Dieter