Chinaunix首页 | 论坛 | 博客
  • 博客访问: 32901
  • 博文数量: 17
  • 博客积分: 696
  • 博客等级: 上士
  • 技术积分: 170
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-14 16:59
文章分类

全部博文(17)

文章存档

2010年(4)

2009年(13)

我的朋友

分类: Oracle

2009-03-14 23:17:09

查看表空间的使用情况
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 tablespace dgyy offline;
2. mv 'oldplacefile' 'newpacefile'
3.alter tablespace userdate rename
datafile 'oldplacefile1'
to 'newpacefile';
第二种
1. database must shutdown
2. mv 'oldplacefile' 'newpacefile'
3. startup mount
4. alter database rename file 'oldfile' to 'newfile'
5. alter database open

表空间扩容
alter tablespace dgyy add datafile
'/u01/newfile.dbf'
size 40m
autoextend on next 10m
maxsize 1000M;

alter database datafile '/u01/file.dbf'
resize 1000M;

alter database datafile '/u01/file.dbf'
autoextend on next 10m
maxsize 10000m;



阅读(432) | 评论(0) | 转发(0) |
0

上一篇:undo表空间的学习

下一篇:ORA-32004

给主人留下些什么吧!~~