Checking SQL history in Teradata can be very important.Few of the key points can be :
- Check commands you executed in Teradata.
- Check commands executed by other users in Teradata.
- Who modified any object like table etc in Teradata.
- When some SQL commands were executed in Teradata.
- From which IP SQL commands were executed in Teradata.
- Top resource consuming queries in Teradata.
To check SQL History in Teradata, we refer to dbc.QryLog. DBC.QryLog is a view which contains information about the SQL Queries executed in Teradata.We can use the below mentioned query for checking history of SQL queries you executed in Teradata.
select * from dbc.Qrylog where clientid='YOUR NAME' order by StartTime desc;
The output of the above query contains lots of columns and you can check these columns and then select columns which you need for your analysis. Try this query and I am sure it is very useful for any person who is working on Teradata. If you are looking for information on how much resources queries took in any given session then I will recommend you to check this post with more details: Top Resource Consuming queries in Teradata.