oracle µÝ¹é
sqlÓï¾ä£º
select bid from t_branch c start with c.upbid ='11000000' connect by prior c.bid=c.upbid
˵Ã÷£º
1¡¢Í³¼Æij¸ö»ú¹¹ÏÂËùÓеÄ×ÓËï»ú¹¹¡£Èçͳ¼Æ±±¾©»ú¹¹ÏµÄ×ÓËï»ú¹¹£¬°üÀ¨£º³¯ÑôÇø»ú¹¹¡¢º£µíÓªÏú»ú¹¹¡¢¡¢¡¢ÇàÁúÇÅÏç»ú¹¹¡¢¡¢¡¢¡¢Ò»Ö±µ½×îµ×²ãµÄ»ú¹¹¡£
2¡¢upbidÊÇÖ¸Éϼ¶»ú¹¹µÄID¡£º£µíÇø»ú¹¹ID(bid)µÄÉϼ¶»ú¹¹ID(upbid)Ϊ11000000£¬Ò²¾Í˵ֱ½ÓËùÊôµÄ»ú¹¹ÎªÖ±½Ó»ú¹¹¡£ÇàÁúÇÅ»ú¹¹µÄÉϼ¶»ú¹¹Îªº£µíÇø»ú¹¹¡£
3¡¢connect by prior ΪoracleµÝ¹é·½·¨¡£
Ïà¹Ø֪ʶ£º
OracleÖÐstart with...connect by prior×Ó¾äÓ÷¨ connect by Êǽṹ»¯²éѯÖÐÓõ½µÄ£¬Æä»ù±¾Óï·¨ÊÇ£º
select ... from tablename start with Ìõ¼þ1
connect by Ìõ¼þ2
where Ìõ¼þ3;
Àý£º
select * from table
start with org_id = 'HBHqfWGWPy'
connect by prior org_id = parent_id;
¼òµ¥ËµÀ´Êǽ«Ò»¸öÊ÷×´½á¹¹´æ´¢ÔÚÒ»ÕűíÀ±ÈÈçÒ»¸ö±íÖдæÔÚÁ½¸ö×Ö¶Î:
org_id,parent_idÄÇôͨ¹ý±íʾÿһÌõ¼Ç¼µÄparentÊÇË£¬¾Í¿ÉÒÔÐγÉÒ»¸öÊ÷×´½á¹¹¡£
ÓÃÉÏÊöÓï·¨µÄ²éѯ¿ÉÒÔÈ¡µÃÕâ¿ÃÊ÷µÄËùÓмǼ¡£
ÆäÖУº
Ìõ¼þ1 ÊǸù½áµãµÄÏÞ¶¨Óï¾ä£¬µ±È»¿ÉÒÔ·Å¿íÏÞ¶¨Ìõ¼þ£¬ÒÔÈ¡µÃ¶à¸ö¸ù½áµã£¬Êµ¼Ê¾ÍÊǶà¿ÃÊ÷¡£
Ìõ¼þ2 ÊÇÁ¬½ÓÌõ¼þ£¬ÆäÖÐÓÃPRIOR±íʾÉÏÒ»Ìõ¼Ç¼£¬±ÈÈç CONNECT BY PRIOR org_id = parent_id¾ÍÊÇ˵ÉÏÒ»Ìõ¼Ç¼µÄorg_id ÊDZ¾Ìõ¼Ç¼µÄparent_id£¬¼´±¾¼Ç¼µÄ¸¸Ç×ÊÇÉÏÒ»Ìõ¼Ç¼¡£
Ìõ¼þ3 ÊǹýÂËÌõ¼þ£¬ÓÃÓÚ¶Ô·µ»ØµÄËùÓмǼ½øÐйýÂË¡£
¼òµ¥½éÉÜÈçÏ£º
ÔçɨÃèÊ÷½á¹¹±íʱ£¬ÐèÒªÒÀ´Ë·ÃÎÊÊ÷½á¹¹µÄÿ¸ö½Úµã£¬Ò»¸ö½ÚµãÖ»ÄÜ·ÃÎÊÒ»´Î£¬Æä·ÃÎʵIJ½ÖèÈçÏ£º
µÚÒ»²½£º´Ó¸ù½Úµã¿ªÊ¼£»
µÚ¶þ²½£º·ÃÎʸýڵ㣻
µÚÈý²½£ºÅжϸýڵãÓÐÎÞδ±»·ÃÎʵÄ×ӽڵ㣬ÈôÓУ¬ÔòתÏòËü×î×ó²àµÄδ±»·ÃÎʵÄ×Ó½Ú£¬²¢Ö´Ðеڶþ²½£¬·ñÔòÖ´ÐеÚËIJ½£»
µÚËIJ½£ºÈô¸Ã½ÚµãΪ¸ù½Úµã£¬Ôò·ÃÎÊÍê±Ï£¬·ñÔòÖ´ÐеÚÎå²½£»
µÚÎå²½£º·µ»Øµ½¸Ã½ÚµãµÄ¸¸½Úµã£¬²¢Ö´ÐеÚÈý²½Öè¡£
×ÜÖ®£ºÉ¨ÃèÕû¸öÊ÷½á¹¹µÄ¹ý³ÌÒ²¼´ÊÇÖÐÐò±éÀúÊ÷µÄ¹ý³Ì¡£
Ïà¹ØÎĵµ£º
½«±í¿Õ¼äºÍÊý¾ÝÎļþ´ÓÒ»¸öλÖÃÒƶ¯µ½ÁíÒ»¸öλÖõIJÙ×÷·½·¨
Ò»£® OFFLINE
OFFLINE ·ÖΪALTER DATABASE Óë ALTER TABLESPACE OFFLINE£¬
ËûÃǵÄÇø±ð²Î¿´blog£ºhttp://blog.csdn.net/tianlesoftware/archive/2009/11/29/4898800.aspx
°´Êý¾ÝÎļþÀ´£º
1.ÏȽ«ÏàÓ¦µÄÊý¾ÝÎļþ offl ......
IDÊÇÖ÷½¡£¬ÊµÏÖ²åÈëÒ»¸öNAME,ID×Ô¶¯Ôö¼Ó
SQL> create table t1
2 (
3 id & ......
SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;
A A ZERO ......
ÔÎĵØÖ·£ºhttp://blog.csdn.net/cnham/archive/2009/08/30/4500928.aspx
oracleµÄ·ÖÎöº¯Êýover ¼°¿ª´°º¯Êý
Ò»£º·ÖÎöº¯Êýover
Oracle´Ó8.1.6¿ªÊ¼Ìṩ·ÖÎöº¯Êý£¬·ÖÎöº¯ÊýÓÃÓÚ¼ÆËã»ùÓÚ×éµÄijÖÖ¾ÛºÏÖµ£¬ËüºÍ¾ÛºÏº¯ÊýµÄ²»Í¬Ö®´¦ÊÇ
¶ÔÓÚÿ¸ö×é·µ»Ø¶àÐУ¬¶ø¾ÛºÏº¯Êý¶ÔÓÚÿ¸ö×éÖ»·µ»ØÒ»ÐС£
ÏÂÃæͨ¹ý¼¸¸öÀý×ÓÀ´ËµÃ÷ÆäÓ ......
ÏÖÏó£º
oracleÆô¶¯¼àÌý£¬±¨¸æÈçÏ´íÎó£º
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
Linux Error: 32: Broken pipe
ÔÒò£º
lisenter.log ÎļþÌ«´óÁË,OracleÎÞ·¨¶ÔËü½øÐвÙ×÷ÁË£¬µ¼ÖÂlistenerÎÞ·¨Õý³£Æô¶¯¡£
listener.log ³¬¹ý2G¾Í»á³öÎÊÌâ
·½·¨£º
·¨1. ÒƳýÔ$ ......