x$ tables are the sql interface to viewing oracle's memory in the
SGA.
The names for the x$ tables can be queried with
x$activeckpt
x$bh
Information on buffer headers.
Contains a record (the buffer header) for each block in the
buffer cache.
This select statement lists how many blocks are Available, Free and Being Used.
select count(*), State from (
select decode (state,
0, 'Free',
1, decode (lrba_seq,
0, 'Available',
'Being Used'),
3, 'Being Used',
state) State
from x$bh )
group by state
The meaning of
state:
| 0 |
FREE |
no valid block image |
| 1 |
XCUR |
a current mode block, exclusive to this instance |
| 2 |
SCUR |
a current mode block, shared with other instances |
| 3 |
CR |
a consistent read (stale) block image |
| 4 |
READ |
buffer is reserved for a block being read from disk |
| 5 |
MREC |
a block in media recovery mode |
| 6 |
IREC |
a block in instance (crash) recovery mode |
The meaning of
tch: tch is the touch count. A high touch count indicates that the buffer is used often. Therefore, it will probably be at the head of the MRU list. See also
touch count.
The meaning of tim: touch time.
class represents a value designated for the use of the block.
lru_flag
le_addr can be outer joined on
x$le.le_addr.
flag is a bit array.
| Bit |
if set |
|
| 0 |
Block is dirty |
|
| 4 |
temporary block |
|
| 9 or 10 |
ping |
|
| 14 |
stale |
|
| 16 |
direct |
|
| 524288 (=0x80000) |
Block was read in a full table scan |
See this link |
x$bufqm
x$class_stat
x$context
x$globalcontext
x$hofp
x$hs_session
The x$kc... tables
x$kcbbhs
x$kcbmmav
x$kcbsc
x$kcbwait
x$kcbwbpd
x$kcbwds
Information on working set buffers
addr can be joined with
x$bh.set_ds.
set_id will be between lo_setid and hi_setid in
v$buffer_pool for the relevant buffer pool.
x$kccal
x$kccbf
x$kccbi
x$kccbl
x$kccbp
x$kccbs
x$kcccc
x$kcccf
x$kccdc
x$kccdi
x$kccdl
x$kccfc
x$kccfe
x$kccfn
x$kccic
x$kccle
Controlfile logfile entry. Use
select max(lebsz) from x$kccle
x$kcclh
x$kccor
x$kcccp
Checkpoint Progress:
The column
cpodr_bno displays the current redo block number. Multiplied with the OS Block Size (usually 512), it returns the amount of bytes of redo currently written to the redo logs. Hence, this number is reset at each
log switch.
k$kcccp can (together with
x$kccle) be used to monitor the progress of the writing of
online redo logs. The following query does this.
select
le.leseq "Current log sequence No",
100*cp.cpodr_bno/le.lesiz "Percent Full",
cp.cpodr_bno "Current Block No",
le.lesiz "Size of Log in Blocks"
from
x$kcccp cp,
x$kccle le
where
LE.leseq =CP.cpodr_seq
and bitand(le.leflg,24)=8;
bitand(le.leflg,24)=8 makes sure we get the current log group
x$kccrs
x$kccrt
x$kccsl
x$kcctf
x$kccts
x$kcfio
x$kcftio
x$kckce
x$kckty
x$kclcrst
x$kcrfx
x$kcrmf
x$kcrmx
x$kcrralg
x$kcrrarch
x$kcrrdest
x$kcrrdstat
x$kcrrms
x$kcvfh
x$kcvfhmrr
x$kcvfhonl
x$kcvfhtmp
x$kdnssf
The x$kg... tables
KG stands for kernel generic
x$kghlu
This view shows one row per
shared pool area. If there's a java pool, an additional row is displayed.
x$kgicc
x$kgics
x$kglcursor
x$kgldp
x$kgllk
This table lists all held and requested
library object locks for all sessions. It is more complete than
v$lock.
The column kglnaobj displays the first 80 characters of the name of the object.
select
kglnaobj, kgllkreq
from
x$kgllk x join v$session s on
s.saddr = x.kgllkses;
kgllkreq = 0 means, the lock is held, while kgllkreq > 0 means that the lock is requested.
x$kglmem
x$kglna
x$kglna1
x$kglob
Library Cache Object
x$kglsim
x$kglst
x$kgskasp
x$kgskcft
x$kgskcp
x$kgskdopp
x$kgskpft
x$kgskpp
x$kgskquep
x$kjbl
x$kjbr
x$kjdrhv
x$kjdrpcmhv
x$kjdrpcmpf
x$kjicvt
x$kjilkft
x$kjirft
x$kjisft
x$kjitrft
x$kksbv
x$kkscs
x$kkssrd
x$klcie
x$klpt
x$kmcqs
x$kmcvc
x$kmmdi
x$kmmrd
x$kmmsg
x$kmmsi
x$knstacr
x$knstasl
x$knstcap
x$knstmvr
x$knstrpp
x$knstrqu
x$kocst
The x$kq... tables
x$kqfco
This table has an entry for each column of the
x$tables and can be joined with
x$kqfta.
The column kqfcosiz indicates the size (in bytes?) of the columns.
select
t.kqftanam "Table Name",
c.kqfconam "Column Name",
c.kqfcosiz "Column Size"
from
x$kqfta t,
x$kqfco c
where
t.indx = c.kqfcotab
x$kqfdt
x$kqfsz
x$kqfta
It seems that all x$table names can be retrieved with the following query.
select kqftanam from x$kqfta;
This table can be joined with
x$kqfco which contains the columns for the tables:
select
t.kqftanam "Table Name",
c.kqfconam "Column Name"
from
x$kqfta t,
x$kqfco c
where
t.indx = c.kqfcotab
x$kqfvi
x$kqfvt
x$kqlfxpl
x$kqlset
x$kqrfp
x$kqrfs
x$kqrst
x$krvslv
x$krvslvs
x$krvxsv
The x$ks... tables
KS stands for kernel services.
x$ksbdd
x$ksbdp
x$ksfhdvnt
x$ksfmcompl
x$ksfmelem
x$ksfmextelem
x$ksfmfile
x$ksfmfileext
x$ksfmiost
x$ksfmlib
x$ksfmsubelem
x$ksfqp
x$ksimsi
x$ksled
x$kslei
x$ksles
x$kslld
x$ksllt
x$ksllw
x$kslwsc
x$ksmfs
x$ksmfsv
This SGA map.
x$ksmge
x$ksmgop
x$ksmgsc
x$ksmgst
x$ksmgv
x$ksmhp
x$ksmjch
x$ksmjs
x$ksmlru
Memory least recently used
Whenever a select is performed on x$ksmlru, its content is reset!
This table show which memory allocations in the
shared pool caused the throw out of the biggest memory chunks since it was last queried.
x$ksmls
x$ksmmem
This 'table' seems to allow to address (that is read (write????)) every byte in the
SGA. Since the size of the SGA equals the size of
select sum(value) from v$sga, the following query must return 0 (at least on a four byte architecture. Don't know about 8 bytes.)
select
(select sum(value) from v$sga ) -
(select 4*count(*) from x$ksmmem) "Must be Zero!"
from
dual;
x$ksmsd
x$ksmsp
x$ksmsp_nwex
x$ksmspr
x$ksmss
x$ksolsfts
x$ksolsstat
x$ksppcv
x$ksppcv2
Contains the value
kspftctxvl for each parameter found in
x$ksppi. Determine if this value is the default value with the column
kspftctxdf.
x$ksppi
This table contains a record for all documented and undocumented (starting with an underscore) parameters. select ksppinm from x$ksppi to show the names of all parameters. Join indx+1 with x$ksppcv2.kspftctxpn.
x$ksppo
x$ksppsv
x$ksppsv2
x$kspspfile
x$ksqeq
x$ksqrs
x$ksqst
Enqueue management statistics by type.
ksqstwat: The number of wait for the enqueue statistics class.
ksqstwtim: Cumulated waiting time. This column is selected when
v$enqueue_stat.cum_wait_time is selected.
The types of classes are:
| BL |
Buffer Cache Management |
| CF |
Controlfile Transaction |
| CI |
Cross-instance call invocation |
| CU |
Bind Enqueue |
| DF |
Datafile |
| DL |
Direct Loader index creation |
| DM |
Database mount |
| DP |
??? |
| DR |
Distributed Recovery |
| DX |
Distributed TX |
| FB |
acquired when formatting a range of bitmap blocks far ASSM segments. id1=ts#, id2=relative dba |
| FS |
File Set |
| IN |
Instance number |
| IR |
Instance Recovery |
| IS |
Instance State |
| IV |
Library cache invalidation |
| JD |
Something to do with dbms_job |
| JQ |
Job queue |
| KK |
Redo log kick |
| LA..LP |
Library cache lock |
| MD |
enqueue for Change data capture materialized view log (gotten internally for DDL on a snapshot log) id1=object# of the snapshot log. |
| MR |
Media recovery |
| NA..NZ |
Library cache pin |
| PF |
Password file |
| PI |
Parallel slaves |
| PR |
Process startup |
| PS |
Parallel slave synchronization |
| SC |
System commit number |
| SM |
SMON |
| SQ |
Sequence number enqueue |
| SR |
Synchronized replication |
| SS |
Sort segment |
| ST |
Space management transaction |
| SV |
Sequence number value |
| SW |
Suspend writes enqueue gotten when someone issues alter system suspend|resume |
| TA |
Transaction recovery |
| UL |
User defined lock |
| UN |
User name |
| US |
Undo segment, serialization |
| WL |
Redo log being written |
| XA |
Instance attribute lock |
| XI |
Instance registration lock |
| XR |
Acquired for alter system quiesce restricted |
x$kstex
x$ksull
x$ksulop
x$ksulv
x$ksumysta
x$ksupr
x$ksuprlat
x$ksurlmt
x$ksusd
x$ksuse
x$ksusecon
x$ksusecst
x$ksusesta
x$ksusgif
x$ksusgsta
x$ksusio
x$ksutm
x$ksuxsinst
x$ktadm
x$targetrba
x$ktcxb
The
SGA transaction table.
x$ktfbfe
x$ktfthc
x$ktftme
x$ktprxrs
x$ktprxrt
x$ktrso
x$ktsso
x$ktstfc
x$ktstssd
x$kttvs
Lists
save undo for each tablespace: The column kttvstnm is the name of the
tablespace that has saved undo. The column is null otherwise.
x$kturd
x$ktuxe
Kernel transaction, undo transaction entry
x$kvis
Has (among others) a row containing the db block size:
select kvisval from x$kvis where kvistag = 'kcbbkl'
x$kvit
x$kwddef
x$kwqpd
x$kwqps
x$kxfpdp
x$kxfpns
x$kxfpsst
x$kxfpys
x$kxfqsrow
x$kxsbd
x$kxscc
x$kzrtpd
x$kzspr
x$kzsrt
x$le
Lock element: contains an entry for each PCM lock held for the buffer cache. x$le can be left outer joined to
x$bh on le_addr.
x$le_stat
x$logmnr_callback
x$logmnr_contents
x$logmnr_dictionary
x$logmnr_logfile
x$logmnr_logs
x$logmnr_parameters
x$logmnr_process
x$logmnr_region
x$logmnr_session
x$logmnr_transaction
x$nls_parameters
x$option
x$prmsltyx
x$qesmmiwt
x$qesmmsga
x$quiesce
x$uganco
x$version
x$xsaggr
x$xsawso
x$xssinfo
A perlscript to find x$ tables
#!/usr/bin/perl -w
use strict;
open O, ("/appl/oracle/product/9.2.0.2/bin/oracle");
open F, (">x");
my $l;
my $p = ' ' x 40;
my %x;
while (read (O,$l,10000)) {
$l = $p.$l;
foreach ($l =~ /(x\$\w{3,})/g) {
$x{$_}++;
}
$p = substr ($l,-40);
}
foreach (sort keys %x) {
print F "$_\n";
}
Obviously, it is also possible to extract those names through
x$kqfta