ibm-information-center/dist/eclipse/plugins/i5OS.ic.dbp_5.4.0.1/rbaforzahfrcy.htm

101 lines
6.5 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="Enable or disable referential constraints" />
<meta name="abstract" content="You can enable or disable a referential constraint using the Change Physical File Constraint (CHGPFCST) command or iSeries Navigator." />
<meta name="description" content="You can enable or disable a referential constraint using the Change Physical File Constraint (CHGPFCST) command or iSeries Navigator." />
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrca.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/chgpfcst.htm" />
<meta name="DC.Relation" scheme="URI" content="../rzatc/rzatcgetstartinav.htm" />
<meta name="DC.Relation" scheme="URI" content="../sqlp/rbafykickoff.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/alcobj.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/dlcobj.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="rbaforzahfrcy" />
<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>Enable or disable referential constraints</title>
</head>
<body id="rbaforzahfrcy"><a name="rbaforzahfrcy"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Enable or disable referential constraints</h1>
<div><p>You can enable or disable a referential constraint using the Change
Physical File Constraint (CHGPFCST) command or iSeries™ Navigator.</p>
<p>To enable or disable a referential constraint relationship, use the CHGPFCST
command. You must specify the dependent file when changing a referential constraint;
you cannot disable or enable a constraint by specifying the parent file.</p>
<p>You can also enable or disable a referential constraint using iSeries Navigator. </p>
<p>You must have a minimum of object management authority (or ALTER privilege)
to the dependent file in order to enable or disable a constraint.</p>
<div class="section" id="rbaforzahfrcy__rbaforzahfrcz"><a name="rbaforzahfrcy__rbaforzahfrcz"><!-- --></a><h4 class="sectiontitle">Details: Enable or disable referential
constraints</h4><p>When the system enables or disables a constraint, it
locks the parent and the dependent files, both members, and both access paths.
It removes the locks when the enable or disable operation is complete.</p>
<p>Attempting
to enable an enabled constraint or disable a disabled constraint does nothing
but cause the issuance of an informational message.</p>
<p>An established/disabled
or check pending constraint relationship can be enabled. The enabling causes
the system to verify the constraint again. If verification finds mismatches
between the parent and the foreign keys, the constraint is marked as check
pending.</p>
<p>Disabling a constraint relationship allows all file input/output
(I/O) operations for both the parent and the dependent files, if the user
has the correct authority. The entire infrastructure of the constraint remains.
The parent key and the foreign key access paths are still maintained. However,
there is no referential enforcement that is performed for the two files in
the disabled relationship. All remaining enabled constraints are still enforced.</p>
<div class="p">Disabling
a constraint can allow file I/O operations in performance-critical situations
to run faster. Always consider the trade-off in this kind of a situation.
The file data can become referentially not valid. When the constraint is enabled,
depending on the file size, the system will take time to re-verify the referential
constraint relationship. <div class="note"><span class="notetitle">Note:</span> Users and applications must be cautious when
modifying files with a constraint relationship in the established and disabled
state. Relationships can be violated and not detected until the constraint
is enabled again.</div>
</div>
<p>The Allocate Object (ALCOBJ) command can allocate
(lock) files while a constraint relationship is disabled. This allocation
prevents others from changing the files while this referential constraint
relationship is disabled. Specify a lock state of Exclusive read (*EXCLRD)
on the command so other users can read the files. After the constraint is
enabled again, the Deallocate Object (DLCOBJ) command unlocks the files.</p>
<p>When
you enable or disable multiple constraints, they are processed sequentially.
If a constraint cannot be modified, you receive a diagnostic message, and
the function proceeds to the next constraint in the list. When all constraints
have been processed, you receive a completion message listing the number of
constraints modified.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbaforzahfrca.htm" title="These topics discuss how to use referential constraints in your database to ensure that it contains only valid data.">Ensure data integrity with referential constraints</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../rzatc/rzatcgetstartinav.htm">Get started with iSeries Navigator</a></div>
<div><a href="../sqlp/rbafykickoff.htm">SQL programming</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="../cl/chgpfcst.htm">Change Physical File Constraint (CHGPFCST) command</a></div>
<div><a href="../cl/alcobj.htm">Allocate Object (ALCOBJ) command</a></div>
<div><a href="../cl/dlcobj.htm">Deallocate Object (DLCOBJ) command</a></div>
</div>
</div>
</body>
</html>