常用的Oracle x$ Tables
本文章源自:[@more@]
x$bh
Information on buffer headers.
Contains a record (the buffer header) for each block in the .
This select statement lists how many blocks are Available, Free and Being Used.
select count(*), State from ( select (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 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 .
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 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.
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 | See |
x$kcbwbpd
Buffer pool descriptor, the base table for .
How is the buffer cache split between the , the and the buffer pool.
x$kcbwds
Set descriptor, see also x$kcbwbpd
The column id can be joined with .
The column bbwait corresponds to the 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 for the relevant buffer pool.
x$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: , , and .
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 .
k$kcccp can (together with x$kccle) be used to monitor the progress of the writing of . 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$kgllk
This table lists all held and requested library object locks for all sessions. It is more complete than .
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$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$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$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 caused the throw out of the biggest memory chunks since it was last queried.
x$ksmmem
This 'table' seems to allow to address (that is read (write????)) every byte in the . 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 ) - (select 4*count(*) from x$ksmmem) "Must be Zero!" from dual;
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$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.
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 | Transaction |
CI | Cross-instance call invocation |
CU | Bind Enqueue |
DF | |
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 |
JQ | Job queue |
KK | Redo log kick |
LA..LP | 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 | pin |
PF | Password file |
PI | Parallel slaves |
PR | Process startup |
PS | Parallel slave synchronization |
SC | |
SM | |
SQ | number enqueue |
SR | Synchronized replication |
SS | Sort segment |
ST | Space management transaction |
SV | Sequence number value |
SW | Suspend writes enqueue gotten when someone issues |
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 |
x$ksusd
Contains a record for all .
x$ktcxb
The transaction table.
x$kttvs
Lists save undo for each tablespace: The column kttvstnm is the name of the that has saved undo. The column is null otherwise.
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$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$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"; }
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/66634/viewspace-827130/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle TablesOracle
- Oracle 19c Concepts(02):Tables and Table ClustersOracle
- [20181112]Private Temporary Tables Oracle Database 18C.txtOracleDatabase
- Oracle 19c Concepts(03):Indexes and Index-Organized TablesOracleIndexZed
- Oracle:ORA-01219:database not open:queries allowed on fixed tables/views onlyOracleDatabaseView
- Oracle 12c系列(十) | 12c中的Recovering Tables and Table PartitionsOracle
- Oracle 20c 新特性:原生的區塊鏈支援 Native Blockchain tablesOracle區塊鏈Blockchain
- mysql關於FLUSH TABLES和FLUSH TABLES WITH READ LOCK的理解MySql
- Oracle:cursor:mutex XOracleMutex
- Oracle 12C新特性-資料泵新引數(VIEWS_AS_TABLES)OracleView
- 常用的x86彙編指令
- Oracle常用函式Oracle函式
- ORACLE常用語句:Oracle
- oracle常用查詢Oracle
- oracle_ray.sh 常用的oracle sql功能指令碼OracleSQL指令碼
- Oracle 常用SQL筆記OracleSQL筆記
- Oracle 常用方法彙總Oracle
- mysqld --skip-grant-tablesMySql
- CRICOS Data Structures and AlgorithmsHash TablesStructGo
- Oracle常用的16個最佳化技巧Oracle
- 【ORACLE】Oracle常用SQL及重點功能說明OracleSQL
- oracle常用函式介紹Oracle函式
- Oracle常用名詞解釋Oracle
- Oracle DG運維常用SQLOracle運維SQL
- oracle sqlplus 常用命令OracleSQL
- 【BLOCK】Oracle 塊管理常用SQLBloCOracleSQL
- 【LOB】Oracle Lob管理常用sqlOracleSQL
- oracle常用維護查詢Oracle
- Oracle 常用運維命令整理Oracle運維
- How Logs Work On MySQL With InnoDB TablesMySql
- HDU1213-How Many Tables
- 【12.2】Oracle 12C R2新特性-外部表支援分割槽了(Partitioning External Tables)Oracle
- Oracle 19c - 手動升級 Oracle 12.x, 18c CDB 到 Oracle 19c (19.x)Oracle
- 工作中常用的oracle資料庫sqlOracle資料庫SQL
- Oracle常用的系統查詢語句整理Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(五)Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(四)Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(三)Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(二)Oracle