表空间大小,路径
col tname format a20
col dname format a60
select t.name as tname, d.name dname, d.bytes/1024/1024/1024 GB
from v$tablespace t join v$datafile d using(ts#)
where t.name like '&tablespace_name';

状态,数据文件
col file_name format a60
col tablespace_name format a20
select tablespace_name, file#, file_name, v.status, v.enabled
from dba_data_files d, v$datafile v
where d.file_id=v.file# and tablespace_name like '&tablespace_name';

本文提供两个SQL查询脚本,分别用于查询表空间的大小、路径及其状态,并获取相关数据文件的信息。通过这些脚本可以有效地管理和维护数据库。
991

被折叠的 条评论
为什么被折叠?



