ÈçºÎ¿´¶®ORACLEÖ´Ðмƻ®
ÈçºÎ¿´¶®ORACLEÖ´Ðмƻ®
Ò»¡¢Ê²Ã´ÊÇÖ´Ðмƻ®
An explain plan is a representation of the access path that is taken when a query is executed within Oracle.
¶þ¡¢ÈçºÎ·ÃÎÊÊý¾Ý
At the physical level Oracle reads blocks of data. The smallest amount of data read is a single Oracle block, the largest is constrained by operating system limits (and multiblock i/o). Logically Oracle finds the data to read by using the following methods:
Full Table Scan (FTS) --È«±íɨÃè
Index Lookup (unique & non-unique) --Ë÷ÒýɨÃ裨ΨһºÍ·ÇΨһ£©
Rowid --ÎïÀíÐÐid
Èý¡¢Ö´Ðмƻ®²ã´Î¹Øϵ
When looking at a plan, the rightmost (ie most inndented) uppermost operation is the first thing that is executed. --²ÉÓÃ×îÓÒ×îÉÏ×îÏÈÖ´ÐеÄÔÔò¿´²ã´Î¹Øϵ£¬ÔÚͬһ¼¶Èç¹ûij¸ö¶¯×÷ûÓÐ×ÓID¾Í×îÏÈÖ´ÐÐ
1.Ò»¸ö¼òµ¥µÄÀý×Ó£º
SQL> select /*+parallel (e 4)*/ * from emp e;
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=82 Bytes=7134)
1 0 TABLE ACCESS* (FULL) OF 'EMP' (Cost=1 Card=82 Bytes=7134):Q5000
--[:Q5000]±íʾÊDz¢Ðз½Ê½
1 PARALLEL_TO_SERIAL SELECT /*+ NO_EXPAND ROWID(A1) */ A1."EMPNO"
,A1."ENAME",A1."JOB",A1."MGR",A1."HI
ÓÅ»¯Ä£Ê½ÊÇCHOOSEµÄÇé¿öÏ£¬¿´Cost²ÎÊýÊÇ·ñÓÐÖµÀ´¾ö¶¨²ÉÓÃCBO»¹ÊÇRBO£º
SELECT STATEMENT [CHOOSE] Cost=1234 --CostÓÐÖµ£¬²ÉÓÃCBO
SELECT STATEMENT [CHOOSE] --CostΪ¿Õ£¬²ÉÓÃRBO(9IÊÇÈç´ËÏÔʾµÄ)
2.²ã´ÎµÄ¸¸×Ó¹ØϵµÄÀý×Ó£º
PARENT1
**FIRST CHILD
****FIRST GRANDCHILD
**SECOND CHILD
Here the same principles apply
Ïà¹ØÎĵµ£º
ÔÚOracleÊý¾Ý¿âÖУ¬undoÖ÷ÒªÓÐÈý´ó×÷ÓãºÌṩһÖÂÐÔ¶Á£¨Consistent Read£©¡¢»Ø¹öÊÂÎñ£¨Rollback Transaction£©ÒÔ¼°ÊµÀý»Ö¸´£¨Instance Recovery£©¡£ Ò»ÖÂÐÔ¶ÁÊÇÏà¶ÔÓÚÔà¶Á£¨Dirty Read£©¶øÑԵġ£¼ÙÉèij¸ö±íTÖÐÓÐ10000Ìõ¼Ç¼£¬»ñÈ¡ËùÓмǼÐèÒª15·ÖÖÓʱ¼ä¡£ ......
´¦Àí·½·¨Ò» £º
¼ì²éÄǸö±í±»Ëø
select sess.sid,sess.serial#, lo.oracle_username,lo.os_user_name,ao.object_name,lo.locked_mode
from v$locked_object lo,dba_objects ao,v$session sess
where ao.object_id = lo.object_id
and lo.session_id = sess.sid;
½âËø
alter system kill session '273,45';
´¦Àí·½·¨¶ ......
´¥·¢Æ÷ÊÇÖ¸´æ·ÅÔÚÊý¾Ý¿âÖУ¬²¢±»Òþ²ØÖ´ÐеĴ洢¹ý³Ì¡£ÔÚOracle8i֮ǰ£¬Ö»ÔÊÐí»ùÓÚ±í»òÊÓͼµÄDML²Ù×÷(insert,update,delete)½¨Á¢´¥·¢Æ÷£¬ÔÚoracle8iÖ®ºó£¬²»½öÖ§³ÖDML²Ù×÷£¬Ò²ÔÊÐí»ùÓÚϵͳʼþ(Æô¶¯Êý¾Ý¿â£¬¹Ø±ÕÊý¾Ý¿â£¬µÇ¼)ºÍDDL²Ù×÷½¨Á¢´¥·¢Æ÷¡£
Ò»¡¢´¥·¢Æ÷¼ò½é
´¥·¢Æ÷ÊÇÖ¸Òþº¬Ö´ÐеĴ洢¹ý³Ì£¬Ëü¿ÉÒÔʹ ......
ÒÔÏÂÎÒ×östreammͬ²½Á½Ì¨»úÆ÷¼äµÄijһ¸öÓû§µÄ²Ù×÷²½Öè¡£ºÜ¼òµ¥,¿´µ½stream
»¹
ÓкܶàÒª¿´µÄ¡£
1.»·¾³½éÉÜ
Ö÷Êý¾Ý¿âSID : obpm
²Ù×÷ϵͳ : win 2003
IPµØÖ· : 192.168.0.1
Global_name :
oracle
version: 10.2.0.1
´ÓÊý¾Ý¿âSID ......