SlideShare a Scribd company logo
1 of 4
Anar Godjaevhttp://anargodjaev.wordpress.com/

Table Partitions:
Range partition:
The example below creates a table of four partitions, one for each quarter's sales. The
columns sale_year, sale_month, and sale_day are the partitioning columns, while their
values constitute a specific row's partitioning key. The VALUES LESS THAN clause determines
the partition bound: rows with partitioning key values that compare less than the ordered
list of values specified by the clause are stored in the partition. Each partition is given a
name (sales_q1, sales_q2, ...), and each partition is contained in a separate tablespace (tsa,
tsb, ...).
CREATE TABLE sales
( invoice_no NUMBER,
sale_year INT NOT NULL,
sale_month INT NOT NULL,
sale_day INT NOT NULL )
PARTITION BY RANGE (sale_year, sale_month, sale_day)
( PARTITION sales_q1 VALUES LESS THAN (2012, 04, 01) TABLESPACE tsa,
PARTITION sales_q2 VALUES LESS THAN (2012 07, 01) TABLESPACE tsb,
PARTITION sales_q3 VALUES LESS THAN (2012, 10, 01) TABLESPACE tsc,
PARTITION sales_q4 VALUES LESS THAN (2013, 01, 01) TABLESPACE tsd );
ALTER TABLE sales
ADD PARTITION jan96 VALUES LESS THAN ( '26-FEB-2013' )
TABLESPACE tsx;
ALTER TABLE sales DROP PARTITION dec98;
ALTER INDEX sales_area_ix REBUILD; (if global index exists)
DELETE FROM sales WHERE TRANSID < 10000;
ALTER TABLE sales DROP PARTITION dec98
ALTER TABLE sales DROP PARTITION dec98 UPDATE GLOBAL INDEXES;
ALTER TABLE four_seasons MERGE PARTITIONS quarter_one, quarter_two INTO
PARTITION quarter_two;
CREATE INDEX i_four_seasons_l ON four_seasons ( one,two )
LOCAL (
PARTITION i_quarter_one TABLESPACE i_quarter_one,
PARTITION i_quarter_two TABLESPACE i_quarter_two,
PARTITION i_quarter_three TABLESPACE i_quarter_three,
PARTITION i_quarter_four TABLESPACE i_quarter_four
);
ALTER TABLE four_seasons MODIFY PARTITION quarter_two REBUILD UNUSABLE
LOCAL INDEXES;
ALTER TABLE four_seasons TRUNCATE PARTITION quartes_one;
Anar Godjaevhttp://anargodjaev.wordpress.com/
Dropping index partitions:
ALTER INDEX npr DROP PARTITION P1;
ALTER INDEX npr REBUILD PARTITION P2;

Hash Partition:
The following example creates a hash‐partitioned table. The partitioning column is id, four
partitions are created and assigned system generated names, and they are placed in four
named tablespaces (gear1, gear2, ...).
CREATE TABLE scubagear
(id NUMBER,
name VARCHAR2 (60))
PARTITION BY HASH (id)
PARTITIONS 4
STORE IN (gear1, gear2, gear3, gear4);
ALTER TABLE scubagear ADD PARTITION p_named TABLESPACE gear5;

List Partition:
The following example creates a list‐partitioned table. It creates table q1_sales_by_region
which is partitioned by regions consisting of groups of states.
CREATE TABLE q1_sales_by_region
(deptno number,
deptname varchar2(20),
quarterly_sales number(10, 2),
state varchar2(2))
PARTITION BY LIST (state)
(PARTITION q1_northwest VALUES ('OR', 'WA'),
PARTITION q1_southwest VALUES ('AZ', 'UT', 'NM'),
PARTITION q1_northeast VALUES ('NY', 'VM', 'NJ'),
PARTITION q1_southeast VALUES ('FL', 'GA'),
PARTITION q1_northcentral VALUES ('SD', 'WI'),
PARTITION q1_southcentral VALUES ('OK', 'TX'));
ALTER TABLE q1_sales_by_region
ADD PARTITION q1_nonmainland VALUES ('HI', 'PR')
STORAGE (INITIAL 20K NEXT 20K) TABLESPACE tbs_3
NOLOGGING;
ALTER TABLE q1_sales_by_region
MERGE PARTITIONS q1_northcentral, q1_southcentral
INTO PARTITION q1_central
PCTFREE 50 STORAGE(MAXEXTENTS 20);

Range‐Hash Partition:
The following statement creates a range‐hash partitioned table. In this example, three range
partitions are created, each containing eight subpartitions. Because the subpartitions are not
named, system generated names are assigned, but the STORE IN clause distributes them
Anar Godjaevhttp://anargodjaev.wordpress.com/
across the 4 specified tablespaces (ts1, ...,ts4).
CREATE TABLE scubagear (equipno NUMBER, equipname VARCHAR(32), price
NUMBER)
PARTITION BY RANGE (equipno) SUBPARTITION BY HASH(equipname)
SUBPARTITIONS 8 STORE IN (ts1, ts2, ts3, ts4)
(PARTITION p1 VALUES LESS THAN (1000),
PARTITION p2 VALUES LESS THAN (2000),
PARTITION p3 VALUES LESS THAN (MAXVALUE));

Range‐List Partition:
The following example illustrates how range‐list partitioning might be used. The example
tracks sales data of products by quarters and within each quarter, groups it by specified
states.
CREATE TABLE quarterly_regional_sales
(deptno number, item_no varchar2(20),
txn_date date, txn_amount number, state varchar2(2))
TABLESPACE ts4
PARTITION BY RANGE (txn_date)
SUBPARTITION BY LIST (state)
(PARTITION q1_2013 VALUES LESS THAN (TO_DATE('1-APR-2013','DD-MONYYYY'))
(SUBPARTITION q1_2013_northwest VALUES ('OR', 'WA'),
SUBPARTITION q1_2013_southwest VALUES ('AZ', 'UT', 'NM'),
SUBPARTITION q1_2013_northeast VALUES ('NY', 'VM', 'NJ'),
SUBPARTITION q1_2013_southeast VALUES ('FL', 'GA'),
SUBPARTITION q1_2013_northcentral VALUES ('SD', 'WI'),
SUBPARTITION q1_2013_southcentral VALUES ('OK', 'TX')
),
PARTITION q2_2013 VALUES LESS THAN ( TO_DATE('1-JUL-2013','DD-MONYYYY'))
(SUBPARTITION q2_2013_northwest VALUES ('OR', 'WA'),
SUBPARTITION q2_2013_southwest VALUES ('AZ', 'UT', 'NM'),
SUBPARTITION q2_2013_northeast VALUES ('NY', 'VM', 'NJ'),
SUBPARTITION q2_2013_southeast VALUES ('FL', 'GA'),
SUBPARTITION q2_2013_northcentral VALUES ('SD', 'WI'),
SUBPARTITION q2_2013_southcentral VALUES ('OK', 'TX')
),
PARTITION q3_2013 VALUES LESS THAN (TO_DATE('1-OCT-2013','DD-MONYYYY'))
(SUBPARTITION q3_2013_northwest VALUES ('OR', 'WA'),
SUBPARTITION q3_2013_southwest VALUES ('AZ', 'UT', 'NM'),
SUBPARTITION q3_2013_northeast VALUES ('NY', 'VM', 'NJ'),
SUBPARTITION q3_2013_southeast VALUES ('FL', 'GA'),
SUBPARTITION q3_2013_northcentral VALUES ('SD', 'WI'),
SUBPARTITION q3_2013_southcentral VALUES ('OK', 'TX')
));
ALTER TABLE quarterly_regional_sales
MODIFY SUBPARTITION q1_2013_southeast
ADD VALUES ('KS');
Anar Godjaevhttp://anargodjaev.wordpress.com/
ALTER TABLE quarterly_regional_sales
MODIFY SUBPARTITION q1_2013_southeast
DROP VALUES ('KS');

More Related Content

Viewers also liked

How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...Anar Godjaev
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden GateAnar Godjaev
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from Anar Godjaev
 
Conditional Control
Conditional ControlConditional Control
Conditional ControlAnar Godjaev
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and RecoveryAnar Godjaev
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin GüvenliğiAnar Godjaev
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasiAnar Godjaev
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaultAnar Godjaev
 

Viewers also liked (12)

How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Tuning SGA
Tuning SGATuning SGA
Tuning SGA
 
Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
Wait Interface
Wait InterfaceWait Interface
Wait Interface
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin Güvenliği
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasi
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vault
 

Similar to Table Partitions

Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Achmad Solichin
 
Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14prashant0000
 
Oracle eCommerce (ATG) Database Best Practices
Oracle eCommerce (ATG) Database  Best Practices Oracle eCommerce (ATG) Database  Best Practices
Oracle eCommerce (ATG) Database Best Practices Kate Semizhon
 
Appendix A Tables
Appendix A   TablesAppendix A   Tables
Appendix A TablesLiquidHub
 
write a List class to store your Vehicle objects. you've decided that your im...
write a List class to store your Vehicle objects. you've decided that your im...write a List class to store your Vehicle objects. you've decided that your im...
write a List class to store your Vehicle objects. you've decided that your im...hwbloom104
 
Devry bis 155 week 3 quiz data analysis
Devry bis 155 week 3 quiz data analysisDevry bis 155 week 3 quiz data analysis
Devry bis 155 week 3 quiz data analysisshyaminfo104
 
0104 abap dictionary
0104 abap dictionary0104 abap dictionary
0104 abap dictionaryvkyecc1
 
Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...hwbloom121
 
Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...hwbloom135
 
Appendix A Tables
Appendix A   TablesAppendix A   Tables
Appendix A TablesLiquidHub
 
Final ProjectBe sure to follow the instructions for each step as.docx
Final ProjectBe sure to follow the instructions for each step as.docxFinal ProjectBe sure to follow the instructions for each step as.docx
Final ProjectBe sure to follow the instructions for each step as.docxvoversbyobersby
 
Procedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom TableProcedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom TableAhmed Elshayeb
 
Using ddl statements to create and manage tables
Using ddl statements to create and manage tablesUsing ddl statements to create and manage tables
Using ddl statements to create and manage tablesSyed Zaid Irshad
 

Similar to Table Partitions (20)

Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Les09
Les09Les09
Les09
 
Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14Ppt INFORMATIVE PRACTICES for class 11th chapter 14
Ppt INFORMATIVE PRACTICES for class 11th chapter 14
 
Oracle eCommerce (ATG) Database Best Practices
Oracle eCommerce (ATG) Database  Best Practices Oracle eCommerce (ATG) Database  Best Practices
Oracle eCommerce (ATG) Database Best Practices
 
Sap abap
Sap abapSap abap
Sap abap
 
Appendix A Tables
Appendix A   TablesAppendix A   Tables
Appendix A Tables
 
write a List class to store your Vehicle objects. you've decided that your im...
write a List class to store your Vehicle objects. you've decided that your im...write a List class to store your Vehicle objects. you've decided that your im...
write a List class to store your Vehicle objects. you've decided that your im...
 
Devry bis 155 week 3 quiz data analysis
Devry bis 155 week 3 quiz data analysisDevry bis 155 week 3 quiz data analysis
Devry bis 155 week 3 quiz data analysis
 
unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
0104 abap dictionary
0104 abap dictionary0104 abap dictionary
0104 abap dictionary
 
Les09
Les09Les09
Les09
 
Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...
 
Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...Write a List class to store Vehicle objects. The implementation of List will ...
Write a List class to store Vehicle objects. The implementation of List will ...
 
Appendix A Tables
Appendix A   TablesAppendix A   Tables
Appendix A Tables
 
Final ProjectBe sure to follow the instructions for each step as.docx
Final ProjectBe sure to follow the instructions for each step as.docxFinal ProjectBe sure to follow the instructions for each step as.docx
Final ProjectBe sure to follow the instructions for each step as.docx
 
Les10
Les10Les10
Les10
 
Procedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom TableProcedure To Store Database Object Size And Number Of Rows In Custom Table
Procedure To Store Database Object Size And Number Of Rows In Custom Table
 
Using ddl statements to create and manage tables
Using ddl statements to create and manage tablesUsing ddl statements to create and manage tables
Using ddl statements to create and manage tables
 
w_dzon05
w_dzon05w_dzon05
w_dzon05
 

More from Anar Godjaev

Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumAnar Godjaev
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon ExportAnar Godjaev
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Anar Godjaev
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Anar Godjaev
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeAnar Godjaev
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed FilesAnar Godjaev
 
Recovery Manager (RMAN)
Recovery Manager (RMAN)Recovery Manager (RMAN)
Recovery Manager (RMAN)Anar Godjaev
 
Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Anar Godjaev
 
Oracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationOracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationAnar Godjaev
 
Oracle Tablespace Yonetimi
Oracle Tablespace YonetimiOracle Tablespace Yonetimi
Oracle Tablespace YonetimiAnar Godjaev
 

More from Anar Godjaev (19)

Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
 
Contraints
ContraintsContraints
Contraints
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL Blocks
 
Parallel Server
Parallel ServerParallel Server
Parallel Server
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
LogMiner
LogMinerLogMiner
LogMiner
 
Undo Management
Undo ManagementUndo Management
Undo Management
 
ASM
ASMASM
ASM
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed Files
 
Recovery Manager (RMAN)
Recovery Manager (RMAN)Recovery Manager (RMAN)
Recovery Manager (RMAN)
 
Oracle Enterprise Linux 5
Oracle Enterprise Linux 5Oracle Enterprise Linux 5
Oracle Enterprise Linux 5
 
Oracle Database 11g R2 Installation
Oracle Database 11g R2 InstallationOracle Database 11g R2 Installation
Oracle Database 11g R2 Installation
 
Change DB Name
Change DB NameChange DB Name
Change DB Name
 
Oracle Tablespace Yonetimi
Oracle Tablespace YonetimiOracle Tablespace Yonetimi
Oracle Tablespace Yonetimi
 

Recently uploaded

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Table Partitions

  • 1. Anar Godjaevhttp://anargodjaev.wordpress.com/ Table Partitions: Range partition: The example below creates a table of four partitions, one for each quarter's sales. The columns sale_year, sale_month, and sale_day are the partitioning columns, while their values constitute a specific row's partitioning key. The VALUES LESS THAN clause determines the partition bound: rows with partitioning key values that compare less than the ordered list of values specified by the clause are stored in the partition. Each partition is given a name (sales_q1, sales_q2, ...), and each partition is contained in a separate tablespace (tsa, tsb, ...). CREATE TABLE sales ( invoice_no NUMBER, sale_year INT NOT NULL, sale_month INT NOT NULL, sale_day INT NOT NULL ) PARTITION BY RANGE (sale_year, sale_month, sale_day) ( PARTITION sales_q1 VALUES LESS THAN (2012, 04, 01) TABLESPACE tsa, PARTITION sales_q2 VALUES LESS THAN (2012 07, 01) TABLESPACE tsb, PARTITION sales_q3 VALUES LESS THAN (2012, 10, 01) TABLESPACE tsc, PARTITION sales_q4 VALUES LESS THAN (2013, 01, 01) TABLESPACE tsd ); ALTER TABLE sales ADD PARTITION jan96 VALUES LESS THAN ( '26-FEB-2013' ) TABLESPACE tsx; ALTER TABLE sales DROP PARTITION dec98; ALTER INDEX sales_area_ix REBUILD; (if global index exists) DELETE FROM sales WHERE TRANSID < 10000; ALTER TABLE sales DROP PARTITION dec98 ALTER TABLE sales DROP PARTITION dec98 UPDATE GLOBAL INDEXES; ALTER TABLE four_seasons MERGE PARTITIONS quarter_one, quarter_two INTO PARTITION quarter_two; CREATE INDEX i_four_seasons_l ON four_seasons ( one,two ) LOCAL ( PARTITION i_quarter_one TABLESPACE i_quarter_one, PARTITION i_quarter_two TABLESPACE i_quarter_two, PARTITION i_quarter_three TABLESPACE i_quarter_three, PARTITION i_quarter_four TABLESPACE i_quarter_four ); ALTER TABLE four_seasons MODIFY PARTITION quarter_two REBUILD UNUSABLE LOCAL INDEXES; ALTER TABLE four_seasons TRUNCATE PARTITION quartes_one;
  • 2. Anar Godjaevhttp://anargodjaev.wordpress.com/ Dropping index partitions: ALTER INDEX npr DROP PARTITION P1; ALTER INDEX npr REBUILD PARTITION P2; Hash Partition: The following example creates a hash‐partitioned table. The partitioning column is id, four partitions are created and assigned system generated names, and they are placed in four named tablespaces (gear1, gear2, ...). CREATE TABLE scubagear (id NUMBER, name VARCHAR2 (60)) PARTITION BY HASH (id) PARTITIONS 4 STORE IN (gear1, gear2, gear3, gear4); ALTER TABLE scubagear ADD PARTITION p_named TABLESPACE gear5; List Partition: The following example creates a list‐partitioned table. It creates table q1_sales_by_region which is partitioned by regions consisting of groups of states. CREATE TABLE q1_sales_by_region (deptno number, deptname varchar2(20), quarterly_sales number(10, 2), state varchar2(2)) PARTITION BY LIST (state) (PARTITION q1_northwest VALUES ('OR', 'WA'), PARTITION q1_southwest VALUES ('AZ', 'UT', 'NM'), PARTITION q1_northeast VALUES ('NY', 'VM', 'NJ'), PARTITION q1_southeast VALUES ('FL', 'GA'), PARTITION q1_northcentral VALUES ('SD', 'WI'), PARTITION q1_southcentral VALUES ('OK', 'TX')); ALTER TABLE q1_sales_by_region ADD PARTITION q1_nonmainland VALUES ('HI', 'PR') STORAGE (INITIAL 20K NEXT 20K) TABLESPACE tbs_3 NOLOGGING; ALTER TABLE q1_sales_by_region MERGE PARTITIONS q1_northcentral, q1_southcentral INTO PARTITION q1_central PCTFREE 50 STORAGE(MAXEXTENTS 20); Range‐Hash Partition: The following statement creates a range‐hash partitioned table. In this example, three range partitions are created, each containing eight subpartitions. Because the subpartitions are not named, system generated names are assigned, but the STORE IN clause distributes them
  • 3. Anar Godjaevhttp://anargodjaev.wordpress.com/ across the 4 specified tablespaces (ts1, ...,ts4). CREATE TABLE scubagear (equipno NUMBER, equipname VARCHAR(32), price NUMBER) PARTITION BY RANGE (equipno) SUBPARTITION BY HASH(equipname) SUBPARTITIONS 8 STORE IN (ts1, ts2, ts3, ts4) (PARTITION p1 VALUES LESS THAN (1000), PARTITION p2 VALUES LESS THAN (2000), PARTITION p3 VALUES LESS THAN (MAXVALUE)); Range‐List Partition: The following example illustrates how range‐list partitioning might be used. The example tracks sales data of products by quarters and within each quarter, groups it by specified states. CREATE TABLE quarterly_regional_sales (deptno number, item_no varchar2(20), txn_date date, txn_amount number, state varchar2(2)) TABLESPACE ts4 PARTITION BY RANGE (txn_date) SUBPARTITION BY LIST (state) (PARTITION q1_2013 VALUES LESS THAN (TO_DATE('1-APR-2013','DD-MONYYYY')) (SUBPARTITION q1_2013_northwest VALUES ('OR', 'WA'), SUBPARTITION q1_2013_southwest VALUES ('AZ', 'UT', 'NM'), SUBPARTITION q1_2013_northeast VALUES ('NY', 'VM', 'NJ'), SUBPARTITION q1_2013_southeast VALUES ('FL', 'GA'), SUBPARTITION q1_2013_northcentral VALUES ('SD', 'WI'), SUBPARTITION q1_2013_southcentral VALUES ('OK', 'TX') ), PARTITION q2_2013 VALUES LESS THAN ( TO_DATE('1-JUL-2013','DD-MONYYYY')) (SUBPARTITION q2_2013_northwest VALUES ('OR', 'WA'), SUBPARTITION q2_2013_southwest VALUES ('AZ', 'UT', 'NM'), SUBPARTITION q2_2013_northeast VALUES ('NY', 'VM', 'NJ'), SUBPARTITION q2_2013_southeast VALUES ('FL', 'GA'), SUBPARTITION q2_2013_northcentral VALUES ('SD', 'WI'), SUBPARTITION q2_2013_southcentral VALUES ('OK', 'TX') ), PARTITION q3_2013 VALUES LESS THAN (TO_DATE('1-OCT-2013','DD-MONYYYY')) (SUBPARTITION q3_2013_northwest VALUES ('OR', 'WA'), SUBPARTITION q3_2013_southwest VALUES ('AZ', 'UT', 'NM'), SUBPARTITION q3_2013_northeast VALUES ('NY', 'VM', 'NJ'), SUBPARTITION q3_2013_southeast VALUES ('FL', 'GA'), SUBPARTITION q3_2013_northcentral VALUES ('SD', 'WI'), SUBPARTITION q3_2013_southcentral VALUES ('OK', 'TX') )); ALTER TABLE quarterly_regional_sales MODIFY SUBPARTITION q1_2013_southeast ADD VALUES ('KS');
  • 4. Anar Godjaevhttp://anargodjaev.wordpress.com/ ALTER TABLE quarterly_regional_sales MODIFY SUBPARTITION q1_2013_southeast DROP VALUES ('KS');