Database Administration (MOSC)

MOSC Banner

DBMS_SQL_MONITOR.BEGIN_OPERATION has no INSTANNCE ID for RAC?

edited May 29, 2023 4:36PM in Database Administration (MOSC) 3 commentsAnswered ✓

hi,


DBMS_SQL_MONITOR.BEGIN_OPERATION has no argument for instnace_id when working with RAC ?



Where is the instance id for those using RAC?


DBMS_SQL_MONITOR.BEGIN_OPERATION (
  dbop_name    IN VARCHAR2,
  dbop_eid    IN NUMBER  := NULL,
  forced_tracking IN VARCHAR2 := NO_FORCE_TRACKING,
  attribute_list IN VARCHAR2 := NULL,
  session_id   IN NUMBER  := NULL,
  session_serial IN NUMBER  := NULL)
 iRETURN NUMBER;

 

   

I can only see session_id and session_serial



Example: To monitor a particular session I would use

-- 1) stat monitoring, I run this from admin user
VARIABLE OP_ID NUMBER;
BEGIN
:OP_ID := DBMS_SQL_MONITOR.BEGIN_OPERATION ( DBOP_NAME => 'ORA.SOE.TOPCUSTOMERS', SESSION_ID => 24, SESSION_SERIAL => 25523, FORCED_TRACKING => 'Y' );
END;
/

print :OP_ID

-- 2) Then I would run a query from admin user to monitor the progress of certain sql statement, for session with SESSION_ID 24 and SESSION_SERIAL 25523.

-- 3) stop monitoring I run this from admin user
BEGIN
	DBMS_SQL_MONITOR.END_OPERATION (
	DBOP_NAME => 'ORA.SOE.TOPCUSTOMERS',
	DBOP_EID => :OP_ID
	);
END;
/




Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center