1.赋权(model为当前用户名,需改为自己的)
grant select any dictionary to model;
2.查询所有空间
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;
例查询结果如下图所示,要给agent加空间
3.给对应表空间再分配,文件路径为/opt/oracle/oradata/AGENT1.dbf,在原来的路径再加后缀即可。
alter tablespace agent add datafile '/opt/oracle/oradata/AGENT1.dbf' size 30000M;--30G