Tuesday, January 26, 2021

High Sync ASM rebalance Waits When DB is Promoted to 13c EM

High number of Sync ASM rebalance waits were observed on the database after it was promoted to the EM 13.4The below SQLS were identified as the two SQLs causing most of the waits.
6zcsw17mp4k2y
SELECT pdb.name, m.tablespace_name, ROUND(m.used_percent, :"SYS_B_0"), ROUND((m.tablespace_size - m.used_space)*t.block_size/:"SYS_B_1"/:"SYS_B_2", :"SYS_B_3") mb_free
FROM cdb_tablespace_usage_metrics m, cdb_tablespaces t,
(SELECT con_id, name
FROM v$containers ) pdb
WHERE t.contents = :"SYS_B_4" AND t.tablespace_name = m.tablespace_name AND m.con_id = t.con_id AND m.con_id = pdb.con_id

1pc09k1rjgtwu
SELECT pdb.name, m.tablespace_name, ROUND(m.used_percent, :"SYS_B_0"), ROUND((m.tablespace_size - m.used_space)*t.block_size/:"SYS_B_1"/:"SYS_B_2", :"SYS_B_3") mb_free
FROM cdb_tablespace_usage_metrics m, cdb_tablespaces t, v$parameter p,
(SELECT con_id, name
FROM v$containers) pdb
WHERE p.name = :"SYS_B_4" AND p.value != :"SYS_B_5" AND t.contents = :"SYS_B_6" AND t.tablespace_name = m.tablespace_name AND m.con_id = t.con_id AND m.con_id = pdb.con_id

This appear to be a known issue as per 2375714.1 although the SQL on the doc 2375714.1 is different.



Solution for above is to set the hiddden parameter "_use_cached_asm_free_space" to true on the database instance.
Oracle support confirmed the hidden parameter setting is valid for 19c CDB as well.
After setting it the Sync ASM rebalance waits reduced.

Useful Metalink notes
EM13c Space Monitoring Query (sqlid=69p6my4hpdm3j) On dba_tablespace_usage_metrics Timed Out after Db Upgraded To 12.2 [ID 2375714.1]