Oracle Table Partitioning-step-by-step explanation of oracle partition tables

Source: Internet
Author: User

Explain the oracle table partitions-step by step teach you how to explain the oracle Partition Table 1. Create three different tablespaces, simulate the creation of tablespace test01 datafile '/u01/app/oracle/oradata/orcl02/test01.dbf' size 500 m stored on different disks; --- data files can no longer be stored on the same storage. create tablespace test02 datafile '/u01/app/oracle/oradata/orcl02/test02.dbf' size 500 m; create tablespace test03 datafile '/u01/app/oracle/oradata/orcl02/test03.dbf' size 500 m; 2. create a table in a different tablespace (Block Storage Data File) create table graderecord (sno Varchar2 (10), sname varchar2 (20), dormitory varchar2 (3), grade int) partition by range (grade) (partition bujige values less than (60) tablespace test01, -- fail, range partition jige values less than (85) tablespace test02, -- Pass partition youxiu values less than (maxvalue) tablespace test03 -- excellent) 3. Insert into graderecord values ('000000', 'kual', '000000', 92) into the table; insert into graderecord values ('000000 ',' Kai', '123', 62); insert into graderecord values ('123', 'east', '123', 26); insert into graderecord values ('123 ', 'ali', '000000', 77); insert into graderecord values ('000000', 'jing', '000000', 47); insert into graderecord (sno, sname, dormitory) values ('20140901', 'feng', '20160901'); insert into graderecord values ('20160901', 'ming', '2016090', 90 ); insert into graderecord values ('20140901', 'nan', '20160901', 511608); insert into graderecord values ('20160301' 9 ', 'Tao', '000000', 67); insert into graderecord values ('000000', 'bo', '000000', 75 ); insert into graderecord values ('20140901', 'hangzhou', '20160901', 60); 4. query results respectively. SQL> select * from graderecord; select * from graderecord partition (bujige); sno sname dor grade ---------- ------------------ --- ---------- 511603 ?? 229 26 511605 ?? 228 47 511602 ?? 229 62 511604 ?? 228 77 511609 ?? 240 67 511610 ?? 240 75 511611 ?? 240 60 511601 ?? 229 92 511606 ?? 228 511607 ?? 240 90 511608 ?? 240 100 11 rows selected. SQL> SNO SNAME DOR GRADE ---------- -------------------- --- ---------- 511603 ?? 229 26 511605 ?? 228 47 SQL> select * from graderecord partition (jige); SNO SNAME dorgrade ---------- ------------------ --- ---------- 511602 ?? 229 62 511604 ?? 228 77 511609 ?? 240 67 511610 ?? 240 75 511611 ?? 240 60 SQL> select * from graderecord partition (youxiu); SNO SNAME dorgrade ---------- ------------------ --- ---------- 511601 ?? 229 92 511606 ?? 228 511607 ?? 240 90 511608 ?? 240 100 SQL> see it. This is a simple example of range partitioning.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.