ÔÚORACLEÀïÈç¹ûÓöµ½Ìرð´óµÄ±í£¬¿ÉÒÔʹÓ÷ÖÇøµÄ±íÀ´¸Ä±äÆäÓ¦ÓóÌÐòµÄÐÔÄÜ¡£
1.1 ·ÖÇø±íPARTITION table
ÔÚORACLEÀïÈç¹ûÓöµ½Ìرð´óµÄ±í£¬¿ÉÒÔʹÓ÷ÖÇøµÄ±íÀ´¸Ä±äÆäÓ¦ÓóÌÐòµÄÐÔÄÜ¡£
1.1.1 ·ÖÇø±íµÄ½¨Á¢£º
ij¹«Ë¾µÄÿÄê²úÉú¾Þ´óµÄÏúÊۼǼ£¬DBAÏò¹«Ë¾½¨Òéÿ¼¾¶ÈµÄÊý¾Ý·ÅÔÚÒ»¸ö·ÖÇøÄÚ£¬ÒÔÏÂʾ·¶µÄÊǸù«Ë¾1999ÄêµÄÊý¾Ý(¼ÙÉèÿÔ²úÉú30MµÄÊý¾Ý)£¬²Ù×÷ÈçÏ£º
·¶Î§·ÖÇø±í£º
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_q2
VALUES LESS THAN (TO_DATE(‘1999-07-01','YYYY-MM-DD')
TABLESPACE ts_sale1999q2,
PARTITION sales1999_q3
VALUES LESS THAN (TO_DATE(‘1999-10-01','YYYY-MM-DD')
TABLESPACE ts_sale1999q3,
PARTITION sales1999_q4
VALUES LESS THAN (TO_DATE(‘2000-01-01','YYYY-MM-DD')
TABLESPACE ts_sale1999q4 );
--values less than (maxvalue)
Áбí·ÖÇø±í£º
create table emp (
empno number(4),
ename varchar2(30),
location varchar2(30))
partition by list (location)
(partition p1 values ('±±¾©'),
partition p2 values ('ÉϺ£','Ìì½ò','ÖØÇì'),
partition p3 values ('¹ã¶«','¸£½¨')
partition p0 values (default)
);
¹þÏ£·ÖÇø£º
create table emp (
empno number(4),
ename varchar2(30),
sal number)
partition by hash (empno)
partitions 8
store in (emp1,emp2,emp3,emp4,emp5,emp6,emp7,emp8);
×éºÏ·ÖÇø£º
·¶Î§¹þÏ£×éºÏ·ÖÇø£º
create table emp (
empno number(4),
ename varchar2(30),
hiredate date)
partition by range (hiredate)
subpartition by hash (empno)
subpartitions 2
(partition e1 values less than (to_date('20020501','YYYYMMDD')),
partition e2 values less than (to_date('20021001','YYYYMMDD')),
partition e3 values less than (maxvalue));
·¶Î§Áбí×éºÏ·ÖÇø£º
CREATE TABLE customers_part (
customer_id NUMBER(6),
cust_first_name VARCHAR2(20),
cust_last_name VARCHAR2(20),
nls_territory VARCHAR2(30),
credit_limit NUMBER(9,2))
PARTITION BY RANGE (credit_limit)
SUBPARTITION BY LIST (nls
Òò¿ª·¢ÒªÇó£¬ÐèÒª¶ÔoracleÀïµÄÊý¾ÝÓëÊý¾ÝÎļþ×÷±È½Ï¡£Èç²ÉÓÿͻ§¶ËÁ¬½ÓoracleµÄ·½Ê½ÔòÏÔµÃСÌâ´ó×ö£¬ÇÒ¹¤×÷Á¿´ó£¬²»Ò×ά»¤¡£Ö±½Ó²ÉÓô洢¹ý³Ì£¬µ÷ÓÃUTL_FILE°üµÄ¹«¹²¹ý³Ì£¬ÏԵ÷½±ãµÃ¶à¡£
Ê×ÏÈ£¬ÐèÒª°ÑÊý¾ÝÎļþËùÔÚµÄĿ¼ע²áµ½oracleÖУ¬ÓÃcreate directory¡£¡£¡£Óï¾ä£¬È»ºó°Ñ´ËÄ¿ ......
OracleµÄsql*plusÊÇÓëoracle½øÐн»»¥µÄ¿Í»§¶Ë¹¤¾ß¡£ÔÚsql*plusÖУ¬¿ÉÒÔÔËÐÐsql*plusÃüÁîÓësql*plusÓï¾ä¡£
ÎÒÃÇͨ³£Ëù˵µÄDML¡¢DDL¡¢DCLÓï¾ä¶¼ÊÇsql*plusÓï¾ä£¬ËüÃÇÖ´ÐÐÍêºó£¬¶¼¿ÉÒÔ±£´æÔÚÒ»¸ö±»³ÆΪsql bufferµÄÄÚ´æÇøÓòÖУ¬²¢ÇÒÖ»Äܱ£´æÒ»Ìõ×î½üÖ´ÐеÄsqlÓï¾ä£¬ÎÒÃÇ¿ÉÒÔ¶Ô±£´æÔÚsql bufferÖеÄsql Óï¾ä½øÐÐÐ޸ģ¬È»ºóÔÙ´ ......