ORACLE³£¼ûÎÊÌâ1000ÎÊ(Ö®ËÄ)
174. /*+ALL_ROWS*/
¡¡¡¡ ±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÍÌÍÂÁ¿,ʹ×ÊÔ´ÏûºÄ×îС»¯.ÀýÈç:
SELECT /*+ALL+_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='CCBZZP';
¡¡¡¡ 175. /*+FIRST_ROWS*/
¡¡¡¡ ±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÏìӦʱ¼ä,ʹ×ÊÔ´ÏûºÄ×îС»¯.ÀýÈç:
SELECT /*+FIRST_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='CCBZZP';
¡¡¡¡ 176. /*+CHOOSE*/
¡¡¡¡ ±íÃ÷Èç¹ûÊý¾Ý×ÖµäÖÐÓзÃÎʱíµÄͳ¼ÆÐÅÏ¢,½«»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑµÄÍÌÍÂÁ¿;±íÃ÷Èç¹ûÊý¾Ý×ÖµäÖÐûÓзÃÎʱíµÄͳ¼ÆÐÅÏ¢,½«»ùÓÚ¹æÔò¿ªÏúµÄÓÅ»¯·½·¨;ÀýÈç:
SELECT /*+CHOOSE*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='CCBZZP';
¡¡¡¡ 177. /*+RULE*/
¡¡¡¡ ±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¹æÔòµÄÓÅ»¯·½·¨.ÀýÈç:
SELECT /*+ RULE */ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='CCBZZP';
¡¡¡¡ 178. /*+FULL(TABLE)*/
¡¡¡¡ ±íÃ÷¶Ô±íÑ¡ÔñÈ«¾ÖɨÃèµÄ·½·¨.ÀýÈç:
SELECT /*+FULL(A)*/ EMP_NO,EMP_NAM from BSEMPMS A WHERE EMP_NO='CCBZZP';
¡¡¡¡ 179. /*+ROWID(TABLE)*/
¡¡¡¡ ÌáʾÃ÷È·±íÃ÷¶ÔÖ¸¶¨±í¸ù¾ÝROWID½øÐзÃÎÊ.ÀýÈç:
SELECT /*+ROWID(BSEMPMS)*/ * from BSEMPMS WHERE ROWID>='AAAAAAAAAAAAAA'
AND EMP_NO='CCBZZP';
¡¡¡¡ 180. /*+CLUSTER(TABLE)*/
¡¡¡¡ ÌáʾÃ÷È·±íÃ÷¶ÔÖ¸¶¨±íÑ¡Ôñ´ØɨÃèµÄ·ÃÎÊ·½·¨,ËüÖ»¶Ô´Ø¶ÔÏóÓÐЧ.ÀýÈç:
SELECT /*+CLUSTER */ BSEMPMS.EMP_NO,DPT_NO from BSEMPMS,BSDPTMS
WHERE DPT_NO='TEC304' AND BSEMPMS.DPT_NO=BSDPTMS.DPT_NO;
¡¡¡¡ 181. /*+INDEX(TABLE INDEX_NAME)*/
¡¡¡¡ ±íÃ÷¶Ô±íÑ¡ÔñË÷ÒýµÄɨÃè·½·¨.ÀýÈç:
SELECT /*+INDEX(BSEMPMS SEX_INDEX) USE SEX_INDEX BECAUSE THERE ARE FEWMALE BSEMPMS */ from BSEMPMS WHERE SEX='M';
¡¡¡¡ 182. /*+INDEX_ASC(TABLE INDEX_NAME)*/
¡¡¡¡ ±íÃ÷¶Ô±íÑ¡ÔñË÷ÒýÉýÐòµÄɨÃè·½·¨.ÀýÈç:
SELECT /*+INDEX_ASC(BSEMPMS PK_BSEMPMS) */ from BSEMPMS WHERE DPT_NO='CCBZZP';
¡¡¡¡ 183. /*+INDEX_COMBINE*/
¡¡¡¡ Ϊָ¶¨±íÑ¡Ôñλͼ·ÃÎÊ·¾,Èç¹ûINDEX_COMBINEÖÐûÓÐÌṩ×÷Ϊ²ÎÊýµÄË÷Òý,½«Ñ¡Ôñ³öλͼË÷ÒýµÄ²¼¶û×éºÏ·½Ê½.ÀýÈç:
SELECT /*+INDEX_COMBINE(BSEMPMS SAL_BMI HIREDATE_BMI)*/ * from BSEMPMS
WHERE SAL<5000000 AND HIREDATE
¡¡¡¡ 184. /*+INDEX_JOIN(TABLE INDEX_NAME)*/
Ïà¹ØÎĵµ£º
µ¥Öµº¯ÊýÔÚ²éѯÖзµ»Øµ¥¸öÖµ£¬¿É±»Ó¦Óõ½select£¬where×Ӿ䣬start withÒÔ¼°connect by ×Ó¾äºÍhaving×Ӿ䡣
(Ò»).ÊýÖµÐͺ¯Êý(Number Functions)
ÊýÖµÐͺ¯ÊýÊäÈëÊý×ÖÐͲÎÊý²¢·µ»ØÊýÖµÐ͵ÄÖµ¡£¶àÊý¸ÃÀຯÊýµÄ·µ»ØÖµÖ§³Ö38λСÊýµã£¬ÖîÈ磺COS, COSH, EXP, LN, LOG,
SIN, SINH, SQRT, TAN, and TANH Ö ......
ºÜ²»ÐÒ£¬½¨Á¢µÄ±í±»Ä³ÈËÎóɾÁË£¬£¬£¬
»¹ºÃ¿ÉÒÔͨ¹ýÕâÑù»Ö¸´¡£
select * from user_recyclebin where original_name like 'FINANCE_%' order by droptime desc;
FLASHBACK TABLE FINANCE_CASE_FEE_ITEM TO BEFORE DROP
¼´ËùÓÐdropµÄ±í¶¼ÔÚ user_recyclebin Õâ¸öoracle»ØÊÕÕ¾ÀïÃæµÄ£¬ÔÙͨ¹ýflashbackÃü ......
1.Æô¶¯Í£Ö¹TNS¼àÌý
lsnrctl start
lsnrctl stop
2.Æô¶¯Oracle Services
net start OracleServiceOrcl
net stop OracleServiceOrcl
SQL> show all --²é¿´ËùÓÐ68¸öϵͳ±äÁ¿Öµ
SQL> show user --ÏÔʾµ±Ç°Á¬½ÓÓû§
SQL> show error¡¡¡¡ --ÏÔʾ´íÎó
SQL> set heading off --½ûÖ¹Êä³öÁбêÌ⣬ĬÈÏֵΪ ......
ORACLE³£¼ûÎÊÌâ1000ÎÊ(Ö®Ò»)
תÌù ×÷Õß: CCBZZP - ]8 L1 m: @) P9 }
´ó¼ÒÔÚÓ¦ÓÃORACLEµÄʱºò¿ÉÄÜ»áÓëµ½ºÜ¶à¿´ÆðÀ´²»ÄѵÄÎÊÌ⣬Ìرð¶ÔÐÂÊÖÀ´Ëµ£¬½ñÌìÎÒ¼òµ¥°ÑËû×ܽáһϣ¬·¢²¼¸ø´ó¼Ò£¬Ï£Íû¶Ô´ó¼ÒÓаïÖú£¡5 ]" z2 z0 ?( n6 q2 W
¶ÔORACLE¸ßÊÖÀ´ËµÊDz»Óÿ´µÄ.
- M/ D* W% x% f' H$ N* ]" m I" W
4 ......
v$session + v$session_wait (ÔÚ10gÀ﹦Äܱ»ÕûºÏ,´ÕºÏËã1¸ö°É.)
v$process
v$sql
v$sqltext
v$bh (¸üÄþÔ¸ÊÇx$bh)
v$lock
v$latch_children
v$sysstat
v$system_event
°´×é·ÖµÄ¼¸×éÖØÒªµÄÐÔÄÜÊÓͼ
1¡£System µÄ over view
v$sysstat , v$system_event , v$parameter
2¡£Ä³¸ösession µÄµ±Ç°Çé¿ö
v$process , ......