[小技巧]手工擴大Oracle資料庫資料表空間的方法

來源:互聯網
上載者:User

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;

完成。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.