-1、檢視表在那個表空間
select tablespace_name,table_name from user_talbes where table_name='
test';
--2、獲取使用者的預設表空間
select username, default_tablespace from dba_users where username='
mxh'
;--3
、檢視表空間所有的檔案
select * from dba_data_files where tablespace_name='
users';
--4、檢視表空間使用情況:
select tbs 表空間名,
sum(totalm) 總共大小m,
sum(usedm) 已使用空間m,
sum(remainedm) 剩餘空間m,
sum(usedm)/sum(totalm)*100
已使用百分比,
sum(remainedm)/sum(totalm)*100
剩餘百分比
from(
select b.file_id id,
b.tablespace_name tbs,
b.file_name name,
b.bytes/1024/1024
totalm,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024
usedm,
sum(nvl(a.bytes,
0)/1024/1024
) remainedm,
sum(nvl(a.bytes,
0)/(b.bytes)*100
),
(100 - (sum(nvl(a.bytes,0))/(b.bytes)*100
))
from dba_free_space a,dba_data_files b
where a.file_id =b.file_id
group by b.tablespace_name,b.file_name,b.file_id,b.bytes
order by b.tablespace_name
)
group by tbs
--5、擴充套件表空間
alterdatabase datafile
'd:\oracle\product\oradata\test\users01.dbf
'resize 50m;
--自動增長
alterdatabase datafile
'd:\oracle\product\oradata\test\users01.dbf
'autoextend onnext 50m maxsize 500m;
--增加資料檔案
alter tablespace users add datafile
'd:\users02.dbf
' size 5m;
Oracle表空間不足的處理步驟
oracle表空間不足的處理步驟 1.檢視所有表空間使用情況 select b.file id 檔案id號,b.tablespace name 表空間名,b.bytes 1024 1024 m 位元組數,b.bytes sum nvl a.bytes,0 1024 1024 m 已使用,sum nv...
oracle表空間不足
由於oracle的rowid使用22位來代表資料塊號,因此oracle表空間資料檔案每個資料檔案最多只能包含2 22個資料塊。也因此資料庫表空間的資料檔案不是無限增長的,例如 在資料塊為8k的情況下,單個資料檔案的最大容量為8k 2 22 32g 同理,資料塊為2k,資料檔案最大約8g 資料塊為32...
Oracle表空間不足
出現的問題 ora 01659 無法分配超出 4 的 minextents 在表空間 sde 中 n sde.zd 1.對於小檔案的解決方法 alter database datafile c sde.dbf autoextend on next 100m maxsize unlimited 2.對...