码迷,mamicode.com
首页 > 数据库 > 详细

oracle表空间到32G后扩容

时间:2019-01-14 14:40:46      阅读:469      评论:0      收藏:0      [点我收藏+]

标签:weight   name   ext   物理   nvl   pre   pac   dbf   sele   

/*查看表空间物理文件的名称及大小*/SELECT tablespace_name,file_id,file_name,round(bytes / (1024 * 1024), 0) total_space 
FROM dba_data_files ORDER BY tablespace_name; 

/*查看表空间的使用情况*/ 
select
  a.a1                                                        表空间名称,
    trunc(b.b3/1024/1024/1024,2)                                表空间总大小G,
  trunc(b.b2/1024/1024/1024,2)                                表空间文件已有大小G,  --同一表空间DBF文件目前大小总和
  round((b.b2-a.a2)/1024/1024/1024,2)                         已使用G,
    trunc(b.b2/1024/1024/1024-(b.b2-a.a2)/1024/1024/1024,2)     剩余大小G,
    trunc((b.b3/1024/1024-(b.b2-a.a2)/1024/1024)/1024,2)        可用表空间G
from
  (select tablespace_name a1,sum(nvl(bytes,0)) a2 from dba_free_space group by tablespace_name) a,
  (select tablespace_name b1,sum(bytes) b2,sum(maxbytes) b3 from dba_data_files group by tablespace_name) b
where a.a1=b.b1;

/*增加表空间*/alter tablespace HTBASE add datafile D:\APP\BLJ-USER\ORADATA\HTBASE\HTBASE102.DBF size 500M autoextend on next 5M maxsize unlimited;

 

oracle表空间到32G后扩容

标签:weight   name   ext   物理   nvl   pre   pac   dbf   sele   

原文地址:https://www.cnblogs.com/lm970585581/p/10266018.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!