QQ空间 新浪微博 腾讯微博 人人网 更多 技术资料谨慎模仿操作,操作不挡后果自负
当前位置:首页 »数据库»oracle»table space
oracle表空间管理
[导读]oracle表空查询,扩容

查询表间

select a.tablespace_name,a.bytes bytes_used,b.largest,round(((a.bytes-b.bytes)/a.bytes)*100,2) percent_used
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name)a,
(select tablespace_name,sum(bytes) bytes ,max(bytes) largest from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by((a.bytes-b.bytes) /a.bytes) desc

扩容表空间
1.alter database datafile 'datax.ora' autoextend on next 500m maxsize 10000m;
2.alter tablespace system add datafile 'datax.ora';
3.create tablespace users datafile 'datax.ora' autoextend on next 500m maxsize 10000m;

移动数据文件
一,表空间级方法
1.先把把空间离线
alter tablespace xxxdata offline;
2.把原数据文件拷贝到目标磁盘

3.alter tablespace xxxdata rename datafile '/u01xdata1.dbf' to

/'u02xdata1.dbf';
4.表空间上线
alter tablespce xxxdata online;
二,数据库级
1,database must be mounted
startup mount;
2.target data file must exits
3.alter database rename file '/u01/oradata/system01.dbf' to

'/u02/oradata/system01.dbf';
4.alter database open;

  • 上一篇:00
  • 下一篇: 01
  • 【免责声明:本站所发表的文章,大部分来源于各相关媒体或者网络,内容仅供参阅,与本站立场无关。如有不符合事实,或影响到您利益的文章,请及时告知,本站立即删除。谢谢监督。】
    资讯搜索
  •   
  • 数据库维护专区15851499111
  • 数据库 orcle db2
  • 推荐资讯
  • 一、苏州数据库维护
  • 二、苏州数据库数据恢复
  • 三、苏州数据库数据处理
  • 四、苏州erp系统数据维护
  • 五、金蝶ERP系统维护
  • 六、
  • 七、
  • 八、
  • 九、
  • 十、..
  • 图片资讯
    相关资讯
  • 一、.
  • 二、
  • 三、
  • 四、
  • 五、
  • 六、
  • 七、
  • 八、
  • 九、
  • 十、..