80 lines
4.6 KiB
HTML
80 lines
4.6 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="concept" />
|
|
<meta name="DC.Title" content="Modification of existing partitioned tables" />
|
|
<meta name="abstract" content="You can make several changes to your partitioned table by using the clauses of the ALTER TABLE statement." />
|
|
<meta name="description" content="You can make several changes to your partitioned table by using the clauses of the ALTER TABLE statement." />
|
|
<meta name="DC.Relation" scheme="URI" content="alterpt.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="altertype.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="existingpt" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Modification of existing partitioned tables</title>
|
|
</head>
|
|
<body id="existingpt"><a name="existingpt"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Modification of existing partitioned tables</h1>
|
|
<div><p>You can make several changes to your partitioned table by using
|
|
the clauses of the <samp class="codeph">ALTER TABLE</samp> statement.</p>
|
|
<p>These clauses are as follows:</p>
|
|
<ul><li><samp class="codeph">ADD PARTITION</samp> <div class="p">This clause adds one or more new hash
|
|
partitions or a range partition to an existing partitioned table. Make sure
|
|
that the parameters you specify do not violate the following rules; otherwise,
|
|
errors occur. <ul><li>Do not use the <samp class="codeph">ADD PARTITION</samp> clause for nonpartitioned
|
|
tables.</li>
|
|
<li>When adding hash partitions, the number of partitions being added must
|
|
be specified as a positive integer.</li>
|
|
<li>If you supply a name or integer to identify the partition, ensure that
|
|
it is not already in use by another partition.</li>
|
|
<li>When adding range partitions, the specified ranges must not overlap the
|
|
ranges of any existing partitions.</li>
|
|
</ul>
|
|
</div>
|
|
<p>For example, to alter the table PAYROLL in library
|
|
PRODLIB with partition key EMPNUM to have four additional partitions, use
|
|
the following code:</p>
|
|
<pre>ALTER TABLE PRODLIB.PAYROLL
|
|
ADD PARTITION 4 HASH PARTITIONS</pre>
|
|
</li>
|
|
<li><samp class="codeph">ALTER PARTITION</samp> <p>This clause alters the range for the
|
|
identified range partition. Ensure that the following conditions are met:</p>
|
|
<ul><li>The identified partition must exist in the table.</li>
|
|
<li>The specified ranges must not overlap the ranges of any existing partitions.</li>
|
|
<li>All existing rows of the partitioned table must fall within the new ranges
|
|
specified on the ALTER TABLE statement.</li>
|
|
</ul>
|
|
</li>
|
|
<li><samp class="codeph">DROP PARTITION</samp> <p>This clause drops a partition
|
|
of a partitioned table. If the specified table is not a partitioned table,
|
|
an error is returned. If the last remaining partition of a partitioned table
|
|
is specified, an error is returned.</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="altertype.htm">Restrictions when altering a column's data type</a></strong><br />
|
|
When altering a column's data type, and that column is part of a partitioning key, there are some restrictions on the target data type.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="alterpt.htm" title="You can change existing nonpartitioned tables to partitioned tables, change the attributes of existing partitioned tables, or change partitioned table to nonpartitioned tables.">Modification of existing tables</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |