Ai
1 Star 1 Fork 0

冯际成/Oracle_SQL_Scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
datafile_like_round.sql 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
Abdul mohammed 提交于 2016-02-06 08:58 +08:00 . Fri Feb 5 18:58:16 CST 2016
col datafile_name format a60 word_wrap
prompt GIVE ONE TABLESPACE NAME OR HIT ENTER FOR ALL TABLESAPCE
prompt Also, give file name like, eg.. /oracle/sapdata, sr3, ..
SELECT t.tablespace_name "Tablespace", 'Datafile' "File Type",
t.status "Tablespace Status", d.status "File Status",
ROUND ((d.max_bytes - NVL (f.sum_bytes, 0)) / 1024 / 1024) "Used MB",
ROUND (NVL (f.sum_bytes, 0) / 1024 / 1024) "Free MB",
(d.bytes/1024/1024) file_mb,
(d.maxbytes/1024/1024) MaxMB,
-- t.initial_extent "Initial Extent", t.next_extent "Next Extent",
-- t.min_extents "Min Extents", t.max_extents "Max Extents",
-- t.pct_increase "Pct Increase",
d.file_name "Datafile_name",
d.file_id,
d.autoextensible
FROM (SELECT tablespace_name, file_id, SUM (BYTES) sum_bytes
FROM dba_free_space
GROUP BY tablespace_name, file_id) f,
(SELECT tablespace_name, file_name, file_id, MAX (BYTES) max_bytes, bytes, maxbytes,
status, autoextensible
FROM dba_data_files
GROUP BY tablespace_name, file_name, file_id, bytes, maxbytes, status, autoextensible) d,
dba_tablespaces t
WHERE t.tablespace_name = d.tablespace_name
AND f.tablespace_name(+) = d.tablespace_name
AND f.file_id(+) = d.file_id
AND t.tablespace_name like upper(nvl('%&tbsp_name%',t.tablespace_name))
AND d.file_name like nvl('%&file_name%',d.file_name)
order by 1;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sapall/Oracle_SQL_Scripts.git
git@gitee.com:sapall/Oracle_SQL_Scripts.git
sapall
Oracle_SQL_Scripts
Oracle_SQL_Scripts
master

搜索帮助