Oracle 11g维护分区概述
本章节介绍了如何为Oracle表和索引进行分区和子分区的维护操作。
本章节介绍了如何为Oracle表和索引进行分区和子分区的维护操作。
本章节包含以下主题:
注意:
以下各节讨论分区表的维护操作,这些维护操作会影响到索引或索引分区的可用性,考虑以下几点:
表4-1列出了可以对分区表和复合分区表进行的维护操作,表4-2列出子分区维护操作可以对分区表进行复合。对于每种类型的分区和分区,都列出了维护操作中用到的ALTER TABLE语句的具体子句。
表4-1分区表的ALTER TABLE维护操作
维护操作
范围复合
Range-*
间隔复合
Interval-*
哈希
列表复合
List-*
引用
添加分区
ADD PARTITION
ADD PARTITION
ADD PARTITION
ADD PARTITION
N/A
合并分区
N/A
N/A
COALESCE PARTITION
N/A
N/A
删除分区
DROP PARTITION
DROP PARTITION
N/A
DROP PARTITION
N/A
交换分区
EXCHANGE PARTITION
EXCHANGE PARTITION
EXCHANGE PARTITION
EXCHANGE PARTITION
EXCHANGE PARTITION
合并分区
MERGE PARTITIONS
MERGE PARTITIONS
N/A
MERGE PARTITIONS
N/A
修改默认属性
MODIFY DEFAULT ATTRIBUTES
MODIFY DEFAULT ATTRIBUTES
MODIFY DEFAULT ATTRIBUTES
MODIFY DEFAULT ATTRIBUTES
MODIFY DEFAULT ATTRIBUTES
修改分区的当前属性
MODIFY PARTITION
MODIFY PARTITION
MODIFY PARTITION
MODIFY PARTITION
MODIFY PARTITION
修改列表分区:增加值
N/A
N/A
N/A
MODIFY PARTITION ... ADD VALUES
N/A
修改列表分区:删除值
N/A
N/A
N/A
MODIFY PARTITION ... DROP VALUES
N/A
移动分区
MOVE SUBPARTITION
MOVE SUBPARTITION
MOVE PARTITION
MOVE SUBPARTITION
MOVE PARTITION
重命名分区
RENAME PARTITION
RENAME PARTITION
RENAME PARTITION
RENAME PARTITION
RENAME PARTITION
分割分区
SPLIT PARTITION
SPLIT PARTITION
N/A
SPLIT PARTITION
N/A
截断分区
TRUNCATE PARTITION
TRUNCATE PARTITION
TRUNCATE PARTITION
TRUNCATE PARTITION
TRUNCATE PARTITION
表4-2子分区表的ALTER TABLE维护操作
维护操作
复合
*-Range
复合
*-Hash
复合
*-List
添加分区
MODIFY PARTITION ... ADD SUBPARTITION
MODIFY PARTITION ... ADD SUBPARTITION
MODIFY PARTITION ... ADD SUBPARTITION
合并分区
N/A
MODIFY PARTITION ... COALESCE SUBPARTITION
N/A
删除分区
DROP SUBPARTITION
N/A
DROP SUBPARTITION
交换分区
EXCHANGE SUBPARTITION
N/A
EXCHANGE SUBPARTITION
合并分区
MERGE SUBPARTITIONS
N/A
MERGE SUBPARTITIONS
修改默认属性
MODIFY DEFAULT ATTRIBUTES FOR PARTITION
MODIFY DEFAULT ATTRIBUTES FOR PARTITION
MODIFY DEFAULT ATTRIBUTES FOR PARTITION
修改分区的当前属性
MODIFY SUBPARTITION
MODIFY SUBPARTITION
MODIFY SUBPARTITION
修改列表分区:增加值
N/A
N/A
MODIFY SUBPARTITION ... ADD VALUES
修改列表分区:删除值
N/A
N/A
MODIFY SUBPARTITION ... DROP VALUES
修改子分区模板
SET SUBPARTITION TEMPLATE
SET SUBPARTITION TEMPLATE
SET SUBPARTITION TEMPLATE
移动分区
MOVE SUBPARTITION
MOVE SUBPARTITION
MOVE SUBPARTITION
重命名分区
RENAME SUBPARTITION
RENAME SUBPARTITION
RENAME SUBPARTITION
分割分区
SPLIT SUBPARTITION
N/A
SPLIT SUBPARTITION
截断分区
TRUNCATE SUBPARTITION
TRUNCATE SUBPARTITION
TRUNCATE SUBPARTITION
注意:
当您第一次使用表压缩,将压缩分区引入一个包含位图索引并且只包含未压缩分区的分区表,你必须做到以下几点:
删除所有现存的位图索引和位图分区索引,或者将它们标识为UNUSABLE;
设置表压缩属性
重建索引
分区是否包含数据,和引入压缩分区的操作是相互独立的。
另外,这并不适用于包含B-tree索引的分区表以及分区索引组织表。
表4-3列出了可以对索引分区进行的维护操作,并指出可以操作的索引类型(全局或局部)。而且,还列出了用于维护操作的ALTER INDEX子句。
全局索引并不反映基表的结构。如果分区,它们可通过范围或散列进行分区。全局分区索引可以共享在分区表上的部分操作,而不是全部。
由于本地索引反映了基表的结构,在对分区或者子分区进行维护操作时,索引分区会自动被维护。因此,维护本地索引分区的必要性大打折扣,并且相应的选项也很少。
表4-3 索引分区的ALTER INDEX维护操作
维护操作
索引类型
索引分区类型
范围
哈希和列表
复合
添加索引分区
Global
-
ADD PARTITION (hash only)
-
Local
N/A
N/A
N/A
删除索引分区
Global
DROP PARTITION
-
-
Local
N/A
N/A
N/A
修改索引分区的默认属性
Global
MODIFY DEFAULT ATTRIBUTES
-
-
Local
MODIFY DEFAULT ATTRIBUTES
MODIFY DEFAULT ATTRIBUTES
MODIFY DEFAULT ATTRIBUTES
MODIFY DEFAULT ATTRIBUTES FOR PARTITION
修改索引分区的当前属性
Global
MODIFY PARTITION
-
-
Local
MODIFY PARTITION
MODIFY PARTITION
MODIFY PARTITION
MODIFY SUBPARTITION
重建索引分区
Global
REBUILD PARTITION
-
-
Local
REBUILD PARTITION
REBUILD PARTITION
REBUILD SUBPARTITION
重命名索引分区
Global
RENAME PARTITION
-
-
Local
RENAME PARTITION
RENAME PARTITION
RENAME PARTITION
RENAME SUBPARTITION
分割索引分区
Global
SPLIT PARTITION
-
-
Local
N/A
N/A
N/A
自动更新索引在讨论针对分区表和索引的各个维护操作之前,讨论一下可以在ALTER TABLE语句中指定的UPDATE INDEXES子句的影响,是十分重要的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Analysis of the basic principles of the MySQL database management system MySQL is a commonly used relational database management system that uses structured query language (SQL) for data storage and management. This article will introduce the basic principles of the MySQL database management system, including database creation, data table design, data addition, deletion, modification, and other operations, and provide specific code examples. 1. Database Creation In MySQL, you first need to create a database instance to store data. The following code can create a file named "my

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

PHP is a back-end programming language widely used in website development. It has powerful database operation functions and is often used to interact with databases such as MySQL. However, due to the complexity of Chinese character encoding, problems often arise when dealing with Chinese garbled characters in the database. This article will introduce the skills and practices of PHP in handling Chinese garbled characters in databases, including common causes of garbled characters, solutions and specific code examples. Common reasons for garbled characters are incorrect database character set settings: the correct character set needs to be selected when creating the database, such as utf8 or u

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.
