测试环境有套库,开发人员反映cpu使用率非常高,但是他们没有在数据库执行什么语句。
我生成了awr和实时查看库上语句执行情况,发现有如下语句,一直占有cpu资源:
select s.synonym_name object_name, o.object_type
from all_synonyms s, sys.all_objects o
where s.owner in ('PUBLIC', :schema)
and o.owner = s.table_owner
and o.object_name = s.table_name
and o.object_type in ('TABLE',
'VIEW',
'PACKAGE',
'TYPE',
'PROCEDURE',
'FUNCTION',