pulling all the tables and Views not using in prod since from long time in teradata

UDA

pulling all the tables and Views not using in prod since from long time in teradata

Hi Gurus,

Please help me suggesting a query to find for pulling all the tables and Views in teradata .

we have lot of backed up  temp tables and views not using in prod since from long time.

Please find the below SQL's

 

SELECT T.DatabaseName,T.tablename,C.Columnname 
FROM dbc.tables T, dbc.COLUMNS C
WHERE T.Databasename = C.Databasename
AND T.Tablename=C.Tablename
AND LOWER(T.TableName)
  IN  (  'Table_11_VW','Table_12_VW','Table_13_VW','Table_14_VW','Table_15_VW','Table_16_VW','Table_17_VW'
  )
AND LOWER(C.ColumnName) = 'createdate'
AND  T.DatabaseName = 'Tables_VIEW'
ORDER BY 1,2

SELECT MAX(createdate),MIN(createdate),COUNT(*) FROM Table_11_VW;
SELECT MAX(createdate),MIN(createdate),COUNT(*) FROM Table_12_VW;
SELECT MAX(createdate),MIN(createdate),COUNT(*) FROM Table_13_VW;

Please share any queries or suggestions to find the tables and views

 

Thanks

1 REPLY
HP
N/A

Re: pulling all the tables and Views not using in prod since from long time in teradata

will only createdate serve your purpose ?