Query to find the last access date of a database.

Database
The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.

Query to find the last access date of a database.

Query to find the latest access date of a database

I know that we have a column called latestAccessdate in dbc.tables . But is that accurate and is there any other better way to get the last access date?

How does the latestAccessdate column in dbc.tables get updated when there is a change in a database?

2 REPLIES
Senior Apprentice

Re: Query to find the last access date of a database.

Hi,

Assuming that you're on TD14+ then this is done using a DBQL (query logging) option. Look at the USECOUNT option which is set for specific databases (https://info.teradata.com/HTMLPubs/DB_TTU_15_10/index.html#page/SQL_Reference/B035_1144_151K/BEGIN_Q...).

 

I'm guessing that this is updated when the query log buffer(s) get flushed from cache to disk. By default that is every 10 minutes (at worst). If a buffer fills earlier then it will get flushed earlier.

 

HTH

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Senior Apprentice

Re: Query to find the last access date of a database.

And I recommend that you use DBC.TablesV and not DBC.Tables.

 

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com