Names of variables, address of their value in the SGA, their datatype and size of the datatype.
select
-- addr addr_hex,
-- to_number(addr , rpad('x', 16, 'x')) addr,
ksmfsnam variable_name,
to_number(ksmfsadr, rpad('x', 16, 'x')) address,
ksmfstyp typ,
ksmfssiz siz
from
x$ksmfsv
order by
variable_name
;
SCN number (kcsgscn_)
Such a variable is for example kcsgscn_ which stores the current SCN number:
select
to_number(mem.ksmmmval, rpad('x', 16, 'x')) value,
vdb.current_scn
from
x$ksmfsv var join
x$ksmmem mem on var.ksmfsadr = mem.addr cross join
v$database vdb
where
var.ksmfsnam = 'kcsgscn_' -- SCN Number
;
Latches
Many of these variables seem to store the address of latches which are exposed in x$kslld or x$kslltr.
select
-- addr addr_hex,
-- to_number(addr , rpad('x', 16, 'x')) addr,
ksmfsnam variable_name,
lld.kslldnam lld_name,
lld.ksllddsp lld_description,
llt.kslltnam llt_name,
to_number(ksmfsadr, rpad('x', 16, 'x')) address,
ksmfstyp typ,
ksmfssiz siz
from
x$ksmfsv var left join
x$kslld lld on var.ksmfsadr = lld.kslldadr left join
x$kslltr llt on var.ksmfsadr = llt.kslltaddr
where
coalesce(lld.kslldadr, llt.kslltaddr) is not null
;
Unix Epoch
ksudbrmseccnt_ stores the value of the Unix epoch (seconds since January 1st 1970):
select
date '1970-01-01' + (1/24/60/60) * to_number(mem.ksmmmval, rpad('x', 16, 'x')) as "current time UTC"
from
x$ksmfsv var join
x$ksmmem mem on var.ksmfsadr = mem.addr
where
var.ksmfsnam = 'ksudbrmseccnt_'
;
Dumping variable values with oradebug
ORADEBUG allows to print the value of a variable with the dumpvar command:
oradebug dumpvar kcsgscn
Column ksmfstyp
ksmfstyp shows the type of the variable: Some of these types are basic memory units such as uword, ub4, int etc., others seem to refer to some kind of structs, such as ksllt, ksbsa, kzxctok etc. Also seen is void *, size_t, oratext * and many more.
In the case of the type being ksllt, it can be joined to x$kslld to list variables that are related to latches.