Oracle X$ Tables

来源:互联网 发布:mac版photoshop cc2015 编辑:程序博客网 时间:2024/05/01 14:53

应用可以参看一篇好文章<<Oracle Wait Interface A Practical Guide to Performance Diagnostics &amp; Tuning   >>Appendix D: Direct SGA Access

Oracle X$ Tables的另外一篇文章:http://dbanotes.net/X$tables.htm

以下转自:http://yong321.freeshell.org/computer/x$table.html

Oracle X$ Tables

Why are people so intensely interested in Oracle internals? Partly because internals information can be useful for tuning and troubleshooting. But also because Oracle Corporation has kept most of the internals secret, while revealing just enough to tantalize.Oracle Internals guru, Steve Adams

Warning The following list is just speculation; no guarantee of accuracy.

Oracle x$ "tables" are mostly instance or session memory structures presented as tables and serve as base tables of most v$ views. Entries in the following list are added one at a time in the course of my study of Oracle internals by reading books and online materials, through my own lab test, by interpreting the text inv$fixed_view_definition if available, or because other nice folks emailed me. Obviously there're much more tables in x$kqfdt and x$kqfta than listed below. But generally I omit those whose usage is not interesting or its meaning is too obvious.

Names of most x$ tables begin with x$k. The letter after "k" indicates what kernel layer this data structure belongs in. Check Chapter 1 of Steve Adams' book Oracle8i Internal Services to find out the functionality of each layer. Usually that knowledge can give you a hint at what an Oracle internal error is about. (If the letter "k" is preceded by "s", as in skgxp, then it's an OSD (operating system dependent) function or variable.) Letters after the first two represent sublayers, such as "l" in kgl means library cache. These are not easy to guess. Note:175982.1 has an extensive list of codes and is very informative.

. X$kgllk.kglhdpar matches x$kglob.kglhdpar if there's a KGL lock on the object.

Table NameAcronym ExpandedCommentsx$bhbuffer headerThe most common use of this table is to find the object and the file# and block# of its header when there's high cache buffers chains latch contention: select obj, dbarfil, dbablk from x$bh a, v$latch_children b where a.hladdr = b.addr for the said latch (whose sleeps you think are too high). You can also use this table to see if a specific buffer has too many clones: select dbarfil, dbablk, count(*) from x$bh group by dbarfil, dbablk having count(*) > 2. Note that obj column matches dba_objects.data_object_id, not object_id. For performance reason, don't merge dba_extents with the query of x$bh that has a group by, unless you use in-line view and no_merge hint (see J. Lewis Practical Oracle8i, p.215) The tch column, touch count, records how many times a particular buffer has been accessed. Its flag column is explained by J. Lewis; explanation of state, mode and indx can be found in Anjo Kolk's paper. Tim is time the buffer touch happened (276392.996). Lru_flag is about the buffer's hot/cold feature (Ref and221860.999); 8 is often used to find hot blocks.x$k2gte,
x$k2gte2kernel 2-phase commit, global transaction entrySee Note:104420.1. Find sessions coming from or going to a remote database; in short, x$k2gte.k2gtdses matches v$session.saddr, .k2gtdxcb matches v$transaction.addr. select /*+ ordered */ substr(s.ksusemnm,1,10)||'-'|| substr(s.ksusepid,1,10) origin, substr(g.k2gtitid_ora,1,35) gtxid, substr(s.indx,1,4)||'.'|| substr(s.ksuseser,1,5) lsession, s.ksuudlna username, substr(decode(bitand(ksuseidl,11), 1,'ACTIVE', 0, decode( bitand(ksuseflg,4096) , 0,'INACTIVE','CACHED'), 2,'SNIPED', 3,'SNIPED', 'KILLED'),1,1) status, e.kslednam waiting from x$k2gte g, x$ktcxb t, x$ksuse s, x$ksled e where g.k2gtdxcb=t.ktcxbxba and g.k2gtdses=t.ktcxbses and s.addr=g.k2gtdses and e.indx=s.ksuseopc; It's better than checking for DX locks for outgoing sessions (since a DX lock only shows up in v$lock for the current distributed transaction session). X$k2gte2 is the same as x$k2gte except on k2gtetyp which may show 2 for 'TIGHTLY COUPLED' instead of 0 for 'FREE'. One use of x$k2gte[2] is the clearly translated global transaction ID in k2gtitid_ora as opposed to the hex numbers in v$global_transaction.globalid.x$kcbbfkernel cache, buffer buffer_handlesJonathan Lewis ("_db_handles")x$kcbfwaitkernel cache, buffer file waitA commonly used query breaks down the contents of v$waitstat into per-datafile statistics: select name, count, time from v$datafile df, x$kcbfwait fw where fw.indx+1 = df.file#x$kcbkpfskernel cache, buffer ckpt prefetch statisticsTanel Poderx$kcbobhkernel cache, buffer, objectqueue buffer header10g and up. Tanel Poderx$kcboqhkernel cache, buffer, object queue headerSee abovex$kcbswkernel cache, buffer statistics whyNote:34405.1 (select kcbwhdes, why0+why1+why2 "Gets", "OTHER_WAIT" from x$kcbsw s, x$kcbwh w where s.indx=w.indx and s."OTHER_WAIT">0 order by 3), Ref1 ("statistics about the way these [x$kcbwh] functions have been used")x$kcbwaitkernel cache, buffer wait x$kcbwbpdkernel cache, buffer workingset buffer pool descriptorSee 183770.999 for relationship to x$bh and x$kcbwds. Some people use this query to find how many blocks of a segment are in each buffer pool: select decode(pd.bp_id,1,'KEEP',2,'RECYCLE',3,'DEFAULT',4,'2K SUBCACHE',5,'4K SUBCACHE',6,'8K SUBCACHE',7,'16K SUBCACHE',8,'32K SUBCACHE','UNKNOWN') subcache, bh.object_name,bh.blocks from x$kcbwds ds, x$kcbwbpd pd, (select /*+ use_hash(x) */ set_ds, o.name object_name, count(*) BLOCKS from obj$ o, x$bh x where o.dataobj#=x.obj and x.state!=0 and o.owner#!=0 and o.name='&mytable' group by set_ds, o.name) bh where ds.set_id>=pd.bp_lo_sid and ds.set_id<=pd.bp_hi_sid and pd.bp_size!=0 and ds.addr=bh.set_dsx$kcbwdskernel cache, buffer workingset descriptorsSee above. Also see Ref1, Ref2, Ref3. Total row count in this table is _db_block_lru_latches, although only db_writer_processes rows have real numbers.x$kcbwhkernel cache, buffer where/whySee x$kcbsw for SQL. Ref1 ("different functions that may be used to perform different types of logical I/O"), Ref2x$kcccfkernel cache, controlfilemanagement control fileIn 10gR1, to find controlfile size as viewed at OS level but from inside Oracle, select cfnam, (cffsz+1)*cfbsz from x$kcccf. cfbsz is the controlfile log block size; should report the same as the command dbfsize controlfile ($ORACLE_HOME/bin/dbfsize is available on UNIX, regardless Oracle version.) In 10gR2, block size and file size are both in v$controlfile although Reference manual misses them.x$kcccpkernel cache, controlfile checkpoint progressS. Adams and K Gopalakrishnan use this view to find how much the current redo log is filled. Eygle studied instance heartbeat, column cphbt.x$kccdikernel cache, controlfilemanagement database information x$kcclekernel cache, controlfile logfile entrylebsz may be used to show redo logfile block size, usually 512; should report the same as the command dbfsize redologfile($ORACLE_HOME/bin/dbfsize is available on UNIX only)x$kccnrs, x$kccrspkernel cache, controlfile non-guaranteed restorepoint; kernel cache, controlfile restore pointBase tables of v$restore_point, for non-guaranteed and guaranteed restore points. Retain records of them after they were droppedx$kcfiokernel cache, file I/O x$kclcrstkernel cache, (RAC) lock, consistent read statisticsbase table of v$cr_block_server or v$bsp, used to troubleshoot global cache cr requestsx$kclfhkernel cache, (RAC) lock file hashtable x$kclfikernel cache, (RAC) lock file index x$kclfxkernel cache, (RAC) lock freelist statisticsSee Ref1, Ref2. If lwm is too low, you may see 'gc freelist' wait.x$kcluhkernel cache, (RAC) lock undo header x$kcluikernel cache, (RAC) lock undo index x$kcrfstrandkernel cache, redo file strand10g and up. Info about redo strands. Non-zero pvt_strand_state_kcrfa_cln (and strand_num_ordinal_kcrfa_cln=3735928559 or DEADBEEF in hex) means a transaction is using this private strand. (Private strands may be disabled in RAC or if supplemental logging is on, but multistrand redo is still used.) Strand_size_kcrfa is the strand size (meaningful only if last_buf_kcrfa<>'00'; Ref).x$kcrfxkernel cache, redo file context"columns bfs (buffer size) and bsz (block size). Dividing bfs by bsz gives mxr (the maximum number of blocks to read size)" (fromAnjo Kolk's paper)x$kdxstkernel data, index statusused in catalog.sql to create index_statsx$kdxhskernel data, index histogramused in catalog.sql to create index_histogramx$kewrtbkernel event?, workload repository tablesSee Note:555124.1x$kfdatkernel file, disk allocation table?Only populated in ASM instance. See Note:351117.1 and Julian Dyke et al Pro Oracle Database 10g RAC on Linux, pp.232-3. Column v_kfdat is 'V' for allocated and 'F' for free. For most ASM-related x$ tables, read Luca Canali.x$kffxpkernel file, file extent mapOnly populated in ASM instance. You can check how many extents are allocated for each datafile on which disk, e.g. select a.name, d.path, d.group_number, d.disk_number, count(*) from v$asm_alias a, v$asm_disk d, v$asm_file f, x$kffxp x where a.group_number = x.group_kffxp and a.file_number = x.number_kffxp and d.group_number = x.group_kffxp and d.disk_number = x.disk_kffxp and f.group_number = a.group_number and f.file_number = a.file_number and f.type = 'DATAFILE' group by a.name, d.path, d.group_number, d.disk_number, f.bytes order by 1;x$kghlukernel generic, heap LRUs x$kglcursorkernel generic, librarycache cursorBase table for v$sql, v$sqlarea. Fixed view based on x$kglob according to x$kqfdt. See Note 1 or x$kglob for more details. One use of this table is for finding partially parsed SQLs because they cause parse failures (viewable in v$sysstat or v$sesstat). Their kglobt02 (command type) is 0, kglobt09 (child number) is 65535 for the child, SQL text length is cut to 20 chars, kglobt17 and kglobt18 (parsing and user schema) are 0 or 2147483644 (for 32-bit Oracle) depending on if it's parent or child, and obviously miss heap 6 (cursor body). Find them by select kglnaobj, kglnatim, kglobts0, kglnahsh from x$kglcursor where kglobt02 = 0 (kglobts0 is module; you can further restrict by kglnatim i.e. first_load_time).x$kgllkkernel generic, librarycache lockUsed in catblock.sql to build dba_kgllock. kgllkuse or kgllkses maps to v$session.saddr, kgllkpnc call pin, kgllkpns session pin, kgllkmod lock held (0: no lock; 1: null; 2: shared; 3: exclusive), kgllkflg (allegedly 8 for pre-10g or 2048 for 10g meaning SQL being run, Ref; 256 for broken kgl lock in 10g or 1 in 9i, Ref), kgllkspn savepoint. If you get library cache lock or pin wait, kgllkhdl matches v$session_wait.p1raw (handle address), and kglnaobj is the first 80 characters of the object name. Note:122793.1has this SQL for our convenience: select * from x$kgllk lock_a where kgllkreq = 0 and exists (select lock_b. kgllkhdl from x$kgllk lock_b where kgllkses = '&saddr_from_v$session' /* blocked session */ and lock_a.kgllkhdl = lock_b.kgllkhdl and kgllkreq > 0). Kgllkadr column is shown in event 10270 trace files to find SQLs in session cursor cache (Ref)x$kglobkernel generic, librarycache objectTo find library cache object for wait events library cache pin or lock and pipe get or put, match kglhdadr with v$session_wait.p1raw. kglhdflg is partially explained in Note:311689.1 (for permanent keeping). kglhddmk may be data object load mask; can be used to identify the number of the loaded heap, counted from 0 (see comment of 06/12/01 in Bug:1164709). Steve Adams'objects_on_hot_latches.sql finds the way Oracle links a library cache object (based on kglnahsh) to a specific library cache child latch. x$kglob, and in case of cursors x$kglcursor too, can be used to find library cache objects that are partially built therefore not visible in v$sql(XXX), v$open_cursor, v$object_dependency. (Try typing select *; and enter, then check these views!) Kglobhd[0-7] is heap descriptor address and kglobhs[0-7] is its size; can join to x$ksmhp.ksmchds to see heap components.x$kglpnkernel generic, librarycache pinused in catblock.sql to build dba_kgllock. Some columns are simiarly explained for x$kgllk.x$kglrdkernel generic, librarycache readonly dependencykglnacnm (container name?) is PL/SQL program unit or anonymous block while kglnadnm (dependent name?) is the individual SQLs inside the PL/SQL unit. Ref; this may be the way to differentiate between user recursive SQLs (code in PL/SQL, trigger, etc.) from system-generated recursive SQLs (data dictionary check etc.). (See also v$object_dependency, but that doesn't show relation between PL/SQL block and its contents.) In 11g, v$sql.program_id may be used to tie the constituent SQL to its containing PL/SQL stored object (not anonymous block).x$kglstkernel generic, librarycache status x$kgskvftkernel generic, service, ?? fixed tableBase table of v$blocking_quiesce. If the blocking session is not in SYS_GROUP consumer group according to v$rsrc_session_info, v$blocking_quiesce ignores it. Workaround is to directly query x$kgskvft. (Ref; Bug 7832504)x$kmgsctkernel memory, granule scoreboard ?Base table of v$sga_dynamic_components, v$sga_current_resize_ops etc., probably used to be named x$ksmgst and x$ksmgsc in 9i.x$knstmvrkernel replication, statistics materialized view refreshBase table of v$mvrefresh. Stores MV refresh history info, such as session SID and serial#. Un-exposed columns reftype_knstmvr, groupstate_knstmvr and total_* are useful; see the query in Note:258021.1.x$kqdpgkernel query, dictionary PGARow cache cursor statistics, columns explained in "How can you tune it?" section of Tuning the _row_cache_cursors Parameter. Note this is PGA. Need to dump another process's PGA to view it.x$kqfcokernel query, fixed table columnsx$kqfco.kqfcotab=x$kqfta.indxx$kqfdtkernel query, fixed derived tableContains x$kglcursor, x$kgltable etc. which are based on x$kglob; effectively these are views of other x$ tables, but Oracle couldn't call them views because they already had x$kqfvix$kqfpkernel query, fixed procedureused in catprc.sql to build disk_and_fixed_objects viewx$kqfszkernel query, fixed size (size of fixed objects in current version of Oracle) x$kqftakernel query, fixed tableBase table of v$fixed_table, whose object_id (indx of x$kqfta) matches obj# of tab_stats$, the table dbms_stats.gather_fixed_objects_stats inserts stats into.x$kqfvikernel query, fixed view x$kqfvtkernel query, fixed view table (how fixed view is built on fixed tables) x$kqrpdkernel query, rowcache parent definitionColumn kqrpdosz is size of this parent rowcache object, not exposed in v$rowcache_parent although shown in rowcache dump.x$kqrsdkernel query, rowcache subordinate definitionColumn kqrsdosz is size of this subordinate rowcache object, not exposed in v$rowcache_subordinate although shown in rowcache dump.x$krcfh, x$krcfde, x$krcfbh, x$krcbitkernel recovery, changetracking file, header, descriptor, bitmap header, bitmap blockAlex Gorbachevx$ksled, x$kslei, x$ksleskernel service, latch event descriptor, latch events for instance, latch events for sessionBase tables for v$event_name, v$system_event, and v$session_event, respectively. Benefit of querying x$ksles: (1) When ksleswts (wait count) is 0, v$session_event won't have the row but x$ksles still has them with non-zero kslestim (time waited micro) or kslesmxt (max wait time in micro); (2) Since kslesmxt is in microsec, it could be non-zero even if v$session_event.max_wait is 0. x$kslei has benefit (2) over v$system_event.x$kslemapkernel service, latch event map"Indx = event number...Basically map events to a small number of useful classes like I/O waits" (Ref)x$ksllclasskernel service, latch, latch class"describes the 8 classes", "Specify which latch belongs to which class" with _latch_class_ (Ref)x$kslpokernel service, latch postingBug:653299 says it "tracks which function is posting smon". Ksllwnam column (the part before semicolon if it exists) can match v$latch_misses.location to identify the latch that uses this function.x$ksmfskernel service, memory fixed SGAalso contains db_block_buffers and log_buffer sizes for some reasonx$ksmfsvkernel service, memory fixed SGA variablesdetailing fixed SGA: select a.ksmfsnam, a.ksmfstyp, a.ksmfssiz, b.ksmmmval from x$ksmfsv a, x$ksmmem b where a.ksmfsadr = b.addr and a.ksmfsnam like... (Ref. p.82, Oracle Internal Services). For a latch, get ksmfsnam by matching x$ksmfsv.ksmfadr with x$kslld.kslldadr. You can see SGA parameters in ksmfsnam column and get their values with oradebug dumpvar varname or all values with oradebug dumpsgax$ksmhpkernel service, memory heapS. Adams, "What it returns depends on which heap descriptor you join to it. It is effectively a function returning the contents of an arbitrary heap that takes the heap descriptor as its argument." You need to join this table to another one on heap descriptor ksmchds, such as in v$sql_shared_memory (joining to x$kglcursor), or to x$ksmsp (on column ksmchpar), or kglobhd[0-6] of x$kglob or x$kglcursor_child, and possibly need to use use_nl hint. Example, example.x$ksmjskernel service, memory java_pool statistics x$ksmlrukernel service, memory LRURefer to Metalink Notes 61623.1 and 43600.1 for details. Note that query on this table can only be done once; subsequent query returns no rows unless large chunk shared pool allocations happened in the interim.x$ksmlskernel service, memory large_pool statistics x$ksmmemkernel service, memoryEntire SGA memory map. You can find your database version by select ksmmmval from x$ksmmem where indx = 2 (if it's 64-bit Oracle, try 1), regardless machine architecture endian-ness. Note that the 4 bytes containing the version are delimited as XX.X.XX.X.XX so 09200300 is 9.2.0.3.0. Due to memory guard pages, you can only select from x$ksmmem specifying rownum < some number or indx = some value; otherwise the session may hang or throws ORA-3113 (Windows doesn't seem to have this problem). Indx is SGA index, i.e. SGA address minus sgabeg (which is x$ksmmem.addr where indx = 0), divided by architecture word size (4 for 32-bit, 8 for 64-bit machines); e.g., the value stored at address 0x9CD3F5D0 on a 64-bit machine (which is really address 0x000000009CD3F5B0) whose sgabeg is 0x60000000 can be calculated as:
select (to_number('9CD3F5D0','xxxxxxxx') - to_number('60000000','xxxxxxxx')) /8 from dual;
select ksmmmval from x$ksmmem where indx = 127565498;
x$ksmppkernel service, memory pga heapPGA heap (variable area). PGA subheaps: select /*+use_nl(h,p)*/ h.ksmchds,p.ksmchcom, h.ksmchcom ksmchnam,h.ksmchsiz, h.ksmchcls,h.ksmchpar from x$ksmhp h,x$ksmpp p where h.ksmchds = p.ksmchpar and p.ksmchcls like '%recr' and p.ksmchpar != hextoraw('00');x$ksmsdkernel service, memory sga definition x$ksmspkernel service, memory sga heapThe 3rd argument of ORA-4031 tells you which section of shared (or java or large) pool is short of memory. It matches x$ksmsp.ksmchcom (or v$sgastat.name). SGA heaps: select /*+use_nl(h,s)*/ sess.sid, sess.username, h.ksmchds, h.ksmchcom ksmchnam, h.ksmchsiz, h.ksmchcls,h.ksmchpar from x$ksmhp h,x$ksmsp s,v$session sess where h.ksmchds = s.ksmchpar and s.ksmchcls like '%recr' and s.ksmchpar != hextoraw('00') and h.ksmchown = sess.saddr; SGA subheaps: select /*+use_nl(h,s)*/ h.ksmchds,s.ksmchcom,h.ksmchcom ksmchnam, h.ksmchsiz,h.ksmchcls,h.ksmchpar from x$ksmhp h,x$ksmsp s where h.ksmchds = s.ksmchpar and s.ksmchcls like '%recr'and s.ksmchpar != hextoraw('00');x$ksmsprkernel service, memory shared pool reserved x$ksmsp_nwexkernel service, memory shared pool ??A new efficient fixed table shows subpools and durations. See 396940.1.x$ksmsskernel service, memory sga statisticsThe 3rd argument of ORA-4031 tells you which section of shared (or java or large) pool is short of memory. It matches x$ksmss.ksmssnam (or v$sgastat.name).x$ksmupkernel service, memory uga heapUGA heap (variable area). UGA subheaps: select /*+use_nl(h,s)*/ h.ksmchds,u.ksmchcom,h.ksmchcom ksmchnam,h.ksmchsiz,h.ksmchcls,h.ksmchpar from x$ksmhp h,x$ksmup u where h.ksmchds = u.ksmchpar and u.ksmchcls like '%recr' and u.ksmchpar != hextoraw('00');x$ksolsftskernel service, object level statistics, fts?Base table of v$segstat and v$segment_statistics. Fts_stmp records the last time fts_staval was updated, fts_preval the previously recorded value. Fts_inte greater than 0 reveals some less known types of statistics. Note that value in v$segstat or v$segment_statistics is cumulative; e.g., if "row lock waits" is non-zero, the waits may not be happening right now.x$ksppcvkernel service, parameter, current (session) valueBase table of v$parameter and v$parameter2. See comments on x$ksppi.x$ksppikernel service, parameter, parameter infoBase table of v$parameter, v$system_parameter and v$system_parameter2. Often used to see undocumented parameters: select a.ksppinm Parameter, a.ksppdesc Description, b.ksppstvl "Session Value", c.ksppstvl "Instance Value" from x$ksppi a, x$ksppcv b, x$ksppsv c where a.indx = b.indx and a.indx = c.indx and a.ksppinm like '\_%' escape '\' order by 1x$ksppsvkernel service, parameter, system valueBase table of v$system_parameter and v$system_parameter2. See comments on x$ksppi.x$ksqeqkernel service, enqueue en-queue x$ksqrskernel service, enqueue resource"shows all outstanding enqueues with an additional flag. It basically shows the same information as the v$lock table." from Note1, which also gives the meanings of the flags.x$ksqstkernel service, enqueue_management statistics typesYou can find how many times each type of enqueue lock has been taken since instance startup by select * from x$ksqst where ksqstget > 0 or in 9i select * from x$ksqst where ksqstsgt > 0 or ksqstfgt > 0. But v$enqueue_stat in 9i can also be used instead.x$ksulvkernel service, user locale value x$ksulopkernel service, user long operation x$ksupgpkernel service, user process groupKsupgpnm!='DEFAULT' may suggest session leaking (Ref)x$ksuprkernel service, user process x$ksusekernel service, user sessionT. Poder finds hidden recursive session based on ksuseflg.x$ksuseconkernel service, user session connectionIn 11g, check client version with
with x as (select distinct to_char(ksuseclvsn,'xxxxxxx') v from x$ksusecon where ksusenum = &sid)select decode(v, '       0', 'no version provided: 10g or lower, or background process?', to_number(substr(v,1,2),'xx') || '.' || --maj_rel to_number(substr(v,3,1),'x') || '.' || --mnt_rel to_number(substr(v,4,2),'xx') || '.' || --ias_rel to_number(substr(v,6,1),'x') || '.' || --pat_set to_number(substr(v,7,2),'xx')) client_version -- port_mntfrom x;
(Ref)
[Update 2013-07] Not needed in 12c because v$session_connect_info.client_version works fine.x$ksuvmstatkernel service, user virtual memory statisticsIn 10g and up, base table providing physical_memory_bytes to v$osstat (and VM paging stats on Windows). But on Linux up to Oracle 10.2.0.3, this number is system free memory in kilobytes (grep MemFree /proc/meminfo); on other OSes or 10.2.0.4 or up on Linux, it is "Total number of bytes of physical memory".x$kswsastabkernel service, workgroup services,Base table of v$services and a few other service-related views. v$services may need x$kswsastab.kswsastabpflg=0 restriction; otherwise stopped services linger in the view till instance bounce.x$ktcxbkernel transaction, control objectBase table of v$transaction. Four bits of ktcxbflg column, exposed as v$transaction.flag, are explained in v$fixed_view_definition. Metalink Mark Bobak and Melissa Holman explain the bit for isolation level. Since v$transaction is empty without a transaction, you can directly query x$ktcxb to find sessions with serializable isolation level: select * from v$session where taddr in (select ktcxbxba from x$ktcxb where bitand(ktcxbflg,268435456) <> 0). Other bits of ktcxbflg not shown in v$fixed_view_definition are: bit 1 read write and read committed, 4(?) read only, 13 using private strand (Ref).x$ktfbfekernel transaction, file bitmap free extentFree extent bitmap in file header for LMT (equivalent to fet$ in DMT); check dba_free_space view definitionx$ktfbhckernel transaction, file bitmap header controlSummarizes free space with one row per datafile (Ref); check dba_data_files or dba_temp_files view definitionx$ktfbuekernel transaction, file bitmap used extentUsed extent bitmap in file header for LMT (equivalent to uet$ in DMT)x$ktifb, x$ktiff, x$ktifp, x$ktifvkernel transaction, ? flush ?Probably related to in-memory undo. See 7th bullet of IMU.txt.x$ktprxrtkernel transaction, parallel transaction rollbackFairlie Regox$ktuxekernel transaction, undo transaction entry"get the SCN of the most recently committed (local) transaction" with select max(ktuxescnw * power(2, 32) + ktuxescnb) from x$ktuxe(Ref); select * from x$ktuxe where ktuxecfl = 'DEAD' and ktuxesta = 'ACTIVE' "shows transaction dead waiting for cleanup" (Ref)x$kxfpsdskernel execution, fast process slave dequeue statisticsCurrent list of reasons for parallel execution dequeuing, as explained for wait event "parallel query dequeue wait" in Anjo Kolk's paper.x$kxsbdkernel execution, SQL bind dataBase table of v$sql_bind_data. Column kxsbdof2 (or shared_flag2 of v$sql_bind_data) is oacfl2 (not oacflg2 as in Note:39817.1) in SQL trace. "System-generated binds have a value of 256 in the SHARED_FLAG2 column". According to Bug 4359367, when it's 0x300, the bind variable is marked as unsafe (affecting cursor_sharing=similar). Note:296377.1 has more on its value.x$kzsprvkernel security, session privilegeSession-specific. Base table for v$enabledprivilege, which is base table of session_privsx$kzsrokernel security, session roleused in many SQL scripts in ?/rdbms/adminx$lelock elementSee the definition of GV$BH for its relationship with x$bh. Note that v$gc_element differs slightly from v$lock_element and documentation for v$gc_element is really for v$lock_element.x$le_statlock element status x$messages(background process) messagesMay be the place where processes store and fetch messages. Related to _messages parameter, messages latch, and "rdbms ipc (message|reply)" wait events.x$qksceses, x$qkscesysquery compilation service, compilation environment, session or systemBase tables for v$ses_optimizer_env and v$sys_optimizer_env, respectively. There're so many optimizer parameters the two documented views are missing that sometimes you need to query these base tables directly. Select pname_qksceserow from x$qksceses minus select name from v$ses_optimizer_env to have a feel of the missing ones. Or subtract v$sys_optimizer_env.name from x$qkscesys.pname_qkscesyrow.x$targetrbatarget RBARefx$trace Beginning with 9i, x$trace records event tracing info. 10g RAC bdump/cdmp_time directory has trw files that contain the same info (the trace file seems to have columns TimeInMicroSec:?, OraclePid, SID, event, OpCode, TraceData). select event, count(*) from x$trace group by event shows what events are enabled internally (not shown in v$parameter). oerr ora eventID on UNIX shows the event name. RAC databases should have GES and GCS related events set. select pid, count(*) from x$trace group by pid shows how many events have been trapped by each oracle process (including those that exited). select sid, pid, count(*) from x$trace where (sid, pid) in (select sid, pid from v$session s, v$process p where s.paddr = p.addr) group by sid, pid order by 1, 2 shows the numbers for each currently existing session (I think without the where clause, exited sessions would be included). select event, op, time, seq#, data from x$trace where sid = &sid and pid = &pid order by time shows traced events for a session in question.x$ugancouser global area, network connectionBase table of v$dblink. Since it's about UGA, each session has different content. After you end your distributed transactions (which includes distributed queries) and close database links, v$dblink no longer shows the entries. But x$uganco still has them, with ncoflg set to 8320 and hstflg set to 0. Unfortunately this is not very useful because you can't see the UGA content from a different session.



Note 1 x$kglcursor columns

These columns are not exposed in v$sql based on comparison in v$fixed_view_definition in 9.2.0.1 (for column match between x$kglcursor and v$sql, view browser source):kglhdamk: always 0;kglhddmk: 0,1,65,253,...; some kind of masks (kglhdkmk, keep mask, is exposed as v$sql.kept_versions);kglhdexc: executions but not used any more; see documentation for v$db_object_cache.executions which is x$kglob.kglhdexc; 9i uses kglobt05 and 10g uses kglobt48; but kglobt05 and kglobt48 may be 0 perhaps on heap 6 flush(?) while kglhdexc keeps the old value?kglhdflg: (Ref) in my 9i DB:SQL> select to_char(kglhdflg,'xxxxxxxx'), count(*) from x$kglcursor group by to_char(kglhdflg,'xxxxxxxx');TO_CHAR(K   COUNT(*)--------- ---------- 10010000        193 10010001         39 12010000         49 50010000         95kglhdnsp, kglhdobj, kglhdpmd: parent handle namespace, object, pin mode;kglnadlk: (DB link, Ref);kglnaownkglnaptm: previous time; probably deprecated, all null;kglobflg: Ref;kglobhd[0-7]: heap descriptors 0 to 7, can be passed to x$ksmhp.ksmchds, can be used to perform the heapdump_addr dumps (Bug:2247763)kglobhs7: heap 7 sizekglobpc0kglobt22 kglobt23 kglobt24 kglobt25 kglobt26 kglobt27kglobtl0 kglobtl1kglobtn1 kglobtn2 kglobtn3 kglobtn4 kglobtn5kglobtyp


Note 2 Links

Rama Velpuri Original source of possibly all x$ table web pages
Julian Dyke X$ tables of different versions
Frank Naude Covers some tables not covered by me
Egor Starostin Definitions in v$fixed_view_definition nicely formatted for 10.2 and 11.2

To my Computer Page


0 0
原创粉丝点击