oracle扩容

动态添加表空间:

alter   tablespace cbs_cos add datafile '/dba/oradata/ORADEVdatafile/cbs_cos02.dbf' size 100m autoextend on next 100m

查看表空间使用情况

SELECT a.tablespace_name "表空间名",
a.bytes / 1024 / 1024 "表空间大小(M)",
(a.bytes - b.bytes) / 1024 / 1024 "已使用空间(M)",
b.bytes / 1024 / 1024 "空闲空间(M)",
round(((a.bytes - b.bytes) / a.bytes) * 100, 2) "使用比"
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

查看表空间文件位置:

SELECT file_id, file_name, tablespace_name, autoextensible, increment_by
FROM dba_data_files
WHERE tablespace_name = 'CBS_COS'
ORDER BY file_id desc;

参考网页:

http://zhidao.baidu.com/link?url=y21Xl4b0bKDSqdiP3V5RsjfSKVd751skMrLsNmCnXNKfycCKbEu8ObkyZ2VgNev2a6EIpXwLslBzw1-jR4yo4q

原文地址:https://www.cnblogs.com/lianshan/p/5734265.html