oracle´æ´¢¹ý³ÌʵÀý
ÈÏʶ´æ´¢¹ý³ÌºÍº¯Êý
´æ´¢¹ý³ÌºÍº¯ÊýÒ²ÊÇÒ»ÖÖPL/SQL¿é£¬ÊÇ´æÈëÊý¾Ý¿âµÄPL/SQL¿é¡£µ«´æ´¢¹ý³ÌºÍº¯Êý²»Í¬ÓÚÒѾ½éÉܹýµÄPL/SQL³ÌÐò£¬ÎÒÃÇͨ³£°ÑPL/SQL³ÌÐò³ÆΪÎÞÃû¿é£¬¶ø´æ´¢¹ý³ÌºÍº¯ÊýÊÇÒÔÃüÃûµÄ·½Ê½´æ´¢ÓÚÊý¾Ý¿âÖеġ£ºÍPL/SQL³ÌÐòÏà±È£¬´æ´¢¹ý³ÌÓкܶàÓŵ㣬¾ßÌå¹éÄÉÈçÏ£º
* ´æ´¢¹ý³ÌºÍº¯ÊýÒÔÃüÃûµÄÊý¾Ý¿â¶ÔÏóÐÎʽ´æ´¢ÓÚÊý¾Ý¿âµ±ÖС£´æ´¢ÔÚÊý¾Ý¿âÖеÄÓŵãÊǺÜÃ÷ÏԵģ¬ÒòΪ´úÂë²»±£´æÔÚ±¾µØ£¬Óû§¿ÉÒÔÔÚÈκοͻ§»úÉϵǼµ½Êý¾Ý¿â£¬²¢µ÷ÓûòÐ޸ĴúÂë¡£
* ´æ´¢¹ý³ÌºÍº¯Êý¿ÉÓÉÊý¾Ý¿âÌṩ°²È«±£Ö¤£¬ÒªÏëʹÓô洢¹ý³ÌºÍº¯Êý£¬ÐèÒªÓд洢¹ý³ÌºÍº¯ÊýµÄËùÓÐÕßµÄÊÚȨ£¬Ö»Óб»ÊÚȨµÄÓû§»ò´´½¨Õß±¾Éí²ÅÄÜÖ´Ðд洢¹ý³Ì»òµ÷Óú¯Êý¡£
* ´æ´¢¹ý³ÌºÍº¯ÊýµÄÐÅÏ¢ÊÇдÈëÊý¾Ý×ÖµäµÄ£¬ËùÒÔ´æ´¢¹ý³Ì¿ÉÒÔ¿´×÷ÊÇÒ»¸ö¹«ÓÃÄ£¿é£¬Óû§±àдµÄPL/SQL³ÌÐò»òÆäËû´æ´¢¹ý³Ì¶¼¿ÉÒÔµ÷ÓÃËü(µ«´æ´¢¹ý³ÌºÍº¯Êý²»Äܵ÷ÓÃPL/SQL³ÌÐò)¡£Ò»¸öÖظ´Ê¹ÓõŦÄÜ£¬¿ÉÒÔÉè¼Æ³ÉΪ´æ´¢¹ý³Ì£¬±ÈÈ磺ÏÔʾһÕŹ¤×Êͳ¼Æ±í£¬¿ÉÒÔÉè¼Æ³ÉΪ´æ´¢¹ý³Ì£»Ò»¸ö¾³£µ÷ÓõļÆË㣬¿ÉÒÔÉè¼Æ³ÉΪ´æ´¢º¯Êý£»¸ù¾Ý¹ÍÔ±±àºÅ·µ»Ø¹ÍÔ±µÄÐÕÃû£¬¿ÉÒÔÉè¼Æ³É´æ´¢º¯Êý¡£
* ÏñÆäËû¸ß¼¶ÓïÑԵĹý³ÌºÍº¯ÊýÒ»Ñù£¬¿ÉÒÔ´«µÝ²ÎÊý¸ø´æ´¢¹ý³Ì»òº¯Êý£¬²ÎÊýµÄ´«µÝÒ²ÓжàÖÖ·½Ê½¡£´æ´¢¹ý³Ì¿ÉÒÔÓзµ»ØÖµ£¬Ò²¿ÉÒÔûÓзµ»ØÖµ£¬´æ´¢¹ý³ÌµÄ·µ»ØÖµ±ØÐëͨ¹ý²ÎÊý´ø»Ø£»º¯ÊýÓÐÒ»¶¨µÄÊý¾ÝÀàÐÍ£¬ÏñÆäËûµÄ±ê×¼º¯ÊýÒ»Ñù£¬ÎÒÃÇ¿ÉÒÔͨ¹ý¶Ôº¯ÊýÃûµÄµ÷Ó÷µ»Øº¯ÊýÖµ¡£
´æ´¢¹ý³ÌºÍº¯ÊýÐèÒª½øÐбàÒ룬ÒÔÅųýÓï·¨´íÎó£¬Ö»ÓбàÒëͨ¹ý²ÅÄܵ÷Óá£
´´½¨ºÍɾ³ý´æ´¢¹ý³Ì
´´½¨´æ´¢¹ý³Ì£¬ÐèÒªÓÐCREATE PROCEDURE»òCREATE ANY PROCEDUREµÄϵͳȨÏÞ¡£¸ÃȨÏÞ¿ÉÓÉϵͳ¹ÜÀíÔ±ÊÚÓè¡£´´½¨Ò»¸ö´æ´¢¹ý³ÌµÄ»ù±¾Óï¾äÈçÏ£º
CREATE [OR REPLACE] PROCEDURE ´æ´¢¹ý³ÌÃû[(²ÎÊý[IN|OUT|IN OUT] Êý¾ÝÀàÐÍ...)]
{AS|IS}
[˵Ã÷²¿·Ö]
BEGIN
¿ÉÖ´Ðв¿·Ö
[EXCEPTION
´íÎó´¦Àí²¿·Ö]
END [¹ý³ÌÃû];
ÆäÖУº
¿ÉÑ¡¹Ø¼ü×ÖOR REPLACE ±íʾÈç¹û´æ´¢¹ý³ÌÒѾ´æÔÚ£¬ÔòÓÃеĴ洢¹ý³Ì¸²¸Ç£¬Í¨³£ÓÃÓÚ´æ´¢¹ý³ÌµÄÖؽ¨¡£
²ÎÊý²¿·ÖÓÃÓÚ¶¨Òå¶à¸ö²ÎÊý(Èç¹ûûÓвÎÊý£¬¾Í¿ÉÒÔÊ¡ÂÔ)¡£²ÎÊýÓÐÈýÖÖÐÎʽ£ºIN¡¢OUTºÍIN OUT¡£Èç¹ûûÓÐÖ¸Ã÷²ÎÊýµÄÐÎʽ£¬ÔòĬÈÏΪIN¡£
¹Ø¼ü×ÖASÒ²¿ÉÒÔд³ÉIS£¬ºó¸ú¹ý³ÌµÄ˵Ã÷²¿·Ö£¬¿ÉÒÔÔڴ˶¨Òå¹ý³ÌµÄ¾Ö²¿±äÁ¿¡£
±àд´æ´¢¹ý³Ì¿ÉÒÔʹÓÃÈκÎÎı¾±à¼Æ÷»òÖ±½ÓÔÚSQL*Plus»·¾³Ï½øÐУ¬±àдºÃµÄ´æ´¢¹ý³Ì±ØÐëÒªÔÚSQL*Plus»·¾³Ï½øÐбàÒ룬Éú³É±àÒë´úÂë£
Ïà¹ØÎĵµ£º
ÔÚoracle°²×°Ä¿Â¼$HOME/network/adminÏ£¬¾³£¿´µ½sqlnet.ora tnsnames.ora
listener.oraÕâÈý¸öÎļþ£¬³ýÁËtnsnames.ora£¬ÆäËûÁ½¸öÎļþÏêϸµÄÓÃ;ºÜ¶àÈ˶¼²»Ì«Á˽⡣
sqlnet.ora ÓÃÔÚoracle client¶Ë£¬ÓÃÓÚÅäÖÃÁ¬½Ó·þÎñ¶ËoracleµÄÏà¹Ø²ÎÊý.
tnsnames.ora ÓÃÔÚoracle
client¶Ë£¬Óû§ÅäÖÃÁ¬½ÓÊý¾Ý¿âµÄ±ðÃû²ÎÊý,¾ÍÏñÏµÍ³Ö ......
--21.1 Data Pump¹¤¾ß
Data Pump
´Óoracledatabase 10g¿ªÊ¼ÒýÈëÁËdata pump(Êý¾Ý±Ã)¹¤¾ß£¬ËüÌṩÁËÒ»ÖÖ»ùÓÚ·þÎñÆ÷µÄÊý¾Ýµ¼³öµ¼ÈëʹÓóÌÐò¡£
ËùÓеÄdata pump¶¼×÷Ϊһ¸ö·þÎñÆ÷½ø³Ì£¬Êý¾Ý²»ÔÙ±ØÐëÓÉÒ»¸ö¿Í»§³ÌÐò´¦Àí¡£Data Pump¹¤¾ßµÄµ¼³öºÍµ¼ÈëʵÏÖ
OracleÊý¾Ý¿âÖ®¼äÊý¾ÝµÄ´ ......
http://www.oracle.com/technology/global/cn/pub/notes/technote_php_instant.html
Ϊ Linux ºÍ Windows °²×° PHP ºÍ Oracle 10g Instant Client
×÷ÕߣºChristopher Jones£¬¼×¹ÇÎĹ«Ë¾µÄ×Éѯ¼¼ÊõÈËÔ±
·¢²¼ÈÕÆÚ£º2004 Äê 12 ÔÂ
Oracle 10g Instant Client£¨Ãâ·ÑÏÂÔØ£©ÊÇPHP ÓëÔ¶³Ì Oracle Êý¾Ý¿âÁ¬½ÓµÄ×î¼òµ¥·½Ê½£¬Ëü ......
Oracle³£Ó÷ÖÎöº¯Êý
ROW_NUMBER
·µ»ØÓÐÐò×éÖÐÒ»ÐеÄÆ«ÒÆÁ¿£¬´Ó¶ø¿ÉÓÃÓÚ°´Ìض¨±ê×¼ÅÅÐòµÄÐкÅ
row_number() over(partition by ... order by ...)
RANK
¸ù¾ÝORDER BY×Ó¾äÖбí´ïʽµÄÖµ£¬´Ó²éѯ·µ»ØµÄÿһÐУ¬¼ÆËãËüÃÇÓëÆäËüÐеÄÏà¶ÔλÖá£×éÄÚµÄÊý¾Ý°´ORDER BY×Ó¾äÅÅÐò£¬È»ºó¸øÿһÐи³Ò»¸öºÅ£¬´Ó¶øÐγÉÒ»¸öÐòÁУ¬¸ÃÐòÁ ......
Ò»¡¢
´ò¿ª¿ØÖÆ̨£º
´ò¿ª http://localhost
:7001/console
£¬Æô¶¯¹ÜÀí¿ØÖÆ̨¡£ÊäÈë¹ÜÀíÔ±Óû§ÃûºÍÃÜÂ루ĬÈÏ£ºweblogic/weblogic£©¡£
¶þ¡¢´´½¨
JDBCÊý¾ÝÔ´£º
1¡¢
µ¥»÷“Ëø¶¨²¢±à¼
”°´Å¥£»
2¡¢
ÔÚ“Óò½á¹¹
”Ê÷ÖУ¬Õ¹¿ª“·þ
Îñ”>“JDBC”
£¬È»ºóÑ¡Ôñ“Ê ......