Oracle EBS-SQL (SYS-15):查询表空间2.sql
2014-06-09 14:25
375 查看
/*表空间查询*/
SELECT d.status "状态",
d.tablespace_name "名称",
d.contents "类型",
TO_CHAR(NVL(a.bytes / 1024 / 1024, 0),'99G999G990D900') "大小 (M)",
TO_CHAR(NVL(a.bytes - NVL(f.bytes, 0),0)/1024/1024, '99G999G990D900') "已使用 (M)",
TO_CHAR(NVL((a.bytes - NVL(f.bytes, 0)) / a.bytes * 100, 0), '990D00') "占用率 %"
FROM sys.dba_tablespaces d,
(select tablespace_name, sum(bytes) bytes
from dba_data_files group by tablespace_name) a,
(select tablespace_name, sum(bytes) bytes
from dba_free_space group by tablespace_name) f
WHERE d.tablespace_name = a.tablespace_name(+)
AND d.tablespace_name = f.tablespace_name(+)
ORDER BY D.TABLESPACE_NAME;
-------------------------------------------------------------------------------------------------
/*表空间查询*/
select a.file_id FileNo,
a.tablespace_name "Tablespace_name",
a.bytes "Bytes",
a.bytes - sum(nvl(b.bytes, 0)) Used,
sum(nvl(b.bytes, 0)) Free,
sum(nvl(b.bytes, 0)) / a.bytes * 100 "%free" -- 空间可用
from dba_data_files a,
dba_free_space b
where a.file_id = b.file_id(+)
group by a.tablespace_name,
a.file_id,
a.bytes order by a.tablespace_name;
SELECT d.status "状态",
d.tablespace_name "名称",
d.contents "类型",
TO_CHAR(NVL(a.bytes / 1024 / 1024, 0),'99G999G990D900') "大小 (M)",
TO_CHAR(NVL(a.bytes - NVL(f.bytes, 0),0)/1024/1024, '99G999G990D900') "已使用 (M)",
TO_CHAR(NVL((a.bytes - NVL(f.bytes, 0)) / a.bytes * 100, 0), '990D00') "占用率 %"
FROM sys.dba_tablespaces d,
(select tablespace_name, sum(bytes) bytes
from dba_data_files group by tablespace_name) a,
(select tablespace_name, sum(bytes) bytes
from dba_free_space group by tablespace_name) f
WHERE d.tablespace_name = a.tablespace_name(+)
AND d.tablespace_name = f.tablespace_name(+)
ORDER BY D.TABLESPACE_NAME;
-------------------------------------------------------------------------------------------------
/*表空间查询*/
select a.file_id FileNo,
a.tablespace_name "Tablespace_name",
a.bytes "Bytes",
a.bytes - sum(nvl(b.bytes, 0)) Used,
sum(nvl(b.bytes, 0)) Free,
sum(nvl(b.bytes, 0)) / a.bytes * 100 "%free" -- 空间可用
from dba_data_files a,
dba_free_space b
where a.file_id = b.file_id(+)
group by a.tablespace_name,
a.file_id,
a.bytes order by a.tablespace_name;
相关文章推荐
- Oracle EBS-SQL (SYS-14):查询表空间1.sql
- Oracle EBS-SQL (SYS-3):sys_人员用户名对应关系查询.sql
- Oracle EBS-SQL (SYS-11):查询系统已打的PATCH.sql
- Oracle EBS-SQL (SYS-2): sys_在线用户查询.sql
- Oracle EBS-SQL (SYS-4):sys_职责查询.sql
- Oracle EBS-SQL (SYS-12):查询各Profile的设置情况.sql
- Oracle EBS-SQL (SYS-21):sys_用户名与人员对应关系查询.sql
- Oracle EBS中查询Profile的各种SQL
- 用sys.dm_exec_query_stats 动态管理查看查询最耗 IO 资源的 SQL 语法
- dba_free_space 以及查询剩余表空间百分比和回滚段命中率的SQL
- sql查询选择表中从10到15的记录
- sql查询选择表中从10到15的记录
- Oracle 查询数据库表空间sql语句
- MS SQL Server 2000中查询数据库每个表占用磁盘空间情况
- SQL查询某数据库各表占用磁盘空间和收缩数据库MDF文件
- ms sqlserver 2008 空间查询操作
- SYSBASE 限定SQL查询显示(top 10)
- MS Sql Server查询磁盘的可用空间,数据库数据文件及日志文件的大小及利用率
- 查询SQL表占用空间(sp_spaceused 表名) 收藏
- 查询SQL表占用空间(sp_spaceused 表名)