118 lines
6.3 KiB
HTML
118 lines
6.3 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="reference" />
|
||
<meta name="DC.Title" content="Atomic operations" />
|
||
<meta name="abstract" content="When running under COMMIT(*CHG), COMMIT(*CS), or COMMIT(*ALL), all operations are guaranteed to be atomic." />
|
||
<meta name="description" content="When running under COMMIT(*CHG), COMMIT(*CS), or COMMIT(*ALL), all operations are guaranteed to be atomic." />
|
||
<meta name="DC.subject" content="atomic operation, definition, data integrity, data integrity, atomic operation, data definition statements (DDL), data definition statements (DDL), Delete Library (DLTLIB) command, command (CL), Delete Library (DLTLIB), DLTLIB (Delete Library)" />
|
||
<meta name="keywords" content="atomic operation, definition, data integrity, data integrity, atomic operation, data definition statements (DDL), data definition statements (DDL), Delete Library (DLTLIB) command, command (CL), Delete Library (DLTLIB), DLTLIB (Delete Library)" />
|
||
<meta name="DC.Relation" scheme="URI" content="rbafydataintex.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="rbafyatomic" />
|
||
<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>Atomic operations</title>
|
||
</head>
|
||
<body id="rbafyatomic"><a name="rbafyatomic"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">Atomic operations</h1>
|
||
<div><p>When running under COMMIT(*CHG), COMMIT(*CS), or COMMIT(*ALL),
|
||
all operations are guaranteed to be atomic.</p>
|
||
<div class="section"><p>That is, they will complete or they will appear not to have started.
|
||
This is true regardless of when or how the function was ended or interrupted
|
||
(such as power failure, abnormal job end, or job cancel).</p>
|
||
</div>
|
||
<div class="section"><p>If COMMIT (*NONE) is specified, however, some underlying database
|
||
data definition functions are not atomic. The following SQL data definition
|
||
statements are guaranteed to be atomic:</p>
|
||
<ul><li>ALTER TABLE (See note 1)</li>
|
||
<li>COMMENT ON (See note 2)</li>
|
||
<li>LABEL ON (See note 2)</li>
|
||
<li>GRANT (See note 3)</li>
|
||
<li>REVOKE (See note 3)</li>
|
||
<li>DROP TABLE (See note 4)</li>
|
||
<li>DROP VIEW (See note 4)</li>
|
||
<li>DROP INDEX</li>
|
||
<li>DROP PACKAGE</li>
|
||
<li>REFRESH TABLE </li>
|
||
</ul>
|
||
<div class="note"><span class="notetitle">Notes:</span> <ol><li>If constraints need to be added or removed, as well as column definitions
|
||
changed, the operations are processed one at a time, so the entire SQL statement
|
||
is not atomic. The order of operation is: <ul><li>Remove constraints</li>
|
||
<li>Drop columns for which the RESTRICT option was specified</li>
|
||
<li>All other column definition changes (DROP COLUMN CASCADE, ALTER COLUMN,
|
||
ADD COLUMN)</li>
|
||
<li>Add constraints</li>
|
||
</ul>
|
||
</li>
|
||
<li>If multiple columns are specified for a COMMENT ON or LABEL ON statement,
|
||
the columns are processed one at a time, so the entire SQL statement is not
|
||
atomic, but the COMMENT ON or LABEL ON to each individual column or object
|
||
will be atomic.</li>
|
||
<li>If multiple tables, SQL packages, or users are specified for a GRANT or
|
||
REVOKE statement, the tables are processed one at a time, so the entire SQL
|
||
statement is not atomic, but the GRANT or REVOKE to each individual table
|
||
will be atomic.</li>
|
||
<li>If dependent views need to be dropped during DROP TABLE or DROP VIEW,
|
||
each dependent view is processed one at a time, so the entire SQL statement
|
||
is not atomic.</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
<div class="section"><p>The following data definition statements are not atomic because
|
||
they involve more than one database operation:</p>
|
||
<ul><li>ALTER PROCEDURE</li>
|
||
<li>ALTER SEQUENCE</li>
|
||
<li>CREATE ALIAS</li>
|
||
<li>CREATE DISTINCT TYPE</li>
|
||
<li>CREATE FUNCTION</li>
|
||
<li>CREATE INDEX</li>
|
||
<li>CREATE PROCEDURE</li>
|
||
<li>CREATE SCHEMA</li>
|
||
<li>CREATE SEQUENCE</li>
|
||
<li>CREATE TABLE</li>
|
||
<li>CREATE TRIGGER</li>
|
||
<li>CREATE VIEW</li>
|
||
<li>DROP ALIAS</li>
|
||
<li>DROP DISTINCT TYPE</li>
|
||
<li>DROP FUNCTION</li>
|
||
<li>DROP PROCEDURE</li>
|
||
<li>DROP SCHEMA</li>
|
||
<li>DROP SEQUENCE</li>
|
||
<li>DROP TRIGGER</li>
|
||
<li>RENAME (See note 1)</li>
|
||
</ul>
|
||
<div class="note"><span class="notetitle">Note:</span> </div>
|
||
<ol><li>RENAME is atomic only if the name or the system name is changed. When
|
||
both are changed, the RENAME is not atomic.</li>
|
||
</ol>
|
||
</div>
|
||
<div class="section"><p>For example, a CREATE TABLE can be interrupted after the <span class="keyword">DB2<sup>®</sup> UDB for iSeries™</span> physical file has been created,
|
||
but before the member has been added. Therefore, in the case of create statements,
|
||
if an operation ends abnormally, you may need to drop the object and then
|
||
create it again. In the case of a DROP SCHEMA statement, you may need to drop
|
||
the schema again or use the CL command Delete Library (DLTLIB) to remove the
|
||
remaining parts of the schema.</p>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafydataintex.htm" title="Data integrity protects data from being destroyed or changed by unauthorized persons, system operation or hardware failures (such as physical damage to a disk), programming errors, interruptions before a job is completed (such as a power failure), or interference from running applications at the same time (such as serialization problems).">Data integrity</a></div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |