加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle表空间到32G后扩容

发布时间:2020-12-12 13:21:45 所属栏目:百科 来源:网络整理
导读:/* 查看表空间物理文件的名称及大小 */ 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 /
/*查看表空间物理文件的名称及大小*/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:APPBLJ-USERORADATAHTBASEHTBASE102.DBF size 500M autoextend on next 5M maxsize unlimited;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读