page cache与buffer cache的关系
1. page cache是VFS的一部分,buffer cache是块设备驱动的一部分2. page cache是面向用户IO的cache,buffer cache是面向块设备IO的cache,3. page cache按照文件的逻辑页进行缓冲,buffer cache按照文件的物理块进行缓冲.4. page cache与buffer cache并不相互独立而是相互融合的,同一文件的cache页即可存在于page cache中,又可存在于buffer cache中,它们在物理内存中只有一份拷贝.文件系统接口就处于page cache和buffer cache之间,它完成page cache的逻辑页与buffercache的物理块之间的相互转换,再交给统一的块设备IO进行调度处理
Cache 和 Buffer的区别
Cache :高速缓存,是位于CPU与主内存间的一种容量较小但速度很高的存储器.由于CPU的速度远高于主内存 ,CPU直接从内存中存取数据要等待一定时间周期,Cache中保存着CPU刚用过或循环使用的一部分数据,当CPU再次使用该部分数据时可从Cache中直接调用,这样就减少了CPU的等待时间,提高了系统的效率.Cache又分为一级Cache(L1 Cache)和二级Cache(L2 Cache),L1 Cache集成在CPU内部,L2Cache早期一般是焊在主板上,现在也都集成在CPU内部,常见的容量有256KB或512KB L2Cache.Buffer :缓冲区,一个用于存储速度不同步的设备或优先级不同的设备之间传输数
Page cache vs Buffer cache
Page cache is used to hold pages that contain the data read/written from disk.Whenever a file is read from disk, the data is first copied in page in PageCache and then to user space buffer.Similarly , while writing the data is first written to page in page cache and thento the disk(deferred write).Buffer cache is now implemented through Page Cache(there is no separate BufferCache now)...those pages that are used as buffer cache in the Page cache are called as "bufferpages"[@more@]
The difference between buffers and cache
Buffers are allocated by various processes to use as input queues, etc. Most of the time, buffers are some processes' output, and they are file buffers. A simplistic explanation of buffers is that they allow processes to temporarily store input in memory until the process can deal with it.Cache is typically frequently requested disk I/O. If multiple processes areaccessing the same files, much of those files will be cached to improve performance (RAM being so much faster than hard drives), it's
The Difference Between Cache Memory And A Buffer Area
In computing, a buffer is a region of memory used to temporarily hold output orinput data, comparable to buffers in telecommunication. The data can be output to or inputfrom devices outside the computer or processes within a computer. Buffers can be implemented ineither hardware or software, but the vast majority of buffers are implemented in software. Buffersare used when thereis a difference between the rate at which data is received and the rate at whichit can be processed, or in the case tha
10gR2 Transport AWR Data
全文摘自http://xzh2000.itpub.net/post/96/42411Let's say you are tying to resolve some performance issues in the production databases. As you saw elsewhere in this article, the AWR data is vital for the analysis. However, analyzing AWR data during a normal production run may not be desirable or even feasible. Rather, you may want to load the data in some central location for comparative analysis. How can you do that? A new package DBMS_SWRF_INTERNAL has been provided in Oracle Database 10g Releas
10g awr与statspack区别
全文摘自http://xzh2000.itpub.net/post/96/66492Oracle Database 10 genhances the data collection mechanism with the introduction of the Automatic Workload Repository and Active Session History, which replace the previous performance data gathering tools such as Statspack and utlbstat/utlestat. The major differences between the current repositories from previous such tools include the following:■ Earlier tools had no automated way of interpreting the collected data and results produced by supplied
Examples of Secondary Index
引用自http://developer.mimer.com/documentation/html_92/Mimer_SQL_Mobile_DocSet/Defining_Database9.htmlCreate a secondary index called ITM_RELEASE_DATE on the RELEASE_DATE column in the ITEMS table: CREATE INDEX itm_release_date ON items(release_date);Primary key columns may also be included in a secondary index. If a table has the primary keycolumns A, B, and C, the primary index would cover all three columns of the primary key.The following combinations of the columns in the primary key are aut
Creating Secondary Indexes
引用自:http://developer.mimer.com/documentation/html_92/Mimer_SQL_Mobile_DocSet/Defining_Database9.htmlA secondary index is automatically used during searching when it improves the efficiency of thesearch.Secondary indexes are maintained by the system and are invisible to the user.Any column(s) may be specified as a secondary index, except columns declared using a LOB data type.Columns in the PRIMARY KEY, the columns of a FOREIGN KEY and columns defined as UNIQUE areautomatically indexed, (in th
Rowids in Non-Oracle Databases
Oracle database applications can be run against non-Oracle database servers using SQL*Connect or theOracle Transparent Gateway. In such cases, the format of rowids varies according to thecharacteristics of the non-Oracle system. Furthermore, no standard translation toVARCHAR2/hexadecimal format is available. Programs can still use the ROWID datatype. However, theymust use a nonstandard translation to hexadecimal format of length up to 256 bytes.Rowids of a non-Oracle database can be stored in a
Guesses in Logical Rowids
When a row's physical location changes, the logical rowid remains valid even if it contains a guess,although the guess could become stale and slow down access to the row. Guess information cannot beupdated dynamically. For secondary indexes on index-organized tables, however, you can rebuild theindex to obtain fresh guesses. Note that rebuilding a secondary index on an index-organized tableinvolves reading the base table, unlike rebuilding an index on an ordinary table.Collect index statistics w
Comparison of Logical Rowids with Physical Rowids
Logical rowids are similar to the physical rowids in the following ways:Logical rowids are accessible through the ROWID pseudocolumn.You can use the ROWID pseudocolumn to select logical rowids from an index-organized table. TheSELECT ROWID statement returns an opaque structure, which internally consists of the table's primarykey and the physical guess (if any) for the row, along with some control information.You can access a row using predicates of the form WHERE ROWID = value, where value is th
Logical Rowids
Rows in index-organized tables do not have permanent physical addresses , they are stored in theindex leaves and can move within the block or to a different block as a result of insertions.Therefore their row identifiers cannot be based on physical addresses. Instead, Oracle providesindex-organized tables with logical row identifiers, called logical rowids, that are based on thetable's primary key. Oracle uses these logical rowids for the construction of secondary indexes onindex-organized table
How Rowids Are Used
Oracle uses rowids internally for the construction of indexes. Each key in an index is associatedwith a rowid that points to the associated row's address for fast access. End users and applicationdevelopers can also use rowids for several important functions:Rowids are the fastest means of accessing particular rows.Rowids can be used to see how a table is organized.Rowids are unique identifiers for rows in a given table.Before you use rowids in DML statements, they should be verified and guarant
Restricted Rowids
Restricted rowids use a binary representation of the physical address for each row selected. Whenqueried using SQL*Plus, the binary representation is converted to a VARCHAR2/hexadecimalrepresentation. The following query:SELECT ROWID, last_name FROM employees WHERE department_id = 30;can return the following row information:ROWID ENAME------------------ ----------00000DD5.0000.0001 KRISHNAN00000DD5.0001.0001 ARBUCKLE00000DD5.0002.0001 NGUYENAs shown, a restricted rowid's VARCHAR2
Examples of Rowid Use
You can use the function SUBSTR to break the data in a rowid into its components. For example, youcan use SUBSTR to break an extended rowid into its four components (database object, file, block,and row):SELECT ROWID, SUBSTR(ROWID,1,6) "OBJECT", SUBSTR(ROWID,7,3) "FIL", SUBSTR(ROWID,10,6) "BLOCK", SUBSTR(ROWID,16,3) "ROW" FROM products;ROWID OBJECT FIL BLOCK ROW------------------ ------ --- ------ ----AAA
Extended Rowids
Extended rowids use a base 64 encoding of the physical address for each row selected. The encodingcharacters are A-Z, a-z, 0-9, +, and /. For example, the following query:SELECT ROWID, last_name FROM employees WHERE department_id = 20;can return the following row information:ROWID LAST_NAME------------------ ----------AAAAaoAATAAABrXAAA BORTINSAAAAaoAATAAABrXAAE RUGGLESAAAAaoAATAAABrXAAG CHENAAAAaoAATAAABrXAAN BLUMBERGAn extended rowid has a four-piece format, OOOOOOFFFBBBBBBRRR:OOO
Physical Rowids
Physical rowids provide the fastest possible access to a row of a given table. They contain thephysical address of a row (down to the specific block) and allow you to retrieve the row in a singleblock access. Oracle guarantees that as long as the row exists, its rowid does not change. Theseperformance and stability qualities make rowids useful for applications that select a set of rows,perform some operations on them, and then access some of the selected rows again, perhaps with thepurpose of up
The ROWID Pseudocolumn
Each table in an Oracle database internally has a pseudocolumn named ROWID. This pseudocolumn is notevident when listing the structure of a table by executing a SELECT * FROM ... statement, or aDESCRIBE ... statement using SQL*Plus, nor does the pseudocolumn take up space in the table.However, each row's address can be retrieved with a SQL query using the reserved word ROWID as acolumn name, for example:SELECT ROWID, last_name FROM employees;You cannot set the value of the pseudocolumn ROWID in
Datatypes (1) : ROWID and UROWID
Oracle uses a ROWID datatype to store the address (rowid) of every row in the database.Physical rowids store the addresses of rows in ordinary tables (excluding index-organized tables),clustered tables, table partitions and subpartitions, indexes, and index partitions andsubpartitions.Logical rowids store the addresses of rows in index-organized tables.A single datatype called the universal rowid, or UROWID, supports both logical and physical rowids,as well as rowids of foreign tables such as no