Skip to content

Commit

Permalink
Merge pull request eugenebobkov#44 from eugenebobkov/ORADB_fix
Browse files Browse the repository at this point in the history
ORADB: changed source of information about FRA from v$flash_recovery_…
  • Loading branch information
eugenebobkov authored Feb 7, 2019
2 parents 6944f89 + d88ff04 commit 5fd7cc7
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions bin/zbxoracle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -832,22 +832,10 @@ function get_processes_data() {
#>
function get_fra_data() {
# get FRA utlilization
$result = (run_sql -Query "SELECT trunc(fra_usage.fra_used_pct, 4) used_pct
, trunc(fra_usage.fra_used_pct * fra_size.fra_size_bytes / 100) used_bytes
, fra_size.fra_size_bytes fra_size
FROM (SELECT DECODE( SUBSTR(upper(value), length(value)-1, length(value))
, 'K', to_number(replace(upper(value), 'K', '')) * 1024
, 'M', to_number(replace(upper(value), 'M', '')) * power(1024, 2)
, 'G', to_number(replace(upper(value), 'G', '')) * power(1024, 3)
, 'T', to_number(replace(upper(value), 'T', '')) * power(1024, 4)
, value
) fra_size_bytes
FROM v`$parameter
WHERE name='db_recovery_file_dest_size'
) fra_size
, (SELECT sum(percent_space_used) - sum(percent_space_reclaimable) fra_used_pct
FROM v`$flash_recovery_area_usage
) fra_usage")
$result = (run_sql -Query 'SELECT trunc((space_used - space_reclaimable) / space_limit * 100, 4) used_pct
, space_used used_bytes
, space_limit fra_size
FROM v$recovery_file_dest')

# Check if expected object has been recieved
if ($result.GetType() -eq [System.Data.DataTable]) {
Expand Down

0 comments on commit 5fd7cc7

Please sign in to comment.