Closed joschi99 closed 1 year ago
I have tried out another script with same output:
SELECT df.tablespace_name tablespace_name,
max(df.autoextensible) auto_ext,
round(df.maxbytes / (1024 * 1024), 2) max_ts_size,
round((df.bytes - sum(fs.bytes)) / (df.maxbytes) * 100, 2) max_ts_pct_used,
round(df.bytes / (1024 * 1024), 2) curr_ts_size,
round((df.bytes - sum(fs.bytes)) / (1024 * 1024), 2) used_ts_size,
round((df.bytes-sum(fs.bytes)) * 100 / df.bytes, 2) ts_pct_used,
round(sum(fs.bytes) / (1024 * 1024), 2) free_ts_size,
nvl(round(sum(fs.bytes) * 100 / df.bytes), 2) ts_pct_free
FROM dba_free_space fs,
(select tablespace_name,
sum(bytes) bytes,
sum(decode(maxbytes, 0, bytes, maxbytes)) maxbytes,
max(autoextensible) autoextensible
from dba_data_files
group by tablespace_name) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY df.tablespace_name, df.bytes, df.maxbytes
UNION ALL
SELECT df.tablespace_name tablespace_name,
max(df.autoextensible) auto_ext,
round(df.maxbytes / (1024 * 1024), 2) max_ts_size,
round((df.bytes - sum(fs.bytes)) / (df.maxbytes) * 100, 2) max_ts_pct_used,
round(df.bytes / (1024 * 1024), 2) curr_ts_size,
round((df.bytes - sum(fs.bytes)) / (1024 * 1024), 2) used_ts_size,
round((df.bytes-sum(fs.bytes)) * 100 / df.bytes, 2) ts_pct_used,
round(sum(fs.bytes) / (1024 * 1024), 2) free_ts_size,
nvl(round(sum(fs.bytes) * 100 / df.bytes), 2) ts_pct_free
FROM (select tablespace_name, bytes_used bytes
from V$temp_space_header
group by tablespace_name, bytes_free, bytes_used) fs,
(select tablespace_name,
sum(bytes) bytes,
sum(decode(maxbytes, 0, bytes, maxbytes)) maxbytes,
max(autoextensible) autoextensible
from dba_temp_files
group by tablespace_name) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY df.tablespace_name, df.bytes, df.maxbytes
ORDER BY 4 DESC;
TABLESPACE_NAME AUT MAX_TS_SIZE MAX_TS_PCT_USED CURR_TS_SIZE USED_TS_SIZE TS_PCT_USED FREE_TS_SIZE TS_PCT_FREE
------------------------------ --- ----------- --------------- ------------ ------------ ----------- ------------ -----------
TS YES 458752 78.03 374860 357982.69 95.5 16877.31 5
what did you get with that request ?
SELECT
tum.tablespace_name "Tablespace",
t.status "Status",
t.contents "Type",
t.extent_management "Extent Mgmt",
tum.used_space*t.block_size bytes,
tum.tablespace_size*t.block_size bytes_max
FROM
DBA_TABLESPACE_USAGE_METRICS tum
INNER JOIN
dba_tablespaces t on tum.tablespace_name=t.tablespace_name
Tablespace Status Type Extent Mgm BYTES BYTES_MAX
------------------------------ --------- --------- ---------- ---------- ----------
TS ONLINE PERMANENT LOCAL 3.7541E+11 4.1230E+11
Do you know why 'DBA_TABLESPACE_USAGE_METRICS' table doesn't provide the same result ?
Hi @garnier-quentin, I have done some research on Oracle Metalink and it seem's a bug related to some Oracle versions. For the version 11.2.0.4 in our case I have found more issues like https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=570258753082989&id=22076509.8&displayIndex=3&_afrWindowMode=0&_adf.ctrl-state=50d2q4h2x_508 https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=570438206998654&id=19267095.8&displayIndex=6&_afrWindowMode=0&_adf.ctrl-state=50d2q4h2x_565
But it seem's that there are different issues also on newer version of Oracle related to DBA_TABLESPACE_USAGE_METRICS.
I cant see support oracle page. Could you provide exact ranges of oracle versions ? I could exclude it
Hi @garnier-quentin, attached you will find 2 issue about them, but on metalink are still more issues related to this view regarding different Oracle Versions, but Oracle will also provide patches for this. At the moment we will verify if the encountered problem on 11.2.0.4 can be fixed applying the Patchset from Oracle. I will update you asap.
So the only version is '11.2.0.4' if i understand.
Not sure about them. There seems a lot of different problems with this view related on different Oracle versions:
Ouch....
Maybe you have to consider to substitute this view generally.
Yes. But we have some performances issues when we don't use that view with many tablespaces. Maybe we can enhance the request performance.
I understand. Let me know if I can help, is a priority to have correct and fast tablespace monitoring.
It seems also that this view has not all the tablespaces, prior to version 12.1.0.2.4.
Hi @garnier-quentin, did you have done some evaluation how it could be possible to have a correct tablespace usage monitoring without performance issues?
I don't. But if you have a request i could update it.
Hi, Thanks for your interest in Centreon. Requests for new features and enhancements must be suggested here. Troubleshooting and questions must now be asked here (cf our new issue template.
Thank you for your understanding.
Centreon Plugins 20191016 Oracle 11g
If we monitor a Oracle TS with Centreon Plugins we have to following output:
But if we check the TS usage by SQL or for example with Quest Oracle Navigator we got another output:
The Centreon Plugin returns wrong on Total, usage and free_prct.