Home >Database >Mysql Tutorial >[小技巧]手工扩大Oracle数据库表空间的方法

[小技巧]手工扩大Oracle数据库表空间的方法

WBOY
WBOYOriginal
2016-06-07 16:50:591118browse

1、首先查看表空间的名字和所属文件select tablespace_name, file_id, file_name,round(bytes/(1024*1024),0) total_spacefrom d

1、首先查看表空间的名字和所属文件

select tablespace_name, file_id, file_name,round(bytes/(1024*1024),0) total_spacefrom dba_data_filesorder by tablespace_name;


2、增加数据文件

alter tablespace users add datafile '/u01/Oracle/oradata/umail/users02.dbf'  size 4000M autoextend off;alter database datafile '/u01/oracle/oradata/umail/user01.dbf' autoextend off;


3、设定后查看表空间信息

SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE CWHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;

完成。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn