<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DBAlife &#187; 约束</title>
	<atom:link href="http://www.dbalife.com/archives/tag/%e7%ba%a6%e6%9d%9f/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbalife.com</link>
	<description>网站系统架构实践</description>
	<lastBuildDate>Wed, 27 Jul 2011 09:57:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>禁用/启用所有外键约束</title>
		<link>http://www.dbalife.com/archives/383.html</link>
		<comments>http://www.dbalife.com/archives/383.html#comments</comments>
		<pubDate>Sat, 06 Feb 2010 16:01:14 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[DBA脚本]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[数据库管理]]></category>
		<category><![CDATA[fk]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[启用]]></category>
		<category><![CDATA[外键]]></category>
		<category><![CDATA[禁用]]></category>
		<category><![CDATA[约束]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=383</guid>
		<description><![CDATA[1、ORACLE数据库中的外键约束名都在表user_constraints中可以查到。其中constraint_type='R'表示是外键约束。 2、启用外键约束的命令为：alter table table_name enable constraint constraint_name 3、禁用外键约束的命令为：alter table table_name disable constraint constraint_name 4、然后再用SQL查出数据库中所以外键的约束名： select 'alter table '&#124;&#124;table_name&#124;&#124;' enable constraint '&#124;&#124;constraint_name&#124;&#124;';' from user_constraints where constraint_type='R' select 'alter table '&#124;&#124;table_name&#124;&#124;' disable constraint '&#124;&#124;constraint_name&#124;&#124;';' from user_constraints where constraint_type='R' Related posts: oralce10g shrink drop table遭遇ORA-604 / ORA-1422 Oracle9i优化器介绍（下）
Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/286.html' rel='bookmark' title='oralce10g shrink'>oralce10g shrink</a></li>
<li><a href='http://www.dbalife.com/archives/128.html' rel='bookmark' title='drop table遭遇ORA-604 / ORA-1422'>drop table遭遇ORA-604 / ORA-1422</a></li>
<li><a href='http://www.dbalife.com/archives/32.html' rel='bookmark' title='Oracle9i优化器介绍（下）'>Oracle9i优化器介绍（下）</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>1、ORACLE数据库中的外键约束名都在表user_constraints中可以查到。其中constraint_type='R'表示是外键约束。</p>
<p>2、启用外键约束的命令为：alter table table_name enable constraint constraint_name</p>
<p>3、禁用外键约束的命令为：alter table table_name disable constraint constraint_name</p>
<p>4、然后再用SQL查出数据库中所以外键的约束名：</p>
<p>select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R'</p>
<p>select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R'</p>
<p>Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/286.html' rel='bookmark' title='oralce10g shrink'>oralce10g shrink</a></li>
<li><a href='http://www.dbalife.com/archives/128.html' rel='bookmark' title='drop table遭遇ORA-604 / ORA-1422'>drop table遭遇ORA-604 / ORA-1422</a></li>
<li><a href='http://www.dbalife.com/archives/32.html' rel='bookmark' title='Oracle9i优化器介绍（下）'>Oracle9i优化器介绍（下）</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/383.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

