Hello All,
I know I have asked you a question similar to below in the past, but the request keeps changing on me.
Here is another attempt at getting a weekly Growth of tablesapces and use ROLLUP function to see the weekly total of space usage by schema owner. Below is proposed output
Week TABLESPACE OWNER Space Total-Schema Percent of Total Disk Usage
Ending NAME Used Size
--------- --------------- ------ ---------------- ---------------------------
SWT_DATA SWT
SWT_DATA SWT
SWT_INDEX SWT
SWT_DATA SWT
Weekly Total
DRSYS WKSYS
DRSYS WKSYS
DRSYS WKSYS
Weekly Total
Here is my code:
select
TO_CHAR(SYSDATE,'MON DD, YYYY HH24:MI:SS') "Week Ending", -- to bt executed every Sunday
sum(space_used_delta) / 1024 / 1024 "Space used (M)",
c.owner,
sum(c.bytes) / 1024 / 1024 "Total Schema Size (M)",
round(sum(space_used_delta) / sum(c.bytes) * 100, 2) || '%' "Percent of Total Disk Usage"
from
dba_hist_snapshot sn,
dba_hist_seg_stat a,
dba_objects b,
dba_segments c
where end_interval_time > trunc(sysdate) - 7
and sn.snap_id = a.snap_id
and b.object_id = a.obj#
and b.owner = c.owner
and b.object_name = c.segment_name
and c.owner not in ('SYSTEM', 'XDB', 'SYS', 'TSMSYS', 'MDSYS', 'EXFSYS', 'WMSYS', 'ORDSYS', 'OUTLN', 'DBSNMP')
GROUP BY ROLLUP((TO_CHAR(SYSDATE,'MON DD, YYYY HH24:MI:SS'),c.owner)
order by (TO_CHAR(SYSDATE,'MON DD, YYYY HH24:MI:SS'),
c.owner)
I was wondering if anyone could help with this.
Thanks a lot.
I know I have asked you a question similar to below in the past, but the request keeps changing on me.
Here is another attempt at getting a weekly Growth of tablesapces and use ROLLUP function to see the weekly total of space usage by schema owner. Below is proposed output
Week TABLESPACE OWNER Space Total-Schema Percent of Total Disk Usage
Ending NAME Used Size
--------- --------------- ------ ---------------- ---------------------------
SWT_DATA SWT
SWT_DATA SWT
SWT_INDEX SWT
SWT_DATA SWT
Weekly Total
DRSYS WKSYS
DRSYS WKSYS
DRSYS WKSYS
Weekly Total
Here is my code:
select
TO_CHAR(SYSDATE,'MON DD, YYYY HH24:MI:SS') "Week Ending", -- to bt executed every Sunday
sum(space_used_delta) / 1024 / 1024 "Space used (M)",
c.owner,
sum(c.bytes) / 1024 / 1024 "Total Schema Size (M)",
round(sum(space_used_delta) / sum(c.bytes) * 100, 2) || '%' "Percent of Total Disk Usage"
from
dba_hist_snapshot sn,
dba_hist_seg_stat a,
dba_objects b,
dba_segments c
where end_interval_time > trunc(sysdate) - 7
and sn.snap_id = a.snap_id
and b.object_id = a.obj#
and b.owner = c.owner
and b.object_name = c.segment_name
and c.owner not in ('SYSTEM', 'XDB', 'SYS', 'TSMSYS', 'MDSYS', 'EXFSYS', 'WMSYS', 'ORDSYS', 'OUTLN', 'DBSNMP')
GROUP BY ROLLUP((TO_CHAR(SYSDATE,'MON DD, YYYY HH24:MI:SS'),c.owner)
order by (TO_CHAR(SYSDATE,'MON DD, YYYY HH24:MI:SS'),
c.owner)
I was wondering if anyone could help with this.
Thanks a lot.