日期:2014-05-16  浏览次数:20541 次

oracle 表空间查询,设置
select s.tablespace_name,
       round(sum(s.bytes / 1024 / 1024), 2) as Space,
       round((sum(s.bytes / 1024 / 1024) - nvl(d.fr, 0)), 2) used,
       nvl(round(d.fr, 2), 0) free,
       decode(round(sum(s.maxbytes / 1024 / 1024 / 1024), 2),
              0,
              'NO',
              'YES') auto_extend,
       round(sum(s.maxbytes / 1024 / 1024 / 1024), 2) MaximumGB
  from dba_data_files s,
       (select c.tablespace_name, round(sum(c.bytes / 1024 / 1024), 2) fr
          from dba_free_space c
         group by c.tablespace_name) d
where s.tablespace_name = d.tablespace_name(+)
group by s.tablespace_name, d.fr
order by s.tablespace_name;
         
-- 修改表空间大小
alter database datafile 'D:\app\user\oradata\COMMON_DATA.dbf' resize 10240M;
-- 设置自动增加1G
alter database datafile 'D:\app\user\oradata\COMMON_DATA.dbf' autoextend on next 1024m;