ÈçºÎ¿´¶®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 ·ÖÇø±í
OracleÌṩÁË·ÖÇø¼¼ÊõÒÔÖ§³ÖVLDB(Very Large DataBase)¡£·ÖÇø±íͨ¹ý¶Ô·ÖÇøÁеÄÅжϣ¬°Ñ·ÖÇøÁв»Í¬µÄ¼Ç¼£¬·Åµ½²»Í¬µÄ·ÖÇøÖС£·ÖÇøÍêÈ«¶ÔÓ¦ÓÃ͸Ã÷¡£
OracleµÄ·ÖÇø±í¿ÉÒÔ°üÀ¨¶à¸ö·ÖÇø£¬Ã¿¸ö·ÖÇø¶¼ÊÇÒ»¸ö¶ÀÁ¢µÄ¶Î£¨SEGMENT£©£¬¿ÉÒÔ´æ·Åµ½²»Í¬µÄ±í¿Õ¼äÖС£²éѯʱ¿ÉÒÔͨ¹ý²éѯ±íÀ´·ÃÎʸ÷¸ö·ÖÇøÖеÄÊý¾Ý£ ......
OracleÖÐÁÙʱ±í²úÉú¹ýÁ¿RedoµÄ˵Ã÷
×î½ü,ÔÚOracle9iÖÐÄãÓùýÁÙʱ±íÂð?
ËüÊÇ·ñ¸øÄã´øÀ´ÁËÐÔÄÜÌá¸ß?Äã×¢Òâ¹ýô?
--------------------------------------------------------------------------------
ºÃÁËÑÔ¹éÕý´«.
ÎÒÃÇÖªµÀÁÙʱ±íÔÚDML²Ù×÷ÖпÉÒÔ¼õÉÙredoµÄÉú³É,´Ó¶øÔÚ±£´æÖмä½á¹û¼¯Ê±¿ÉÒÔ´øÀ´½Ï´óµÄÐÔÄÜÌá¸ß.
¿ÉÊÇ,È ......
²éѯ·¢ÉúËÀËøµÄselectÓï¾ä
select sql_text from v$sql where hash_value in
(select sql_hash_value from v$session where sid in
(select session_id from v$locked_object))
---------------------------------------------------------
¹ØÓÚÊý¾Ý¿âËÀËøµÄ¼ì²é·½·¨
Ò»¡¢   ......
Æäʵ´´½¨dgÍøÂçÉϵÄÎĵµºÜ¶à£¬ÎÒÊÇ¿´Ð¡²¼ÀÏʦÊÇÊÓƵѧϰµÄ
ÓÃÐéÄâ»ú×ö²âÊÔ£¬ÅªÁ˺ü¸Ì죬ÏÂÃæ¼Ç¼һÏÂÔø¾×ö¹ýÓ¡Ïó±È½ÏÉîµÄµØ·½
1.½«Primary·þÎñÆ÷´¦Óڹ鵵ģʽºÍForce Loggingģʽ
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;
S ......
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit)
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_client_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10 ......