在Oracle數據庫中,您可以使用以下查詢來查看數據庫的總大小和表空間的使用情況:
SELECT SUM(bytes)/1024/1024 AS "Database Size (MB)" FROM dba_data_files;
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;
SELECT table_name, SUM(bytes)/1024/1024 AS "Table Size (MB)"
FROM dba_segments
GROUP BY table_name;
請注意,以上查詢需要具有適當的權限才能成功運行。