Oracle Partitioning Interview Questions and Answers
Oracle Partitioning Interview Questions and Answers
1. What is partitioning?
Partitioning is the process of separating data into logical subsets. In the same way as normal tables
and indexes, partitions are physical segments for which extents are allocated (see Note 666061).
2. Which objects can be partitioned?
Tables and indexes can be partitioned. All combinations are theoretically possible:
Table not partitioned, relevant index partitioned
Table partitioned, relevant index not partitioned
Table partitioned, relevant index partitioned
Up to 64,000 partitions are possible. Objects with LONG fields and LONG RAW fields cannot be
partitioned.
3. What are the advantages of partitioning?
Improved administration because many operations can be carried out on separate partitions (data
loads, index creation and rebuilding, backup/recovery and so on).
Partitions that are no longer required can simply be dropped (no reorganization to recover disk
space and no time consuming DELETEs are necessary).
You can improve the performance of queries if only specific partitions have to be read.
Partitioning is transparent for the application and does not require any change to SQL queries and
DML statements.
Avoid redo log data when you delete old data because, unlike a DELETE, a DROP or TRUNCATE
does not generate redo log data.
4. What problems can occur in connection with partitioning?
ORA-014508:
Validation of partitioned objects with VALIDATE STRUCTURE encounters an ORA-14508 error if the
utlvalid.sql script was not executed for the executing database user. To avoid the error, see Note
514178 and execute utlvalid.sql for all relevant users.
ORA-14400:
ORA-14400 occurs if you want to insert an entry in the table that does not match the value range of
any partition. In such a case, you must compare the value of the entry with the definitions of the
partitions to determine the cause of the error.
Queries that do not contain the partitioning criterion in the WHERE clause, must scan ALL
partitions. In these cases, the effort increases in proportion to the number of partitions.
5. How many types of partitioning exist?
Range partitioning
Each partition includes data from a specific value range, for example:
Column YEAR: JAN 01 2002 - DEC 31 2002 -> Partition 1
Column YEAR: JAN 01 2003 - DEC 31 2003 -> Partition 2
Column YEAR: JAN 01 2004 - DEC 31 2004 -> Partition 3
List partitioning
For each partition, there is a list specifying the values to be assigned to this partition, for example:
Column COUNTRY: "Germany", "France" -> Partition 1 (Europe)
COLUMN COUNTRY: "USA", "Mexico" -> Partition 2 (America)
If you specify a default partition, all records that do not match any list are included in this partition.
Hash partitioning
A hash algorithm is used to distribute the records at random to the individual partitions.
Combined partitioning: Several of the above partitioning types can be combined in the form of
PARTITION and SUBPARTITION (for example, range hash or range list).
The following different partitioning methods are used in relation to indexes:
Local partitioning: There is a 1:1 relationship between the table and index partitions. Each index
partition contains the values of exactly one related table partition.
Global partitioning: The index partitioning is independent of the table partitioning in question. An
index partition can contain values from different table partitions.
6. What is the Oracle syntax for creating partitioned objects?
Example of range partitioning:
LOGMNR_TS$
LOGMNR_TYPE$
LOGMNR_USER$
LOGSTDBY$APPLY_PROGRESS
As of Oracle 10g, STREAMS$_APPLY_SPILL_MSGS_PART and a large number of tables from the
workload repository (WRH$_...) are also partitioned.
13. Can I deactivate partitioning in BW?
If you use BW functions, then partitioned objects are an essential prerequisite for good database
performance. Therefore deactivation of the Oracle partitioning option is not permitted in this case.
However, if BW is automatically installed when you install another product (such as NetWeaver04),
but you do not actually use BW, you can deactivate the partitioning option to reduce the license
costs for a database that is directly licensed with Oracle (for example). For more information, see
Note 859841.
14. Where can I find more information about partitioning?
Oracle9i Online Documentation: