Oracle 분할 공략 (1)
우선, Oracle 의 표 공간 생 성과 표 생 성 을 되 돌아 봅 니 다.
--     
create tablespace user_temp  
tempfile 'D:\oracle\oradata\Oracle9i\user_temp1.dbf'size 50m,
	 'D:\oracle\oradata\Oracle9i\user_temp1.dbf'size 50m   --           ,    
autoextend on    --      
next 50m maxsize 20480m  --      ,        
extent management local
;
--   
create table X_SMALL_AREA  
(  
  SMALL_AREA_ID NUMBER(10) not null  
)  
tablespace TBSL_SDDQ --  X_SMALL_AREA     TBSL_SDDQ 
  pctfree 10 --           10%                 80                
   --         10%                                
  initrans 1 --         
  maxtrans 255 --                    
  storage --    
  (  
  initial 64k --  (extent)    64k
  minextents 1 --     
  maxextents unlimited --         
  ); 
  표 공간 과 표 가 다 만 들 어 졌 으 니 본 격 적 으로 우리 의 분 구 공략 을 시작 해 야 한다.
범위 구분:
drop table DEPT_RNG;
CREATE TABLE DEPT_RNG
(DEPTNO NUMBER(2),
 DEPTNAME  VARCHAR2(30))
 PARTITION BY RANGE(DEPTNO)
      (PARTITION D1 VALUES   LESS THAN (10) tablespace ts1,
       PARTITION D2 VALUES   LESS THAN (20),
       PARTITION D3 VALUES   LESS THAN (30) tablespace ts3);
select segment_name,partition_name,tablespace_name from dba_segments
where owner='TEST' 
and segment_name='DEPT_RNG';
select table_name,partition_name,high_value
from user_tab_partitions
where table_name='DEPT_RNG';
insert into DEPT_RNG values(1,'Fin');
insert into DEPT_RNG values(10,'Tech');
insert into DEPT_RNG values(25,'HR');
commit;
select * from DEPT_RNG;
select * from DEPT_RNG partition (d1);
select * from DEPT_RNG partition (d2);
select * from DEPT_RNG partition (d3);
--                  	ORA-1440
insert into DEPT_RNG values(null,'Office');	
--OR
insert into DEPT_RNG values(40,'Office');
ERROR at line 1:
ORA-14400: inserted partition key does not map to any partition
--             :
alter table DEPT_RNG add partition Dmax values less than (maxvalue);
--             ,Oracle 11g   Interval Partition(    )
CREATE TABLE DEPT_NEW2
(DEPTNO NUMBER(2),
DEPT_NAME VARCHAR2(30))
PARTITION BY RANGE(DEPTNO)
INTERVAL(10)
(PARTITION D1 VALUES LESS THAN (10),
PARTITION D2 VALUES LESS THAN (20),
PARTITION D3 VALUES LESS THAN (30))
;
   ,   
insert into DEPT_RNG values(40,'Office');
    :
select segment_name, partition_name
from dba_segments
where segment_name = 'DEPT_NEW2'
   dbms      SYS_     ,  INTERVAL(10)   ,RANGE   ,      。
             :
interval (numtoyminterval (1,’month’)) --           
interval (numtoyminterval (1,’year’))  --         
              SYSTEM   。
    store in (test,PERFSTAT)  interval    , :
INTERVAL(10) store in (test,PERFSTAT) --               
(
  PARTITION D1 VALUES LESS THAN (10),
  PARTITION D2 VALUES LESS THAN (20),
  PARTITION D3 VALUES LESS THAN (30)
)  Hash 파 티 션:
drop table product;
CREATE TABLE product
(id     NUMBER(5),
 name   VARCHAR2(30)) 
PARTITION BY HASH(id) PARTITIONS 16 STORE IN (ts1,ts2,ts3,ts4);
insert into product values(10,0);
insert into product values(11,1);
insert into product values(22,2);
insert into product values(33,3);
insert into product values(44,4);
insert into product values(55,5);
insert into product values(66,6);
insert into product values(77,7);
insert into product values(88,8);
insert into product values(99,9);
insert into product values(10,10);
insert into product values(11,11);
commit;
select segment_name,partition_name,tablespace_name from dba_segments where owner='TEST' and segment_name='PRODUCT';
select * from product partition(SYS_P67);
select * from product partition(SYS_P68);
select * from product partition(SYS_P66);
  열 구분:
CREATE TABLE DEPT_LIST (
	DeptNo  NUMBER(2),
	Dname   VARCHAR2(14), 
	Loc    VARCHAR2(13))
PARTITION BY LIST (Loc)
  (PARTITION D_East VALUES ('Shanghai', 'Nanjing'),
   PARTITION D_West VALUES ('Chengdu', 'Chongqing'),
   PARTITION D_South VALUES ('Guangzhou', 'Fuzhou'),
   PARTITION D_North VALUES ('Beijing', 'Shenyang')
);
insert into DEPT_LIST values (1,'GZ','Guangzhou');
insert into DEPT_LIST values (1,'GZ','GuangZhou');
insert into DEPT_LIST values (2,'BJ','Beijing');
select * from DEPT_LIST;
select * from DEPT_LIST partition(D_South);
                이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
activemq 5.5 의 입문 은 설치, 시작, 데이터베이스 지속 화 를 포함한다Apache ActiveMQ 5.5.0 은 주로 유지보수 버 전 으로 130 개가 넘 는 문 제 를 복 구 했 으 며 대부분 bug 와 개선 이 었 다. Improved performance for offline d...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.