Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

OracleÖÐrownumµÄÓ÷¨

1¡¢²éѯµÚ¼¸ÐеļǼ
select sal from emp where rownum=1; //²éѯµÃµ½µÚÒ»ÐмǼ
select sal from emp where rownum=5; //²»¿ÉÒÔ²éѯµ½µÚÎåÐмǼ£¬ÒòΪrownum ×ÜÊÇ´Ó1¿ªÊ¼²éѯµÄ£¬¹ÊÕâÖÖ·½Ê½²»¿ÉÒÔÖ±½ÓµÃµ½µÚ¼¸ÐеļǼ¡£ÈôÏëµÃµ½µÚÎåÐмǼ£¬Ó¦²ÉÓÃÈçÏ·½Ê½£º
select r,sal from (select rownum r,sal from emp) where r= 5;
2¡¢ÓÃÀ´»ñÈ¡Ç°¼¸ÐеļǼ£¬¼´Ð¡ÓÚijֵµÄ¼Ç¼¡£
Àý£º²éѯǰËÄÐеļǼ
  select rownum,sal from emp where rownum<5;
3¡¢ÓÃÀ´»ñÈ¡ºó¼¸ÐеļǼ£¬¼´´óÓÚijֵµÄ¼Ç¼¡£Àý£º²éѯµÚÎåÐÐÖ®ºóµÄ¼Ç¼
          select r,sal from (select rownum r,sal from emp ) where r>5;
4¡¢²éѯһ¸ö·¶Î§ÄڵļǼ¡£Èç²éѯµÚÈýÐе½µ×°ËÐеļǼ£º
  select r,sal from (select rownum r,sal from emp) where r>=3 and r<=8;
5¡¢rownum ÓëÅÅÐò
       select rownum,sal from emp order by sal;
´ÓÕâÌõÓï¾äµÄÔËÐнá¹ûÄã¿ÉÒÔ·¢ÏÖ£¬rownum²»ÊÇ´Ó1 Ò»´ÎÔö´ó£¬¶øÊÇÂҵģ¬Êµ¼ÊÉÏÕâЩrownumÊÇָÿÌõ¼Ç¼δÅÅÐò֮ǰËù´¦µÄÐÐÊý£¬µ±È»Õâ²»ÊÇÎÒÃÇÏëÒªµÄ½á¹û£¬ÄÇôÈçºÎµÃµ½rownumÒ²ÊÇ˳ÐòÅÅÁеIJéѯ½á¹ûÄØ£¿Õâ¾ÍÐèÒªÏȶÔÔ­¼Í¼ÅÅÐò£¬È»ºó´ÓеÄ˳ÐòÖÐÌáÈ¡³örownumºÍÏëÒªµÄ¼Ç¼ÄÚÈÝ¡£È磺
select rownum,sal from (select * from emp order by sal) ;
select rownum, sal from (select * from emp order by sal ) where rownum <5;
select r, sal from (select rownum r,sal from (select * from emp order by sal )) where r >5;
select r, sal from (select rownum r,sal from (select * from emp order by sal ))
where r >5 and r < 10;


Ïà¹ØÎĵµ£º

oracle Ìåϵ½á¹¹

Ç°¼¸ÌìÃæÊÔµÄʱºòÃæÊÔ¹Ù²ÅÎʹýÎÒORACLEµÄÌåϵ½á¹¹£¬ÈÃÎÒÔÚÒ»ÕÅ°×Ö½ÉÏ»­³öÀ´¡£»ØÍ·ÏëÏ뵱ʱ´ðµÃ»¹²»´í£¬´ó²¿·ÖÄÚÈݶ¼ÃèÊö³öÀ´ÁË£¬ºÇºÇ£¬¸Õ²ÅÔÚÍøÉÏ¿´µ½Ò»Æª½²½âORACLEÌåϵ½á¹¹µÄÎÄÕ£¬¾õµÃ²»´í£¬×ª¹ýÀ´´æ×Å£¬½«À´¿ÉÄÜ»áÓõ½¡£
=================================================================================
ÔÚ±¾ÎÄÀ ......

OracleÊý¾Ý¿â½µµÍHWMµÄ¼¸ÖÖ·½·¨

HWMÊÇoracleÖÐblockÓÐûÓÐʹÓõķֽçÏߣ¬Ëü»áËæ×ÅÊý¾ÝµÄinsert¶øÉÏÉý£¬µ«Ëü²¢²»»áËæÊý¾ÝµÄdelete¶øϽµ£¬Òò´ËÈ«±íɨÃèµÄʱ¼ä²¢²»ÒòÊý¾ÝµÄdelete¶ø¼õÉÙ£¬Ïà·´¿ÉÄÜÓÉÓÚ¿éÇå³ý·´¶øÈ«±íɨÃèʱ¼äÔö¼Ó£¬¿ÉÒÔÓÃÏÂÃæ·½·¨µÄÈÎÒ»Ò»ÖÖÀ´½µµÍHWM£º
µÚÒ»ÖÖ£ºshrink
ÊÊÓÃÓÚ10gÒÔºóµÄ°æ±¾£¬Ç°ÌáÊÇÕâ¸ö±í£¬Ë÷Òý£¬ÎﻯÊÓͼ»òÎﻯÊÓͼlogËùÔ ......

OracleÊý¾Ý¿âΪʲô±äÂýÁË£¿

±¾Îijö×Ô¡¶Íø¹ÜÔ±ÊÀ½ç¡·20002ÄêµÚ8ÆÚ“¹ÊÕÏÕï¶Ï”À¸Ä¿
Ó²¼þ»·¾³£º SUN250·þÎñÆ÷£¬1G CPU , 512M Ram , 18G SCSIÓ²ÅÌ
ϵͳ»·¾³£º SUN Solaris 2.7
·þÎñ»·¾³£º Oracle 8.1.6
ÖÜÎåÎÒ·¢ÏÖOracleÊý¾Ý¿âÔÚÖ´ÐгÌÐòʱµÄÏìÓ¦ÌرðÂý£¬Õû¸öÊý¾Ý¿â·þÎñËùÔÚµÄSUN Solaris 2.7ϵͳҲÊÇÕâÑù£¬ÎÞÂÛÔËÐÐʲô³ÌÐò¶¼±ÈÍù³£ÂýÁ˺ ......

oracle¸ü¸ÄÊý¾Ý¿âÃû

author:skate
time:2009/10/23
ÕâÁ½ÌìÒ»ÅóÓÑÎÊÈçºÎ¸ü¸ÄÊý¾Ý¿âÃû£¬ÓÚÊÇ×ö¸ö²âÊÔ£¬¼òµ¥¼Ç¼Ï£¬ÒÔ±ã˵Ã÷ÎÊÌâ
ÈçºÎÐÞ¸ÄÊý¾Ý¿âÃû£¨db_name)¼°ÊµÀýÃû(Instance_name or Service_name)
NidÊÇOracle´Ó9iR2¿ªÊ¼ÌṩµÄ¹¤¾ß£¬¿ÉÒÔÓÃÀ´¸ü¸ÄÊý¾Ý¿âÃû³Æ£¬¶øÎÞÐèͨ¹ý֮ǰÖؽ¨¿ØÖÆÎļþµÈ·±Ëö·½Ê½¡£
nidÊÇ×Ô´øµÄ¹¤¾ß£¬ÔÚoracle_home/b ......

oracleÓû§È¨Ï޵IJéѯ

oracleÖв鿴Óû§È¨ÏÞ
1.²é¿´ËùÓÐÓû§£º
  select * from dba_users;
  select * from all_users;
  select * from user_users;
2.²é¿´Óû§»ò½ÇɫϵͳȨÏÞ(Ö±½Ó¸³Öµ¸øÓû§»ò½ÇÉ«µÄϵͳȨÏÞ)£º
  select * from dba_sys_privs;
  select * from user_sys_privs;
3.²é¿´½ÇÉ«(Ö»Äܲ鿴µÇ½Óà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ