Oracle: 扩充TableSpace语句

Categories: Database; Tagged with: ; @ November 13th, 2011 13:31

Step1: check current status and get all file path
SELECT
B.FILE_NAME FILENAME,
B.TABLESPACE_NAME TABLESPACENAME,
B.BYTES/1024/1024 SIZE_MB,
(B.BYTES-SUM(NVL(A.BYTES,0)))/1024/1024 USED_MB,
substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) Percentage
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
GROUP BY B.TABLESPACE_NAME,B.FILE_NAME,B.BYTES
order by b.tablespace_name;

Step2: enlarge table space file
alter database datafile 'C:\ORACLEXE\APP\ORACLE\ORADATA\XX\USERS.DBF' resize 2000m;

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.