在Postgres中,我可能会使用如下内容
select count(p1.*) from pg_partitions p1
where p1.tablename = 'table_name';如何在oracle中编写统计特定表分区个数的查询?甲骨文的pg_partitions是什么?
发布于 2021-09-17 10:57:38
根据您拥有的权限
您拥有的表的分区
select count(*) from user_tab_partitions where table_name = yourtable;您拥有或有权查看的表的分区
select count(*) from all_tab_partitions where table_name = yourtable and table_owner = ownerofthetable ;如果您具有权限select any dictionary或select catalog role,或者拥有对特定dba_tab_partitions视图的已授予权限,则
select count(*) from dba_tab_partitions where table_name = yourtable and table_owner = ownerofthetable ;https://stackoverflow.com/questions/69222109
复制相似问题