One of the items that comes up with the ZDLRA is a storage checkup. The DBAs want to know more detail about the storage utilization of each database.
select db_unique_name,
trunc(size_estimate,0) estimated_db_size,
recovery_window_goal,
trunc(space_usage,0) space_usage,
trunc(estimate_zero_day_space - ((estimate_seven_day_space - estimate_one_day_space)/6),0) level_0_size,
trunc((estimate_seven_day_space - estimate_one_day_space)/6,1) one_day_space,
trunc(recovery_window_space,0) recovery_window_space,
disk_reserved_space,
estimate_rwg_space
from
(Select db_unique_name,
Space_usage,
extract(day from recovery_window_goal) recovery_window_goal,
dbms_ra.estimate_space (DB_UNIQUE_NAME,numtodsinterval(1,'day')) estimate_zero_day_space,
dbms_ra.estimate_space (DB_UNIQUE_NAME,numtodsinterval(1,'day')) estimate_one_day_space,
dbms_ra.estimate_space (DB_UNIQUE_NAME,numtodsinterval(7,'day')) estimate_seven_day_space,
dbms_ra.estimate_space (DB_UNIQUE_NAME,recovery_window_goal) estimate_rwg_space,
RECOVERY_WINDOW_SPACE,
disk_reserved_space,
size_estimate
from ra_database);
DB_UNIQUE_NAME |
DB name |
RECOVERY_WINDOW_GOAL |
How long backups are kept |
SPACE_USAGE |
How much space (GB) is the DB using in total ? |
LEVEL_0_SIZE |
Estimated size (GB) of just the full backup |
ONE_DAY_SPACE |
Estimated space usage (GB) for a single day of backups |
RECOVERY_WINDOW_SPACE |
How much space is needed for a 14 day recovery window. |
DISK_RESERVED_SPACE |
How much space is set aside for backups ? |
ESTIMATE_DB_SIZE |
How big is the database (GB) estimated to be ? |
ESTIMATE_RWG_SPACE |
This returns the space (GB) needed for the recovery
window from RA_DATABASE which may not match calculating using the columns returned. |
Now let's take a look at what I can do with this..
This is an example, where I summarize the space utilization for a couple of ZDLRAs.
And here I looked at the detail for the databases.
This report (just above this) gives me some really useful information.
- I can see DB02 has a really big change rate. The database is only about 2.5 TB, but it is using 14 TB of storage.
- I can see the disk_reserved_space is way too small for DB01. DB01 needs about 15 TB to keep it's recovery window goal, but the disk_reserved_space is only 500 GB
- DB03 looks good. Change rate is not significant, and disk_reserved_space is set a little higher than the RECOVERY_WINDOW_SPACE.
Hi Bryan,
ReplyDeleteYour query and blog have been helpful since ZDLRA and Exadata are new to me.
As of our most recent update to ZDLRA_21.1.0_LINUX.X64_RELEASE, unfortunately this query is giving us the following error:
ORA-14551: cannot perform a DML operation inside a query
ORA-06512: at "RASYS.DBMS_RA_MISC", line 4985
ORA-06512: at "RASYS.DBMS_RA", line 1182
ORA-06512: at line 1
Any updates to the query?
I did notice the same issue, and I you can look at this blog post where I figured out how to get around that issue.
ReplyDeletehttps://bryangrenn.blogspot.com/2022/10/estimated-space-for-compliance-window.html