-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdbsee_tablefallback.sql
More file actions
27 lines (26 loc) · 1.15 KB
/
dbsee_tablefallback.sql
File metadata and controls
27 lines (26 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*********************************************************************/
/* Author : VLDB */
/* Date : 08/02/2017 */
/* Version : 1 */
/* Description : Generate report on tables with fallback */
/* enabled */
/*********************************************************************/
select t1.databasename as database_name
,t1.tablename as table_name
,t1.tablekind as table_kind
,t1.protectiontype as protection_type
,t1.createtimestamp as create_timestamp
,t1.lastaltername as last_alter_name
,t1.lastaltertimestamp as last_alter_timestamp
,t2.total_perm as total_perm
from dbc.tables t1
inner join
(select databasename
,tablename
,sum(currentperm) as total_perm
from dbc.tablesizev
group by 1,2) t2
on t1.databasename = t2.databasename
and t1.tablename = t2.tablename
where t1.tablekind in ('T','O')
;