To Bottom |
In this Document
APPLIES TO:Enterprise Manager for Oracle Database - Version 12.1.0.6.0 and laterInformation in this document applies to any platform. GOALWhen target database is monitored via Cloud control agent, it is found that the below SQL is frequently executed at the database: select s.inst_id,S.USERNAME,to_char(s.logon_time,'DD-MON-YYYY HH24:MI:SS')"LOGIN_TIME",s.sid,s.serial#,s.event,s.status,p.spid,s.process,S.SQL_ID,s.program,s.machine,s.module,S.LAST_CALL_ET INST_ID DB User LOGIN_TIME DB SID Serial# EVENT Status Process Process SQL_ID Program Machine MODULE LAST_CALL_ET - The session is started by the user configured as the Monitoring configuration user, in the above case it is 'dbsnmp'. - If the agent is stopped, these sessions are cleaned up. This document explains the purpose of the above statement executed by the agent. SOLUTIONThe reported statement is executed by the Agent as part of the "DB Real Time Monitoring" feature. Agent maintains a persistent connection with the target DB by executing the below statement: BEGIN dbms_lock.sleep(60); END;
The "DB real time monitoring" feature requires that the monitoring configuration user has execute privileges on the dbms_lock package in the target DB: 1. If the monitoring configuration username is set to 'sys as sysdba' or any user which has execute privileges on the dbms_lock package, the statement gets executed successfully. 2. If the monitoring configuration user does not have execute privileges on the dbms_lock package: - Prior to 13.2 agent release, the statement would fail silently and these errors can be identified only if auditing is enabled at the DB. The SQL execution would fail with: ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_LOCK' must be declared
- From 13.2 Agent onwards, this will report errors such as below in the <AGENT_INST>/sysman/log/emagent_sdk.trc file: [320:6947BF8:FetchletExecutor(Sql)oracle_database.] WARN - Persistance Response monitoring is disabled for database target ''. DBSNMP user for this database does not have execute privilege on 'dbms_lock' packge. Please provide the required privilege, set '_enableSqlPersistance. = true' and then reload the agent 'emctl reload agent'
GRANT EXECUTE ON sys.dbms_lock TO dbsnmp;
REFERENCESBUG:22088515 - AGENT CAUSING ORA-06550 IN DATABASE EVERY 60 SECONDS |