oracle表空间操作
上一篇 /
下一篇 2012-12-21 10:55:30
/ 个人分类:数据库
1、查看剩余表空间
select a.file_id "FileNo",a.tablespace_name
"Tablespace_name",
a.bytes "Bytes",a.bytes-sum(nvl(b.bytes,0)) "Used",
sum(nvl(b.bytes,0)) "Free",
sum(nvl(b.bytes,0))/a.bytes*100 "%free"
from dba_data_files a, dba_free_space b
where a.file_id=b.file_id(+)
group by a.tablespace_name ,
a.file_id,a.bytes order by a.tablespace_name;
2、查看表空间(包含路径)
select tablespace_name,file_id,bytes,file_name from dba_data_files;
3、创建表空间
create tablespace xxx datafile 'E:/APP/ADMINISTRATOR/ORADATA/ORCL2/xxx.dbf'
size 800M autoextend on next 50M;
4、修改表空间大小
alter database datafile 'E:/APP/ADMINISTRATOR/ORADATA/ORCL2/xxx.dbf' resize 800M;
5、为表空间增加数据文件:
alter tablespace sales add datafile 'E:/APP/ADMINISTRATOR/ORADATA/ORCL2/xxx01.dbf' size 800M autoextend on next 50M maxsize 1000M;
6、建立临时表空间
create temporary tablespace temp tempfile 'E:/APP/ADMINISTRATOR/ORADATA/ORCL2/temp.dbf' size 50m autoextend on next 50m maxsize 2048m extent management local;
收藏
举报
TAG: