ORACLE ·Ö×é ÅÅÐò³öÇ°Ãæ×î´óµÄNÐÐ
select custid,carid,Cunote,INVNO,BUYPLAN
from ( select custid,carid,Cunote,INVNO,BUYPLAN,
row_number() over(partition by custid,carid order by Feedbackid desc) rn
from pvE3S.T_VCTM_CUSTOMER_FEEDBACK) t1 where rn=1
°´Feedbackid ÅÅÐò,rnÊÇǰNÐÐ
Ïà¹ØÎĵµ£º
´Ó8iµ½10g£¬Oracle²»¶Ï½ø»¯×Ô¼ºµÄSQL TuningÖÇÄÜ£¬Ò»Ð©Ãؼ®¼¶µÄÓÅ»¯¿Ú¾÷ÒѾʧЧ¡£
µ«ÎÒϲ»¶Ê§Ð§£¬²»Óüǿھ÷£¬²Ù¸öToad for Oracle Xpert
£¬°´ÕÕ´ó·½ÏòÊæÊæ·þ·þµÄ
µ÷ÓŲÅÊǰ®×öµÄÊÂÇé¡£
1.Excution Plan
Excution
PlanÊÇ×î»ù±¾µÄµ÷ÓŸÅÄ²»¹ÜÄãµÄµ÷ÓÅ´µµÃÈçºÎÌ ......
oracle startupʱ ±¨´íORA-00600: ÄÚ²¿´íÎó´úÂ룬²ÎÊý: [kcratr1_lostwrt], [], [], [], [], [], [], []
ÔÒò¿ÉÄÜÊÇ·Ç·¨¹Ø»ú»òµôµçÔì³É,ÒÔÏÂÊdzöÏÖµÄÎÊÌâ¼°½â¾ö·½·¨:
C:\Documents and Settings\Administrator>sqlplus
ÇëÊäÈëÓû§Ãû: /as sysdba
SQL> startup
ORA-01081: ÎÞ·¨Æô¶¯ÒÑÔÚÔËÐÐµÄ ORACLE ......
1.´´½¨Ñ§Éú±í£º
CREATE TABLE student (
xh number primary key,
Name varchar2(10) not null);
2. ´´½¨ÐòÁУº
CREATE SEQUENCE student_seq
START WITH 1
INCREMENT BY 1
NOCACHE;
°´»Ø³ ......
SQLµÄÓÅ»¯Ó¦¸Ã´Ó
5
¸ö·½Ãæ½øÐе÷Õû£º
1.È¥µô²»±ØÒªµÄ´óÐͱíµÄÈ«±íɨÃè
2.»º´æÐ¡ÐͱíµÄÈ«±íɨÃè
3.¼ìÑéÓÅ»¯Ë÷ÒýµÄʹÓÃ
4.¼ìÑéÓÅ»¯µÄÁ¬½Ó¼¼Êõ
5.¾¡¿ÉÄܼõÉÙÖ´Ðмƻ®µÄ
Cost
SQLÓï¾ä£º
ÊǶÔÊý¾Ý¿â(
Êý¾Ý
)
½øÐвÙ×÷µÄΩһ;¾¶£»
ÏûºÄÁË70%~90%
µÄÊý¾Ý¿â×ÊÔ´£»¶ÀÁ¢ÓÚ³ÌÐòÉè¼ÆÂß¼£¬Ïà¶ÔÓÚ¶Ô³ÌÐòÔ´´úÂëµÄÓÅ»¯£¬ ......