¡¾×ª¡¿ OracleÈ«¾ÖË÷ÒýºÍ±¾µØË÷Òý
OracleË÷Òý·ÖÇøÔÓ̸
<> OracleÊý¾Ý¿âÖУ¬ÓÐÁ½ÖÖÀàÐ͵ķÖÇøË÷Òý£¬È«¾ÖË÷ÒýºÍ±¾µØË÷Òý£¬ÆäÖб¾µØË÷ÒýÓÖ¿ÉÒÔ·ÖΪ±¾µØǰ׺Ë÷ÒýºÍ±¾µØ·Çǰ׺Ë÷Òý¡£ÏÂÃæ¾Í·Ö±ð¿´¿´Ã¿ÖÖÀàÐ͵ÄË÷Òý¸÷×ÔµÄÌص㡣
È«¾ÖË÷ÒýÒÔÕû¸ö±íµÄÊý¾ÝΪ¶ÔÏó½¨Á¢Ë÷Òý£¬Ë÷Òý·ÖÇøÖеÄË÷ÒýÌõÄ¿¼È¿ÉÄÜÊÇ»ùÓÚÏàͬµÄ¼üÖµµ«ÊÇÀ´×Ô²»Í¬µÄ·ÖÇø£¬Ò²¿ÉÄÜÊǶà¸ö²»Í¬¼üÖµµÄ×éºÏ¡£
È«¾ÖË÷Òý¼ÈÔÊÐíË÷Òý·ÖÇøµÄ¼üÖµºÍ±í·ÖÇø¼üÖµÏàͬ£¬Ò²¿ÉÒÔ²»Ïàͬ¡£È«¾ÖË÷ÒýºÍ±íÖ®¼äûÓÐÖ±½ÓµÄÁªÏµ£¬ÕâÒ»µãºÍ±¾µØË÷Òý²»Í¬¡£
SQL> create table orders (
order_no number,
part_no varchar2(40),
ord_date date
)
partition by range (ord_date)
(partition Q1 values less than (TO_DATE('01-APR-1999','DD-MON-YYYY')),
partition Q2 values less than (TO_DATE('01-JUL-1999','DD-MON-YYYY')),
partition Q3 values less than (TO_DATE('01-OCT-1999','DD-MON-YYYY')),
partition Q4 values less than (TO_DATE('01-JAN-2000','DD-MON-YYYY'))
)
;
Table created.
SQL> create index orders_global_1_idx
on orders(ord_date)
global partition by range (ord_date)
(partition GLOBAL1 values less than (TO_DATE('01-APR-1999','DD-MON-YYYY')),
partition GLOBAL2 values less than (TO_DATE('01-JUL-1999','DD-MON-YYYY')),
partition GLOBAL3 values less than (TO_DATE('01-OCT-1999','DD-MON-YYYY')),
partition GLOBAL4 values less than (MAXVALUE)
)
;
Index created.
SQL> create index orders_global_2_idx
&n
Ïà¹ØÎĵµ£º
ʹØCUBE ROLLUP GROUPING SETS£¨1£©
ÔÎÄÒý×Ô£º ¾ÛºÏÊÇÊý¾Ý²Ö¿âµÄ»ù´¡¡£ÎªÁËÌá¸ß¾ÛºÏµÄÐÔÄÜ¡£OracleÌṩÁËGroup By Ìõ¿îµÄÀ©Õ¹¡£
1£® CUBE, ROLLUPÀ©Õ¹
2£® 3¸ögroupingº¯Êý
3£® Grouping setÀ©Õ¹
CUBE ROLLUP ......
ÔÚOracleÖеÄÊ÷ÐβÙ×÷
1.È¡×ӽڵ㼰·¾¶(ÕýÊ÷):
select t.id ,t.code, t.name ,t.pid
,SYS_CONNECT_BY_PATH(t.id,'.')||'.' as IdPath
from tas_catalog t
--where id!=110
start with id=110
connect by pid = prior id
order siblings by id
2.È¡¸÷¼¶¸¸½Úµã(µ¹Ê÷)£º
select t.id ,t.code, t.na ......
²é¿´ÕýÔÚÖ´ÐеÄsqlÓï¾ä
SELECT osuser, username, sql_text from v$session a, v$sqltext b where a.sql_address =b.address order by address, piece;
²¶×½ÔËÐкܾõÄSQL
select username,sid,opname, round(sofar*100 / totalwork,0) || '%' as progress, time_remaining,sql_text from v$session_longops , v$ ......
oracle Óαê
¹Ø¼ü×Ö: oracle Óαê
1. Óαê: ÈÝÆ÷£¬´æ´¢SQLÓï¾äÓ°ÏìÐÐÊý¡£
2. ÓαêÀàÐÍ: ÒþʽÓα꣬ÏÔʾÓα꣬REFÓαꡣÆäÖУ¬ÒþʽÓαêºÍÏÔʾÓαêÊôÓÚ¾²Ì¬Óα꣨ÔËÐÐÇ°½«ÓαêÓëSQLÓï¾ä¹ØÁª£©,REFÓαêÊôÓÚ¶¯Ì¬Óαê(ÔËÐÐʱ½«ÓαêÓëSQLÓï¾ä¹ØÁª)¡ ......
1¡¢OracleµÄPackage³ýÁË°Ñ´æ´¢¹ý³Ì·Åµ½Ò»¶Ñ¶ùÒÔÍ⻹ÓÐûÓÐÆäËûµÄ×÷Ó㨺ô¦£©£¿
2¡¢ÈçºÎ°ÑÏÖÓеĴ洢¹ý³Ì¼ÓÈëµ½PackageÖУ¿
3¡¢³ýÁËʹÓÃSQL Plus£¬»¹ÓÐûÓÐʲô¹¤¾ß×öPackage?
4¡¢Ê¹ÓÃSQL Plus±àÒëPackage£¬ÊÇ·ñÿ´Î¶¼ÊDZàÒëPackageÖÐËùÓеĴ洢¹ý³Ì£¿
1¡¢Äã²»¾õµÃ°Ñ´æ´¢¹ý³Ì·ÖÃűðÀàÊǺÜÖØÒªµÄô£¬¶øÇÒ²»Í¬µÄpackageµÄ ......