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

ѧϰ¡¶Oracle 9i10g±à³ÌÒÕÊõ¡·µÄ±Ê¼Ç (Îå)

 1.¾¡¿ÉÄܵØʹÓð󶨱äÁ¿ ²»Óÿª¹ØCURSOR_SHARING=FORCE 
Èç¹ûÄãÔ¸Ò⣬Õâ¸öÌØÐÔ»áʵÏÖÒ»¸ö×Ô¶¯°ó¶¨Æ÷£¨auto-binder£©¡£
Èç¹ûÓÐÒ»¸ö²éѯ±àдΪSELECT * from EMP WHERE EMPNO = 1234£¬×Ô¶¯°ó¶¨Æ÷»áÇÄÎÞÉùÏ¢µØ°ÑËü¸Äд³É
SELECT * from EMP WHERE EMPNO = :x¡£ÕâȷʵÄܶ¯Ì¬µØ´ó´ó¼õÉÙÓ²½âÎöÊý£¬²¢¼õÉÙÇ°ÃæÌÖÂ۵Ŀâãŵȴý
ʱ¼ä——µ«ÊÇ£¨·²ÊÂ×ÜÓиö“µ«ÊÇ”£©£¬Ëü¿ÉÄÜÓÐһЩ¸±×÷Óá£Óα깲ÏíµÄÒ»¸ö³£¼û¸±×÷ÓÃÈçÏÂËùʾ£º
ops$tkyte@ORA10G> select /* TAG */ substr( username, 1, 1 )
2 from all_users au1
3 where rownum = 1;
S
-
B
ops$tkyte@ORA10G> alter session set cursor_sharing=force;
Session altered.
ops$tkyte@ORA10G> select /* TAG */ substr( username, 1, 1 )
2 from all_users au2
3 where rownum = 1;
SUBSTR(USERNAME,1,1)
ÕâÀïµ½µ×·¢ÉúÁËʲô£¿ÎªÊ²Ã´µ½µÚ¶þ¸ö²éѯʱSQL*Plus ±¨¸æµÄÁÐͻȻ±äµÃÕâô´ó£¿ÒªÖªµÀ£¬Õ⻹ÊÇ
ͬһ¸ö²éѯѽ£¡Èç¹û²é¿´Ò»ÏÂÓα깲ÏíÉèÖÃΪÎÒÃÇ×öÁËЩʲô£¬Ô­Òò¾Í»áºÜÇå³þÁË£¨»¹»áÃ÷°×ÆäËûһЩÎÊ
Ì⣩£º
Óα깲Ïí»áɾ³ý²éѯÖеÄÐÅÏ¢¡£ËüÕÒµ½Ã¿Ò»¸öÖ±½ÓÁ¿£¨literal£©£¬°üÀ¨ÄÚÖÃÇó×Ó´®º¯Êý£¨substr£©µÄ
²ÎÊý£¬Ö±½ÓÁ¿¾ÍÊÇÎÒÃÇʹÓõij£Á¿¡£Ëü°ÑÕâЩֱ½ÓÁ¿´Ó²éѯÖÐɾ³ý£¬²¢´úÖ®Ò԰󶨱äÁ¿¡£SQL ÒýÇæÔÙÒ²²»
ÖªµÀÕâ¸öÁÐÊdz¤¶ÈΪ1 µÄ×Ó´®£¬ËüµÄ³¤¶ÈÊDz»È·¶¨µÄ¡£ÁíÍ⣬¿ÉÒÔ¿´µ½where rownum = 1 ÏÖÔÚÒ²ÒѾ­°ó¶¨¡£
¿´ÉÏÈ¥Ëƺõ²»´í£»²»¹ý£¬ÓÅ»¯Æ÷°ÑÒ»¸öÖØÒªµÄÐÅÏ¢Ò²Ò»²¢É¾³ýÁË¡£Ëü²»ÖªµÀ“Õâ¸ö²éѯ½«»ñÈ¡Ò»ÐД£»ÏÖÔÚ
Ö»ÈÏΪ“Õâ¸ö²éѯ½«·µ»ØÇ°N ÐУ¬¶øN ¿ÉÄÜÊÇÈκÎÖµ”¡£Êµ¼ÊÉÏ£¬Èç¹û¼ÓÉÏSQL_TRACE=TRUE ºóÔÙÔËÐÐÕâЩ
²éѯ£¬Äã»á·¢ÏÖÿ¸ö²éѯʹÓõIJéѯ¼Æ»®¶¼²»Í¬£¬ËüÃÇÍê³ÉµÄ¹¤×÷Á¿Ò²´óÏྶͥ¡£¿¼ÂÇÒÔϲéѯ£º
------------------------------
B
ops$tkyte@ORA10G> select sql_text from v$sql
2 where sql_text like 'select /* TAG */ %';
SQL_TEXT
-------------------------------------------------------------------------------
select /* TAG */ substr( username, 1, 1 ) from all_users au1 where rownum = 1
select /* TAG */ substr( username, :"SYS_B_0", :"SYS_B_1" ) from all_users au2 where
rownum = :"SYS_B_2"
select /* TAG */ substr( username, 1, 1 )
from all_users au1
where rownu


Ïà¹ØÎĵµ£º

ÓëoracleÏà¹ØµÄһЩÃüÁî

1.µÇ½ϵͳÓû§
sqlplus È»ºóÊäÈëϵͳÓû§ÃûºÍÃÜÂë
µÇ½±ðµÄÓû§
conn Óû§Ãû/ÃÜÂë;
2.´´½¨±í¿Õ¼ä
create tablespace ¿Õ¼äÃû
datafile 'c:\¿Õ¼äÃû' size 15M --±í¿Õ¼äµÄ´æ·Å·¾¶,³õʼֵΪ15M
autoExtend on next 10M --¿Õ¼äµÄ×Ô¶¯Ôö³¤µÄÖµÊÇ10M
permanent online; --ÓÀ¾ÃʹÓÃ
3.´´½¨Óû§
create user s ......

Oracle ×î³£Óù¦Äܺ¯Êý¾­µä»ã×Ü

¡¡¡¡* SQL Group Function
*
s (num can be a column or ex
pression)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡(null values are ign
*
ored, default between distin
ct and all is all)¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡********************
***************
****************************
****************
¡¡¡¡AVG([distinct or all ......

½â¾öÐ޸ļÆËã»úÃûOracleÎÞ·¨Æô¶¯µÄÎÊÌâ

°²×°Oracle Database(10.0.2)ºó£¬Èç¹ûÐ޸ĻúÆ÷Ãûºó£¬
»áµ¼Ö¿ØÖÆÃæ°åµÄ·þÎñÖÐÆô¶¯OracleTNSLisener·þÎñÁ¢¿Ì¾ÍÍ£Ö¹¡£
ʹÓÃÃüÁîÐй¤¾ß£¬ÌáʾÈçÏ£º
(»úÆ÷ÃûÔ­À´Îª£ºANSWER-1738E000£¬¸ÄΪ£ºANSWER)
 
½â¾ö·½·¨£º
1>¹Øµô¿ØÖÆÃæ°åÖÐÓйØÓÚ Oracle Database µÄ·þÎñ¡£
2>ÐÞ¸Ä C:\oracle\product\10.2.0\db_1\NE ......

¼×¹ÇÎÄÍƳö¡°Oracle¼Ó¿ì¼Æ»®¡±

 ¶þÁãÁã¾ÅÄêʮԶþÊ®ÈÕ£¬´ò´ÓÈýÄêÇ°ÍƳöOracle¼Ó½ô¼Æ»®ÒÔÀ´£¬¼×¹ÇÎĹ«Ë¾ÒѾ­Ôö¼ÓÁËÆß,000¶à¼ÒÖÎÀíÈí¼þÖÐÐÍÆóÒµ¿Í»§£¬µ±Ç°ÖÐÐÍÆóÒµ¿Í»§×ÜÁ¿ÒѾ­³¬¹ý25,000¼Ò¡£
͸¹ýÍƳöÂíÏòÖÐÐÍÆóÒµ¿Í»§µÄOracle¼Ó¿ì¼Æ»®Ð¹¦ÄÜ£¬°üÀ¨ÐÂʽ¼Ó¿ì¼Æ»®½â¾ö·½°¸¡¢OracleÆóÒµ¼ÓËÙÆ÷¡¢²ÆÎñÑ¡¼þºÍµ÷¶È²½ÖèµÈ£¬¼×¹ÇÎÄÔÚ²»Í£¶ÒÏÖ˳Àû¡£
ÃæÁÙÖÐÐÍ ......

ѧϰ¡¶Oracle 9i10g±à³ÌÒÕÊõ¡·µÄ±Ê¼Ç (Èý)

 1.¶à°æ±¾£º¶ÁÒ»Ö²éѯ  ·Ç×èÈû²éѯ
Oracle ²ÉÓÃÁËÒ»ÖÖ
¶à°æ±¾¡¢¶ÁÒ»Ö£¨read-consistent£©µÄ²¢·¢Ä£ÐÍ¡£ÔÙ´Î˵Ã÷£¬ÎÒÃǽ«ÔÚµÚ7 Õ¸üÏêϸµØ½éÉÜÓйصļ¼Êõ¡£
²»¹ý£¬ÊµÖÊÉϽ²£¬Oracle ÀûÓÃÕâÖÖ»úÖÆÌṩÁËÒÔÏÂÌØÐÔ£º
¶ÁÒ»Ö²éѯ£º¶ÔÓÚÒ»¸öʱ¼äµã£¨point in time£©£¬²éѯ»á²úÉúÒ»ÖµĽá¹û¡£
·Ç×èÈû²éѯ£º²éѯ²»» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ