在oracle中,可以利用select语句查询表的总数,该语句用于从数据库中选取数据,当与count()配合使用时,就可以查询用户下的表数量,语法为“select count(1) from user_tables;”。
本教程操作环境:windows10系统、oracle 11g版、dell g3电脑。
oracle怎么查询表总数查询用户下的表数量
select count(1) from user_tables;
查询用户下的表的字段数量
select count(1) from user_col_comments c where exists (select 1 from user_tables t where t.table_name = c.table_name);
查询表记录数量
select t.table_name, t.num_rows, t.blocks, t.empty_blocks from user_tables t;
查询表备注
select table_name, table_type, comments from user_tab_comments where comments like '%字典%'
查询表所占空间
analyze table t_data compute statistics; select num_rows , avg_row_len from user_tables where table_name = 't_data'; select segment_name, sum(bytes) / 1024 / 1024 from user_extents group by segment_name;
推荐教程:《oracle视频教程》
以上就是oracle怎么查询表总数的详细内容。