意见箱
恒创运营部门将仔细参阅您的意见和建议,必要时将通过预留邮箱与您保持联络。感谢您的支持!
意见/建议
提交建议

oracle如何查看数据库大小

来源:恒创科技 编辑:恒创科技编辑部
2024-05-07 14:00:43

在Oracle数据库中,您可以使用以下查询来查看数据库的总大小和表空间的使用情况:

  1. 查看数据库的总大小:
SELECT SUM(bytes)/1024/1024 AS "Database Size (MB)" FROM dba_data_files;
  1. 查看每个表空间的使用情况:
SELECT tablespace_name, SUM(bytes)/1024/1024 AS "Tablespace Size (MB)", SUM(bytes)/1024/1024 - SUM(blocks)/1024/1024 AS "Tablespace Used (MB)" 
FROM dba_data_files 
GROUP BY tablespace_name;
  1. 查看每个表的大小:
SELECT table_name, SUM(bytes)/1024/1024 AS "Table Size (MB)" 
FROM dba_segments 
GROUP BY table_name;

请注意,以上查询需要具有适当的权限才能成功运行。


oracle如何查看数据库大小

上一篇: c语言字符串数组初始化要注意哪些事项 下一篇: oracle数据库怎么迁移到另一个数据库