¡¾×ª¡¿ ORACLE±í·ÖÇøÒÔ¼°ÐÅÏ¢²éÕÒ
ORACLE±í·ÖÇøÒÔ¼°ÐÅÏ¢²éÕÒ
http://www.sysab.cn/a/db/oracle/2009/1020/2433.html
·ÖÇø¸ÅÊö ΪÁ˼ò»¯Êý¾Ý¿â´ó±íµÄ¹ÜÀí,ÀýÈçÔÚÊý¾Ý²Ö¿âÖÐÒ»°ã¶¼ÊÇTB¼¶µÄÊýÁ¿¼¶.ORACLE8ÒÔºóÍƳöÁË·ÖÇøÑ¡Ïî.·ÖÇø½«±í·ÖÀëÔÚÈôÓÚ²»Í¬µÄ±í¿Õ¼äÉÏ,Ó÷ֶøÖÎÖ®µÄ·½·¨À´Ö§³ÅÔªÏÞÅòÕ͵Ĵó±í,×é´ó±íÔÚÎïÀíÒ»¼¶µÄ¿É¹ÜÀíÐÔ.½«´ó±í·Ö¸î³É½ÏСµÄ·ÖÇø¿ÉÒÔ¸ÄÉƱíµÄά»¤¡¢±¸·Ý
·ÖÇø¸ÅÊö
ΪÁ˼ò»¯Êý¾Ý¿â´ó±íµÄ¹ÜÀí,ÀýÈçÔÚÊý¾Ý²Ö¿âÖÐÒ»°ã¶¼ÊÇTB¼¶µÄÊýÁ¿¼¶.ORACLE8ÒÔºóÍƳöÁË·ÖÇøÑ¡Ïî.·ÖÇø½«±í·ÖÀëÔÚÈôÓÚ²»Í¬µÄ±í¿Õ¼äÉÏ,Ó÷ֶøÖÎÖ®µÄ·½·¨À´Ö§³ÅÔªÏÞÅòÕ͵Ĵó±í,×é´ó±íÔÚÎïÀíÒ»¼¶µÄ¿É¹ÜÀíÐÔ.½«´ó±í·Ö¸î³É½ÏСµÄ·ÖÇø¿ÉÒÔ¸ÄÉƱíµÄά»¤¡¢±¸·Ý¡¢»Ö¸´¡¢ÊÂÎñ¼°²éѯÐÔÄÜ¡£
·ÖÇøµÄÓŵ㣺
1¡¢ ÔöÇ¿¿ÉÓÃÐÔ£ºÈç¹û±íµÄÒ»¸ö·ÖÇøÓÉÓÚϵͳ¹ÊÕ϶ø²»ÄÜʹÓ㬱íµÄÆäÓàºÃµÄ·ÖÇøÈÔ¿ÉÒÔʹÓã»
2¡¢ ¼õÉٹرÕʱ¼ä£ºÈç¹ûϵͳ¹ÊÕÏÖ»Ó°Ïì±íµÄÒ»²¿·Ý·ÖÇø£¬ÄÇôֻÓÐÕⲿ·Ý·ÖÇøÐèÒªÐÞ¸´£¬¿óÄܱÈÕû¸ö´ó±íÐÞ¸´»¨µÄʱ¼ä¸üÉÙ£»
3¡¢ ά»¤ÇáËÉ£ºÈç¹ûÐèÒªµÃ½¨±í£¬¶À²ú¹ÜÀíÿ¸ö¹«Çø±È¹ÜÀíµ¥¸ö´ó±íÒªÇáËɵöࣻ
4¡¢ ¾ùºâI/O£º¿ÉÒ԰ѱíµÄ²»Í¬·ÖÇø·ÖÅäµ½²»Í¬µÄ´ÅÅÌÀ´Æ½ºâI/O¸ÄÉÆÐÔÄÜ£»
5¡¢ ¸ÄÉÆÐÔÄÜ£º¶Ô´ó±íµÄ²éѯ¡¢Ôö¼Ó¡¢Ð޸ĵȲÙ×÷¿ÉÒԷֽ⵽±íµÄ²»Í¬·ÖÇøÀ´²¢ÐÐÖ´ÐУ¬¿ÉʹÔËÐÐËٶȸü¿ì£¬ÔÚÊý¾Ý²Ö¿âµÄTP²éѯÌرðÓÐÓá£
6¡¢ ·ÖÇø¶ÔÓû§Í¸Ã÷£¬×îÖÕÓû§¸Ð¾õ²»µ½·ÖÇøµÄ´æÔÚ¡£
create tablespace dw1
datafile 'D:\oracle\oradata\ora9\dw11.ora' size 50M
create tablespace dw2
datafile 'D:\oracle\oradata\ora9\dw21.ora' size 50M
Ò»¡¢°´·¶Î§·ÖÇø£º¹ÌÃû˼Òå¾ÍÊÇ°´Ò»¶¨rangeÀ´·ÖÇø£¬¿´ÏÂÃæµÄÀý×Ó:
SQL> set linesize 1000
SQL> create table niegc_part
2 (
3 part_id integer primary key,
4 part_date date,
5 part_dec varchar2(100)
6 )
7 partition by range(part_date)
8 (
9 partition part_01 values less than(to_date('2006-01-01','yyyy-mm-dd')) tablespace dw1,
10 partition part_02 values less than(to_date('2007-01-01','yyyy-mm-dd')) tablespace dw2,
11 partition part_03 values less than(maxvalue) tablespace dw1
12 );
±íÒÑ´´½¨¡£
SQL>
SQL> insert into niegc_part values(1,to_date('2005-12-30','yyyy-mm-dd'),'less 20
06-01-01');
ÒÑ´´½¨ 1 ÐС£
SQL> commit;
Ìá½»Íê³É¡£
SQL> insert into niegc_part values(2,to_date('2
Ïà¹ØÎĵµ£º
1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
²ÎÊý1 IN NUMBER,
²ÎÊý2 IN NUMBER
) IS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
2.SELECT INTO STATEMENT
½«select²éѯµÄ½á¹û´æÈëµ½±äÁ¿ÖУ¬¿ÉÒÔͬʱ½«¶à¸öÁд洢¶à¸ö±äÁ¿ÖУ¬±ØÐëÓÐÒ»Ì ......
OracleÖеÄÐòÁкŹËÃû˼Òå¾ÍÊÇ´´½¨Ò»¸öÐòÁкţ¬¿ÉÒÔÔÚ²åÈë»òÕ߸üеÄʱºòµ÷Óã¬Ï൱ÓÚÊÇÒ»¸öÉú³ÉÆ÷
´´½¨Óï·¨£º
create sequence myse
increment by 1 --Ôö³¤¶È
start with
1 --´ÓÄÄÀïÔö¼Ó£¬¾ÍÊÇ˵ÏÂÒ»¸ö»ñÈ¡µÄÖµ´ÓÕâ¸öÖµ ......
oracle ±í½á¹¹µÄÐÞ¸Ä
½ñÌì×ܽáϹØÓÚ±íµÄÐÞ¸Ä,·ÀÖ¹ÒÔºóÍü¼Ç,ºÃ¼ÇÐÔ²»ÈçÀñÊÍ·Âð!!!
¸ü¸Ä±íµÄ½á¹¹
1.±à¼±íµÄ×Ö¶Î
ÐÞ¸ÄÒ»¸öÁеÄÊý¾ÝÀàÐÍ(Ò»°ãÏÞÓÚÐ޸ij¤¶È£¬ÐÞ¸ÄΪһ¸ö²»Í¬ÀàÐÍʱÓÐÖî¶àÏÞÖÆ):
Óï·¨:
ALTER TABLE ±íÃû MODIFY(ÁÐÃû Êý¾ÝÀàÐÍ);
eg1:
alter table ......
Íâ¼üÔ¼Êø±£Ö¤²ÎÕÕÍêÕûÐÔ¡£Íâ¼üÔ¼ÊøÏÞ¶¨ÁËÒ»¸öÁеÄÈ¡Öµ·¶Î§¡£Ò»¸öÀý×Ó¾ÍÊÇÏÞ¶¨ÖÝÃûËõдÔÚÒ»¸öÓÐÏÞÖµ¼¯ºÏÖУ¬Õâ¸öÖµ¼¯ºÏÊÇÁíÍâÒ»¸ö¿ØÖƽṹ——Ò»ÕŸ¸±í
ÏÂÃæÎÒÃÇ´´½¨Ò»ÕŲÎÕÕ±í£¬ËüÌṩÁËÍêÕûµÄÖÝËõдÁÐ±í£¬È»ºóʹÓòÎÕÕÍêÕûÐÔÈ·±£Ñ§ÉúÃÇÓÐÕýÈ·µÄÖÝËõд¡£µÚÒ»ÕűíÊÇÖݲÎÕÕ±í£¬State×÷Ϊ ......
Á©Ì¨²»Í¬µÄÊý¾Ý¿â·þÎñÆ÷£¬´Óһ̨Êý¾Ý¿â·þÎñÆ÷µÄÒ»¸öÓû§¶ÁÈ¡Áíһ̨Êý¾Ý¿â·þÎñÆ÷ϵÄij¸öÓû§µÄÊý¾Ý£¬Õâ¸öʱºò¿ÉÒÔʹÓÃdblink¡£
ÆäʵdblinkºÍÊý¾Ý¿âÖеÄview²î²»¶à£¬½¨dblinkµÄʱºòÐèÒªÖªµÀ´ý¶ÁÈ¡Êý¾Ý¿âµÄipµØÖ·£¬ssidÒÔ¼°Êý¾Ý¿âÓû§ÃûºÍÃÜÂë¡£
´´½¨¿ÉÒÔ ......