- 查询用户对应的表空间,我们可以看到针对不同的数据库用户Oracle
SELECT
username,
default_tablespace,
temporary_tablespace
FROM
dba_users;
SELECT
tablespace_name,
file_id,
file_name,
ROUND (bytes /(1024 * 1024), 0) total_space
FROM
dba_data_files
ORDER BY
tablespace_name;
- 用户对应的表空间,以及表空间的大小,可以在通过下述语句查看目前使用百分比
SELECT
A .tablespace_name "表空间名",
total "表空间大小",
free "表空间剩余大小",
(total - free) "表空间使用大小",
total / (1024 * 1024 * 1024) "表空间大小(G)",
free / (1024 * 1024 * 1024) "表空间剩余大小(G)",
(total - free) / (1024 * 1024 * 1024) "表空间使用大小(G)",
ROUND ((total - free) / total, 4) * 100 "使用率 %"
FROM
(
SELECT
tablespace_name,
SUM (bytes) free
FROM
dba_free_space
GROUP BY
tablespace_name
) A,
(
SELECT
tablespace_name,
SUM (bytes) total
FROM
dba_data_files
GROUP BY
tablespace_name
) b
WHERE
A .tablespace_name = b.tablespace_name;
- SYSTEM扩增到3000M,将对应的FILE_NAME写在' '
ALTER DATABASE DATAFILE '/home/oracle/app/oracle/oradata/ORA11G/system01.dbf' RESIZE 3000m;
网友评论