Accessing x$kglob through v$db_object_cache
Mikhail Velikikh, December 05, 2019 - 12:38 pm UTC
I am still able to access views based on X$KGLOB in 19c. They might get invalid after the upgrade because of referencing missing columns, but they can be recreated and accessed afterwards.
Without resorting to X$KGLOB (which is obviously non-documented and should not be used without Oracle Support's blessing), we can use it indirectly using V$DB_OBJECT_CACHE:
SQL> select event, p1text, p1raw from v$session where sid=42;
EVENT P1TEXT P1RAW
------------------------------ ------------------------------ ----------------
pipe get handle address 000000006EEE3120
SQL> @pt "select * from v$db_object_cache where addr=hextoraw('000000006EEE3120')"
OWNER :
NAME : TEST_PIPE
DB_LINK :
NAMESPACE : PIPE
TYPE : PIPE
SHARABLE_MEM : 4032
LOADS : 1
EXECUTIONS : 0
LOCKS : 1
PINS : 0
KEPT : NO
CHILD_LATCH : 101303
INVALIDATIONS : 0
HASH_VALUE : 2881194935
LOCK_MODE : SHARED
PIN_MODE : NONE
STATUS : VALID
TIMESTAMP :
PREVIOUS_TIMESTAMP :
LOCKED_TOTAL : 2
PINNED_TOTAL : 2
PROPERTY :
FULL_HASH_VALUE : 1ae0600e16c71ad624ca44c0abbb8bb7
CON_ID : 3
CON_NAME : PDB
ADDR : 000000006EEE3120
EDITION :
-----------------
Thanks!
Roman Shiryaev, December 09, 2019 - 10:29 am UTC
Hi!
Thank you both TOM and Mikhail for a feedback!
Our goal is to find pipes that weren't read so they're causing pipe put events. And our job gets pipe name by addr and reads it.
I see no field `addr` in Oracle 11c view v$db_object_cache (it's our current version). But it exists in Oracle 19c version of view. So this is what I wanted to get.