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

oracle¿ª·¢ÖªÊ¶µã

1. ·ÖÇø±í
   
Oracle
½¨ÒéÈç¹ûµ¥¸ö±í³¬¹ý2G¾Í×îºÃ¶ÔÆä½øÐзÖÇø¡£
¶Ô´ó±íµÄ²éѯ¡¢Ôö¼Ó¡¢Ð޸ĵȲÙ×÷¿ÉÒԷֽ⵽±íµÄ²»Í¬·ÖÇøÀ´²¢ÐÐÖ´ÐУ¬¿ÉʹÔËÐÐËٶȸü¿ì£»
    1)
Range·ÖÇø
¡¡¡¡Range·ÖÇøÄØÊÇÓ¦Ó÷¶Î§±È½Ï¹ãµÄ±í·ÖÇø·½Ê½£¬ËüÊÇÒÔÁеÄÖµµÄ·¶Î§À´×öΪ·ÖÇøµÄ»®·ÖÌõ¼þ£¬½«¼Ç¼´æ·Åµ½ÁÐÖµËù
ÔÚµÄrange·ÖÇøÖУ¬±ÈÈç°´ÕÕʱ¼ä»®·Ö£¬2008Äê1¼¾¶ÈµÄÊý¾Ý·Åµ½a·ÖÇø£¬08Äê2¼¾¶ÈµÄÊý¾Ý·Åµ½b·ÖÇø£¬Òò´ËÔÚ´´½¨µÄʱºòÄØ£¬ÐèÒªÄãÖ¸¶¨»ùÓÚµÄÁУ¬
ÒÔ¼°·ÖÇøµÄ·¶Î§Öµ£¬Èç¹ûijЩ¼Ç¼ÔÝÎÞ·¨Ô¤²â·¶Î§£¬¿ÉÒÔ´´½¨maxvalue·ÖÇø£¬ËùÓв»ÔÚÖ¸¶¨·¶Î§ÄڵļǼ¶¼»á±»´æ´¢µ½maxvalueËùÔÚ·ÖÇøÖУ¬²¢ÇÒ
Ö§³ÖÖ¸¶¨¶àÁÐ×öΪÒÀÀµÁÐ
CREATE TABLE sales
(invoice_no NUMBER,
...
sale_date DATE NOT NULL )
PARTITION BY RANGE (sale_date)
(PARTITION sales1999_q1
VALUES LESS THAN (TO_DATE(‘1999-04-01’,’YYYY-MM-DD’)
TABLESPACE ts_sale1999q1,
...
PARTITION sales1999_q4
VALUES LESS THAN (TO_DATE(‘2000-01-01’,’YYYY-MM-DD’)
TABLESPACE ts_sale1999q4 );
--values less than (maxvalue)
  
     2)
Hash·ÖÇø
¡¡¡¡Í¨³£ÄØ£¬¶ÔÓÚÄÇЩÎÞ·¨ÓÐЧ»®·Ö·¶Î§µÄ±í£¬¿ÉÒÔʹÓÃhash·ÖÇø£¬ÕâÑù¶ÔÓÚÌá¸ßÐÔÄÜ»¹ÊÇ»áÓÐÒ»¶¨µÄ°ïÖú¡£hash
·ÖÇø»á½«±íÖеÄÊý¾Ýƽ¾ù·ÖÅäµ½ÄãÖ¸¶¨µÄ¼¸¸ö·ÖÇøÖУ¬ÁÐËùÔÚ·ÖÇøÊÇÒÀ¾Ý·ÖÇøÁеÄhashÖµ×Ô¶¯·ÖÅ䣬Òò´ËÄã²¢²»ÄÜ¿ØÖÆÒ²²»ÖªµÀÄÄÌõ¼Ç¼»á±»·Åµ½Äĸö·ÖÇø
ÖУ¬hash·ÖÇøÒ²¿ÉÒÔÖ§³Ö¶à¸öÒÀÀµÁС£
create table emp (
empno number(4),
...,
sal number)
partition by hash (empno)
(
PARTITION PART01 TABLESPACE HASH_TS01,
 PARTITION PART02 TABLESPACE HASH_TS02,
 PARTITION PART03 TABLESPACE HASH_TS03 
)
     3)
List·ÖÇø
    
ÄãÄÜ¿ØÖƼǼ´æ´¢ÔÚÄĸö·ÖÇø¡£ËüµÄ·ÖÇøÁÐÖ»ÄÜÓÐÒ»¸ö
£¬Òª´´½¨Ò»¸ödefault·ÖÇø´æ´¢ÄÇЩ²»ÔÚÖ¸¶¨·¶Î§ÄڵļǼ¡£     
create table emp (
empno number(4),
...,
location varchar2(30))
partition by list (location)
(partition p1 values ('±±¾©')  TABLESPACE PROB_TS01,
partition p2 values ('ÉϺ£','Ìì½ò','ÖØÇì')  TABLESPACE PROB_TS02,
partition p3 values ('¹ã¶«


Ïà¹ØÎĵµ£º

oracleÖ®createÓ÷¨


create  database  --´´½¨Êý¾Ý¿â
create database test
controlfile reuse
datafile 'd:\data\system1.dbf' size 100m  autoextend on next 100m maxsize unlimited
sysaux datafile 'd:\data\sysaux1.dbf' size 100m reuse autoextend on next 100m maxsize unlimited
default temp ......

oracleÍü¼Çsys¡¢systemÃÜÂë½â¾ö

Õâ¸öÆäʵºÜ¼òµ¥£¬²»¹ý×Ô¼º¾­³£Íü¼Ç£¬ËùÒÔ¼ÇÏÂÀ´
    sqlplus /nolog£»
    connect / as sysdba
    alter user sys identified by password£»
    alter user system identified by  password£» ......

oracleº¯Êý´óÈ« ×Ö·û´¦Àíº¯Êý

F.1×Ö·ûº¯Êý——·µ»Ø×Ö·ûÖµ
ÕâЩº¯ÊýÈ«¶¼½ÓÊÕµÄÊÇ×Ö·û×åÀàÐ͵IJÎÊý(CHR³ýÍâ)²¢ÇÒ·µ»Ø×Ö·ûÖµ.³ýÁËÌرð˵Ã÷µÄÖ®Íâ,ÕâЩº¯Êý´ó²¿·Ö·µ»ØVARCHAR2ÀàÐ͵ÄÊýÖµ.×Ö·ûº¯ÊýµÄ·µ»ØÀàÐÍËùÊܵÄÏÞÖƺͻù±¾Êý¾Ý¿âÀàÐÍËùÊܵÄÏÞÖÆÊÇÏàͬµÄ,±ÈÈç: VARCHAR2ÊýÖµ±»ÏÞÖÆΪ2000×Ö·û(ORACLE 8ÖÐΪ4000×Ö·û),¶øCHARÊýÖµ±»ÏÞÖÆΪ255×Ö·û(Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ