Oracle查詢資料中占用空間最大的表

2022-08-11 04:51:08 字數 450 閱讀 5073

--第一步,查詢istaudit資料庫檔案id,檔案路徑

select file#,name from v$datafile where lower(name) like '%istaudit.dbf';

--第二步,查詢istaudit資料庫檔案的最大模組

select max(t.block_id) from dba_extents t where t.file_id=7;

--第三步,查詢最大模組的名稱,比如某張表

select segment_name,segment_type,tablespace_name,extent_id,bytes,blocks from dba_extents where file_id=7 and block_id='1221113';

--第四步,刪除該錶

drop /delete /truncate

ORACLE查詢每個表占用空間大小

select select sum bytes from dba segments where owner testbar and segment type table and segment name table name from user tables 錯誤的,對於oracle而言,雙引號 要...

mysql和oracle查詢表占用空間

mysql 需要先進入information schema select table schema as 資料庫 table name as 表名 table rows as 記錄數 truncate data length 1024 1024,2 as 資料容量 mb truncate index...

查詢資料庫中每個表占用空間方法

1.執行如下儲存過程 create procedure dbo sys viewtablespace asbegin set nocount on create table dbo tableinfo 表名 varchar 50 collate chinese prc ci as null,記錄數 ...