The following statement is likely to throw an ORA-40478 error:
select
owner,
json_arrayagg(json_array(
obj.object_name,
obj.object_type,
obj.created
))
from
dba_objects obj
where
obj.owner not in ('SYS', 'SYSTEM')
group by
owner;
Use the returning clob clause for the json_arrayagg function to prevent the ORA-40478 error:
select
owner,
json_arrayagg(json_array(
obj.object_name,
obj.object_type,
obj.created
)
RETURNING CLOB
)
from
dba_objects obj
where
obj.owner not in ('SYS', 'SYSTEM')
group by
owner;