如何给oracle数据库添加表空间

--查表空间占用大小的sql
Select b.file_name 物理文件名,
b.tablespace_name 表空间,
b.bytes/1024/1024 大小M,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M,
substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率
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.bytes
order by b.tablespace_name

--给表空间增加30G

alter tablespace USERS add datafile '表空间名称' size 30782M;
alter database datafile '表空间名称' autoextend on;

注:表空间名称即为上面查询出来的物理文件名

猜你喜欢

转载自www.cnblogs.com/dreamfly6/p/11776910.html