oracleÌåϵ½á¹¹ÉîÈëѧϰBuffer Cache
oracleÌåϵ½á¹¹ÉîÈëѧϰBuffer Cache - Overview
oracle 2009-09-02 23:13:26 ÔĶÁ40 ÆÀÂÛ0 ×ֺţº´óÖÐС
ÌÎÌÎÉîÈëѧϰoracleÌåϵ½á¹¹
ÎÒ·¢¾õ£¬Ó¢ÎĵÄһЩ¼¼ÊõÎÄÕÂÔÚÃèÊöoracleÔÀí·Ç³£µÄÇ¡µ±µ½Î»£¬±í´ïµÄ·Ç³£µÄÃÀ£¬ºÇºÇ¡£Ó¢ÎIJ»ºÃ£¬Ï׳ó·Ò벢ѧϰÁË£¬ÈÏÕæ¿´ÁË£¬ÏàÐÅÄãÊÜÒæ·Ëdz¡£
oracleÌåϵ½á¹¹Ö®£ºBuffer Cache - Overview
All Oracle data is obtained by users from the buffer cache. The basic purpose of the cache is to minimize physical
disk I/O by holding (buffering) copies of requested data blocks in memory. Data that is buffered in the cache can
be served to users at memory access speed, much faster than going to disk for it. The large performance penalty of
disk I/O makes tuning the buffer cache an extremely important task for the DBA.
Oracle data is stored on disk in identically sized units called blocks. Block size is determined at database creation
by the DB_BLOCK_SIZE initialization parameter. The buffer cache is also divided into buffers of this same size, and
each buffer can hold exactly one database block. Thus, the block is the basic unit of data transfer between disk and
memory in Oracle.
ËùÓеÄoracleÊý¾Ý»ñÈ¡£¬¶¼ÊÇÓû§Í¨¹ý¸ßËÙÊý¾Ý»º´æÈ¡µÃµÄ£¬×î»ù±¾µÄÄ¿µÄ¾ÍÊÇΪÁ˼õÉÙÎïÀí´ÅÅ̵ÄI/O²Ù×÷ͨ¹ý°ÑÇëÇóµÄÊý¾Ý±£´æÔÚÄÚ´æµ±ÖС£
±»»º´æÔÚ¸ßËÙ»º³åÇøµÄÊý¾ÝÄܱ»Óû§¿ìËٵĴÓÄÚ´æÖлñÈ¡µ½£¬ÄDZȴӴÅÅÌȥȡµÃÊý¾ÝÒª¿ìºÜ¶à¡£´ÅÅ̵ÄI/OËùÏûºÄµÄ¾Þ´óµÄÐÔÄÜ´ú¼Û£¬ÕâʹµÃµ÷ÓÅ
Êý¾Ý¿â¸ßËÙ»º´æ³ÉΪdbaÒ»¸ö·Ç³£Ã÷È·µÄÖØÒªÈÎÎñ¡£
oracleÊý¾Ý±»´æ´¢ÔÚ´ÅÅÌÖеÈͬ´óСµÄµ¥ÔªÖУ¬ÕâЩµ¥Ôª±»½Ð×ö¿é£»¿é´óСÔÚÊý¾Ý¿â±»´´½¨Ê±Í¨¹ý³õʼ²ÎÊýdb_block_sizeÀ´¶¨Òå¡£Êý¾Ý¸ßËÙ»º´æ
Ò²±»»®·Ö³ÉͬÑù´óСµÄ»º´æ¿é¡£²¢ÇÒÿ¸ö»º´æ¿é³ÖÓÐÒ»¸öÊý¾Ý¿â¿é£¬Òò´Ë¿éÊÇ»ù±¾µÄÊý¾Ý´«Ë͵¥ÔªÔÚÊý¾ÝÎļþºÍÄÚ´æÖ®¼ä¡£
oracleÊý¾Ý¿â¸ßËÙ»º´æÖ®Cache Hit Ratio
The buffer cache is a shared resource, accessible by all users. When a user process requests data, Oracle firsts looks
for that data's block in the cache. If the data is buffered in the cache it is returned to the requ
Ïà¹ØÎĵµ£º
×÷Óãºmerge into ½â¾öÓÃB±í¸úÐÂA±íÊý¾Ý£¬Èç¹ûA±íÖÐûÓУ¬Ôò°ÑB±íµÄÊý¾Ý²åÈëA±í£»
Óï·¨£º
MERGE INTO [your table-name] [rename your table here]
USING ( [write your query here] )[rename your query-sql and using just like a table]
ON ([conditional expression here] AND [...]...)
WHEN MATHED THEN [here ......
´æ´¢¹ý³Ì °üº¬Èý²¿·Ö£º ÉùÃ÷£¬Ö´Ðв¿·Ö£¬Òì³£¡£
¿ÉÒÔÓÐÎÞ²ÎÊý³ÌÐòºÍ´ø²ÎÊý´æ´¢¹ý³Ì¡£
Î޲γÌÐòÓï·¨
1 create or replace procedure NoParPro
2 as ;
3 begin
4&n ......
--´´½¨Óû§
create user iagent identified by ia
--profile default
default tablespace users
temporary tablespace temp;
--account unlock;
--ɾ³ýÓû§
drop user iagent cascade;
--ÐÞ¸ÄÓû§ÃÜÂë
alter user iagent identified by ia;
--¸ø´´½¨µ ......
1¡¢ÔÚ±¾»ú69ÉÏ´´½¨Êý¾Ý¿âorcl £¬global_name=orcl£¬Ê¹ÓÃÓï¾ä
alter database rename global_name to orcl.us.oracle.com ÐÞ¸ÄÊý¾Ý¿âµÄÈ«¾ÖÊý¾Ý¿âÃûΪorcl.us.oracle.com
2¡¢ÔÚÐé»ú188ÉÏ´´½¨Êý¾Ý¿âviotest£¬global_name=viotest£¬Ê¹ÓÃÓï¾ä
alter database rename global_name to viotest.us.oracle.com ÐÞ¸ÄÊý¾Ý¿âµÄÈ«¾ÖÊ ......
¹¤×÷¹ý³ÌÖÐÐèÒª½«oracleÖеÄÊý¾Ýµ¼Èëµ½excleÖУ¬×Ô¼º×öÁËһϣ¬ÏȽ«·½·¨½éÉÜÈçÏ£¬
Äã¿ÉÒÔ¸ù¾Ý×Ô¼ºµÄʵ¼ÊÇé¿ö£¬×ö³ö¸ü¸Ä¡£
1,½¨Á¢Ò»¸öemp.sqlÎļþÎÒµÄÊÇÔÚF :\SQL\EMP.SQL
set line 120
set pagesize 100
set feedback off
--¹Ø±ÕÀàËÆÓÚ“ÒÑÑ¡11ÐДÕâÑùµÄÊä³ö·´À¡£¬ÒÔ±£Ö¤spoolÊä³ö¶¨ÒåµÄ--ÎļþÖÐÖ»ÓÐÎÒÃÇ ......