查询表间
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;
服务热线:051265581585 15851499111 QQ:71947910 40435865