Ai
1 Star 1 Fork 0

冯际成/Oracle_SQL_Scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dba_owner_to_tablespace_segment.sql 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
Abdul mohammed 提交于 2016-02-06 08:58 +08:00 . Fri Feb 5 18:58:16 CST 2016
-- | PURPOSE : Provide a summary report of owner to tablespace for all |
-- | segments in the database. |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
SET PAGESIZE 9999
COLUMN owner FORMAT A15 HEADING "Owner"
COLUMN tablespace_name FORMAT a30 HEADING "Tablespace Name"
COLUMN segment_type FORMAT A18 HEADING "Segment Type"
COLUMN bytes FORMAT 9,999,999,999,999 HEADING "Size (in Bytes)"
COLUMN seg_count FORMAT 9,999,999,999 HEADING "Segment Count"
break on report on owner skip 2
compute sum label "" of seg_count bytes on owner
compute sum label "Grand Total: " of seg_count bytes on report
SELECT
owner
, tablespace_name
, segment_type
, sum(bytes)/1024/1024 Mbytes
, count(*) seg_count
FROM
dba_segments
GROUP BY
owner
, tablespace_name
, segment_type
ORDER BY
owner
, tablespace_name
, segment_type
/
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

搜索帮助