| René Nyffenegger's collection of things on the web | |
|
René Nyffenegger on Oracle - Most wanted - Feedback
|
Oracle's x$ Tables | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
See also: Speculation of X$ Table Names
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$activeckptx$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:
The meaning of tim: touch time.
class represents a value designated for the use of the block.
lru_flag
set_ds maps to addr on x$kcbwds.
le_addr can be outer joined on x$le.le_addr.
flag is a bit array.
x$bufqmx$class_statx$contextx$globalcontextx$hofpx$hs_sessionThe x$kc... tablesx$kcbbhsx$kcbmmavx$kcbscx$kcbwaitx$kcbwbpd
Buffer pool descriptor, the base table for v$buffer_pool.
x$kcbwds
Set descriptor, see also x$kcbwbpd
The column id can be joined with v$buffer_pool.id.
The column bbwait corresponds to the buffer busy
waits wait event.
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$kccalx$kccbfx$kccbix$kccblx$kccbpx$kccbsx$kccccx$kcccfx$kccdcx$kccdix$kccdlx$kccfcx$kccfex$kccfnx$kccicx$kccle
Controlfile logfile entry. Use
select max(lebsz) from x$kccle
to find out the size of a log block.
The log block size is the unit for the following init params:
log_checkpoint_interval,
_log_io_size, and
max_dump_file_size.
x$kcclhx$kccorx$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
How much redo is written by Oracle uses a variation of this SQL statement to
track how much redo is written by different DML Statements.
x$kccrsx$kccrtx$kccslx$kcctfx$kcctsx$kcfiox$kcftiox$kckcex$kcktyx$kclcrstx$kcrfxx$kcrmfx$kcrmxx$kcrralgx$kcrrarchx$kcrrdestx$kcrrdstatx$kcrrmsx$kcvfhx$kcvfhmrrx$kcvfhonlx$kcvfhtmpx$kdnssfThe 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$kgiccx$kgicsx$kglcursorx$kgldpx$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$kglmemx$kglnax$kglna1x$kglob
Library Cache Object
x$kglsimx$kglstx$kgskaspx$kgskcftx$kgskcpx$kgskdoppx$kgskpftx$kgskppx$kgskquepx$kjblx$kjbrx$kjdrhvx$kjdrpcmhvx$kjdrpcmpfx$kjicvtx$kjilkftx$kjirftx$kjisftx$kjitrftx$kksbvx$kkscsx$kkssrdx$klciex$klptx$kmcqsx$kmcvcx$kmmdix$kmmrdx$kmmsgx$kmmsix$knstacrx$knstaslx$knstcapx$knstmvrx$knstrppx$knstrqux$kocstThe x$kq... tablesx$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$kqfdtx$kqfszx$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$kqfvix$kqfvtx$kqlfxplx$kqlsetx$kqrfpx$kqrfsx$kqrstx$krvslvx$krvslvsx$krvxsvThe x$ks... tables
KS stands for kernel services.
x$ksbddx$ksbdpx$ksfhdvntx$ksfmcomplx$ksfmelemx$ksfmextelemx$ksfmfilex$ksfmfileextx$ksfmiostx$ksfmlibx$ksfmsubelemx$ksfqpx$ksimsix$ksledx$ksleix$kslesx$kslldx$kslltx$ksllwx$kslwscx$ksmfsx$ksmfsv
This SGA map.
x$ksmgex$ksmgopx$ksmgscx$ksmgstx$ksmgvx$ksmhpx$ksmjchx$ksmjsx$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$ksmlsx$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$ksmsdx$ksmspx$ksmsp_nwexx$ksmsprx$ksmssx$ksolsftsx$ksolsstatx$ksppcvx$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$ksppox$ksppsvx$ksppsv2x$kspspfilex$ksqeqx$ksqrsx$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:
x$kstexx$ksullx$ksulopx$ksulvx$ksumystax$ksuprx$ksuprlatx$ksurlmtx$ksusd
Contains a record for all statistics.
x$ksusex$ksuseconx$ksusecstx$ksusestax$ksusgifx$ksusgstax$ksusiox$ksutmx$ksuxsinstx$ktadmx$targetrbax$ktcxb
The SGA transaction table.
x$ktfbfex$ktfthcx$ktftmex$ktprxrsx$ktprxrtx$ktrsox$ktssox$ktstfcx$ktstssdx$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$kturdx$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$kvitx$kwddefx$kwqpdx$kwqpsx$kxfpdpx$kxfpnsx$kxfpsstx$kxfpysx$kxfqsrowx$kxsbdx$kxsccx$kzrtpdx$kzsprx$kzsrtx$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_statx$logmnr_callbackx$logmnr_contentsx$logmnr_dictionaryx$logmnr_logfilex$logmnr_logsx$logmnr_parametersx$logmnr_processx$logmnr_regionx$logmnr_sessionx$logmnr_transactionx$nls_parametersx$optionx$prmsltyxx$qesmmiwtx$qesmmsgax$quiescex$ugancox$versionx$xsaggrx$xsawsox$xssinfoA 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
|