<?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>huojia &#187; DB2</title>
	<atom:link href="http://huojia.b.mumuyin.com/category/db2/feed/" rel="self" type="application/rss+xml" />
	<link>http://huojia.b.mumuyin.com</link>
	<description>又一个 木木茵博客(B.MuMuYin) Blog</description>
	<lastBuildDate>Thu, 26 Nov 2009 01:58:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Database War Extend To Hardware Market</title>
		<link>http://huojia.b.mumuyin.com/2009/09/13/database-war-extend-to-hardware-market/</link>
		<comments>http://huojia.b.mumuyin.com/2009/09/13/database-war-extend-to-hardware-market/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 07:56:42 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/2009/09/13/database-war-extend-to-hardware-market/</guid>
		<description><![CDATA[&#160;
 
Oracle 收购SUN以后，通常认为Sparc + Oracle&#160; Vs pSeries + DB2 会成为市场竞争的焦点。Oracle 在10月14日的 Oracle OpenWorld 上会努力证明Sun+Oracle的组合的竞争力。
在服务器市场开始成萎缩趋势的现在，不知道Oracle这种卖数据库+硬件的策略是否能成为一个黄金搭档。随着云计算的兴起，越来越多的客户并不希望自己来购买硬件服务器，而是更多的透过通过从ISV租赁服务的方式来实现传统的IT服务。
随着IBM Informaiton Ageda版图的日趋完整，IBM 与 Oracle 的战争将愈演愈烈。
Oracle 的战书：
PERFORMANCE
Sun + Oracle is faster.
Oracle and Sun together are hard to match. Just ask IBM. Its fastest server now runs an impressive 6 million TPC-C transactions, but on October 14 at Oracle OpenWorld, we&#8217;ll reveal the [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://huojia.b.mumuyin.com/files/2009/09/sun_performance_lg.gif"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="sun_performance_lg" src="http://huojia.b.mumuyin.com/files/2009/09/sun_performance_lg_thumb.gif" width="165" height="244" /></a> </p>
<p>Oracle 收购SUN以后，通常认为Sparc + Oracle&#160; Vs pSeries + DB2 会成为市场竞争的焦点。Oracle 在10月14日的 Oracle OpenWorld 上会努力证明Sun+Oracle的组合的竞争力。</p>
<p>在服务器市场开始成萎缩趋势的现在，不知道Oracle这种卖数据库+硬件的策略是否能成为一个黄金搭档。随着云计算的兴起，越来越多的客户并不希望自己来购买硬件服务器，而是更多的透过通过从ISV租赁服务的方式来实现传统的IT服务。</p>
<p>随着IBM Informaiton Ageda版图的日趋完整，IBM 与 Oracle 的战争将愈演愈烈。</p>
<p>Oracle 的战书：</p>
<p><strong>PERFORMANCE</strong></p>
<p><strong>Sun + Oracle is faster.</strong></p>
<p>Oracle and Sun together are hard to match. Just ask IBM. Its fastest server now runs an impressive 6 million TPC-C transactions, but on October 14 at Oracle OpenWorld, we&#8217;ll reveal the benchmark numbers that prove that even IBM DB2 running on IBM&#8217;s fastest hardware can&#8217;t match the speed and performance of Oracle Database on Sun systems. Check back on October 14 as we demonstrate Oracle&#8217;s commitment to Sun hardware and Sun SPARC.</p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2009/09/13/database-war-extend-to-hardware-market/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>深入学习DB2</title>
		<link>http://huojia.b.mumuyin.com/2009/08/05/db2-depth-study/</link>
		<comments>http://huojia.b.mumuyin.com/2009/08/05/db2-depth-study/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 12:11:47 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[闲言碎语]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/2009/08/05/db2-depth-study/</guid>
		<description><![CDATA[&#160;
1/ Everything You Wanted to Know About DB2 Universal Database Processes
Summary:&#160; Ever wonder what all those DB2 processes actually do? This article describes the processes that DB2 UDB uses on Linux, UNIX and Windows, discusses why you might need to understand these processes, and details their functions.
2/ DB2 9 self-tuning memory management
Starting in IBM® DB2® [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<h4>1/ Everything You Wanted to Know About DB2 Universal Database Processes</h4>
<p><b>Summary:</b>&#160; Ever wonder what all those DB2 processes actually do? This article describes the processes that DB2 UDB uses on Linux, UNIX and Windows, discusses why you might need to understand these processes, and details their functions.</p>
<p>2/ <a href="https://www6.software.ibm.com/developerworks/education/dm/dm0611read2/index.html">DB2 9 self-tuning memory management</a></p>
<p>Starting in IBM® DB2® 9, a new memory-tuning feature, self-tuning memory management, simplifies the task of memory configuration by automatically setting values for several memory configuration parameters. When enabled, the memory tuner dynamically distributes available memory resources among several memory consumers, including sorts, the package cache, the lock list, and buffer pools. In this tutorial, walk through a series of exercises to understand and learn how to administer this new feature.</p>
<p>本来是想把看过好多DB2深入学习文章给摘录一下的，最近忙于培训，无暇做了，先扔着吧</p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2009/08/05/db2-depth-study/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何得到DB2 Instance Owner Name</title>
		<link>http://huojia.b.mumuyin.com/2009/04/23/how-to-get-db2-instance-owner-name/</link>
		<comments>http://huojia.b.mumuyin.com/2009/04/23/how-to-get-db2-instance-owner-name/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 03:28:56 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/2009/04/23/how-to-get-db2-instance-owner-name/</guid>
		<description><![CDATA[Unix:

InstName is Represents the name of instance. The name of the instance must be the same as the name of the instance owning user. Specify the name of the instance owning user you created. The instance will be created in the instance owning user&#8217;s home directory. 

echo $DB2INSTANCE 能得到 owner name
&#160;
Windows:
到v95还是未知，据说v97的db2iinfo 可以得到，没实验过。

DB2INSTOWNER

Operating system: Windows 

Default: [...]]]></description>
			<content:encoded><![CDATA[<p>Unix:</p>
<p>
<dt><var>InstName is </var>Represents the name of instance. The name of the instance must be the same as the name of the instance owning user. Specify the name of the instance owning user you created. The instance will be created in the instance owning user&#8217;s home directory. </dt>
</p>
<p>echo $DB2INSTANCE 能得到 owner name</p>
<p>&#160;</p>
<p>Windows:</p>
<p>到v95还是未知，据说v97的db2iinfo 可以得到，没实验过。</p>
</p>
<dt>DB2INSTOWNER</dt>
<dd>
<p>Operating system: Windows </p>
<ul>
<li>Default: NULL </li>
<li>The registry variable created in the DB2 profile registry when the instance is first created. This variable is set to the name of the instance-owning machine. </li>
</ul>
</dd>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2009/04/23/how-to-get-db2-instance-owner-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solid DB</title>
		<link>http://huojia.b.mumuyin.com/2009/04/16/solid-db/</link>
		<comments>http://huojia.b.mumuyin.com/2009/04/16/solid-db/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 14:13:44 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/2009/04/16/solid-db/</guid>
		<description><![CDATA[&#160;
我原来一直以为Solide DB是关系型数据库的一种类型的名字，今天才知道这个Solid和DB中间有应该是连着的，称之为solidDB. 此数据库产品是solid公司开发的，该公司2008年被IBM收购，所以成为IBM solidDB。最近Lab里面做了好几次这样的讲座，都没有去听。最近听一个v97的培训的时候，老师特别单独拿出来给BP讲，也没听到，只有过了过PPT。
solidDB是所谓的内存数据库产品，特点是绝对的快，绝对的可接触和低投入。 貌似现在在DB2 z/OS 那边在加速使用这种技术来提高传统关系型数据库的性能。不知道有没有在MP上开始。有机会了解一下。
]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>我原来一直以为Solide DB是关系型数据库的一种类型的名字，今天才知道这个Solid和DB中间有应该是连着的，称之为solidDB. 此数据库产品是solid公司开发的，该公司2008年被IBM收购，所以成为IBM solidDB。最近Lab里面做了好几次这样的讲座，都没有去听。最近听一个v97的培训的时候，老师特别单独拿出来给BP讲，也没听到，只有过了过PPT。</p>
<p>solidDB是所谓的内存数据库产品，特点是绝对的快，绝对的可接触和低投入。 貌似现在在DB2 z/OS 那边在加速使用这种技术来提高传统关系型数据库的性能。不知道有没有在MP上开始。有机会了解一下。</p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2009/04/16/solid-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Collect DB2 JCC Trace</title>
		<link>http://huojia.b.mumuyin.com/2009/02/12/how-to-collect-db2-jcc-trace/</link>
		<comments>http://huojia.b.mumuyin.com/2009/02/12/how-to-collect-db2-jcc-trace/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 08:23:27 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/2009/02/12/how-to-collect-db2-jcc-trace/</guid>
		<description><![CDATA[Please collect a JCC Trace. Here are the instructions how to do this: 
1) If you are using the datasource, then use the datasource.setTraceFile(TRACEFILE) to enable tracing. 
2) If you are using DriverManger, the easiest way will be to set the logWriter on DriverManager before obtaining a connection.   &#160;&#160;&#160; For example:   [...]]]></description>
			<content:encoded><![CDATA[<p>Please collect a JCC Trace. Here are the instructions how to do this: </p>
<p>1) If you are using the datasource, then use the datasource.setTraceFile(TRACEFILE) to enable tracing. </p>
<p>2) If you are using DriverManger, the easiest way will be to set the logWriter on DriverManager before obtaining a connection.   <br />&#160;&#160;&#160; For example:    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DriverManager.setLogWriter(new PrintWriter(new FileOutputStream(&quot;trace.txt&quot;))); </p>
<p>3) You can also set the traceFile property on the URL. If traceFile property is specified, by default traceLevel is TRACE_ALL   <br />&#160;&#160;&#160; String databaseURL = &quot;jdbc:db2://hal:50000/sample:traceFile=c:/temp/foobar.txt;&quot; ; </p>
<p>Please see the following URLs for additional assistance :   <br /><a href="http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/cjvjcdig.htm">http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/cjvjcdig.htm</a>    <br /><a href="http://www.ibm.com/software/data/pubs/papers/sqlj">http://www.ibm.com/software/data/pubs/papers/sqlj</a> (Section 3.4 &#8211; Trace) </p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2009/02/12/how-to-collect-db2-jcc-trace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Collect a DB2 Trace</title>
		<link>http://huojia.b.mumuyin.com/2009/02/12/how-to-collect-a-db2-trace/</link>
		<comments>http://huojia.b.mumuyin.com/2009/02/12/how-to-collect-a-db2-trace/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 08:22:57 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/2009/02/12/how-to-collect-a-db2-trace/</guid>
		<description><![CDATA[Please collect a DB2 trace. Here are the instructions how to do this:   1) Minimize activity on the server.&#160; Ideally, only the application or query required should be performed while the trace is on.    2) Rename the db2diag.log and if possible upgrade diaglevel to 4 in the DBM CFG:  [...]]]></description>
			<content:encoded><![CDATA[<p>Please collect a DB2 trace. Here are the instructions how to do this:   <br />1) Minimize activity on the server.&#160; Ideally, only the application or query required should be performed while the trace is on.    <br />2) Rename the db2diag.log and if possible upgrade diaglevel to 4 in the DBM CFG:    <br />&#160;&#160;&#160; db2 update dbm cfg using diaglevel 4 </p>
<p>3) Start the trace:   <br />&#160;&#160;&#160; db2trc on -t -f XXXXX.dmp </p>
<p>4) Recreate the error&#160;&#160; -&#160;&#160; call the Stored procudure. </p>
<p>5) Turn off the trace:   <br />&#160;&#160;&#160; db2trc off </p>
<p>6) Format and flow the trace files:   <br />&#160;&#160;&#160; db2trc flw XXXXX.dmp XXXXX.flw    <br />&#160;&#160;&#160; db2trc fmt XXXXX.dmp XXXXX.fmt    <br />&#160;&#160;&#160; db2trc fmt -c XXXXX.dmp XXXXX.fmtc    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (At this stage, the traces should not wrap.)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Example of a good trace:    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Trace truncated&#160;&#160;&#160;&#160; : NO    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Trace wrapped&#160;&#160;&#160;&#160;&#160;&#160; : NO    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if trace continues to wrap, please contact me and we can determine whether the trace is usable or not. </p>
<p>7) From the above files generated, you would need to provide us with the .dmp, .flw, .fmt, .fmtc, and db2diag.log files. </p>
<p> <img src='http://huojia.b.mumuyin.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Tar or zip the files.&#160; To tar do:   <br />&#160;&#160;&#160;&#160;&#160;&#160; tar -cvf xxxxx.yyy.zzz.files.tar&#160; &lt;list of files separated by spaces&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160; compress xxxxx.yyy.zzz.files.tar    <br />&#160;&#160;&#160;&#160;&#160;&#160; Then send the xxxxx.yyy.zzz.files.tar.Z </p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2009/02/12/how-to-collect-a-db2-trace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 Programming Considerations</title>
		<link>http://huojia.b.mumuyin.com/2008/12/01/db2-programming-considerations/</link>
		<comments>http://huojia.b.mumuyin.com/2008/12/01/db2-programming-considerations/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 04:39:52 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/?p=403</guid>
		<description><![CDATA[The capabilities that you need to consider include:

Accessing the data using:

Embedded SQL
Call Level Interface (CLI)
Restructured Extended Executor Language (REXX)
Query products


Controlling data values using:

Data types (built-in or user-defined)
Table check constraints
Referential integrity constraints
Views using the CHECK OPTION
Application logic and variable types


Controlling the relationship between data values using:

Referential integrity constraints
Triggers
Application logic


Executing programs at the server using:

Stored procedures
User-defined functions
Triggers.



]]></description>
			<content:encoded><![CDATA[<p>The capabilities that you need to consider include:</p>
<ul>
<li>Accessing the data using:
<ul>
<li>Embedded SQL</li>
<li>Call Level Interface (CLI)</li>
<li>Restructured Extended Executor Language (REXX)</li>
<li>Query products</li>
</ul>
</li>
<li>Controlling data values using:
<ul>
<li>Data types (built-in or user-defined)</li>
<li>Table check constraints</li>
<li>Referential integrity constraints</li>
<li>Views using the CHECK OPTION</li>
<li>Application logic and variable types</li>
</ul>
</li>
<li>Controlling the relationship between data values using:
<ul>
<li>Referential integrity constraints</li>
<li>Triggers</li>
<li>Application logic</li>
</ul>
</li>
<li>Executing programs at the server using:
<ul>
<li>Stored procedures</li>
<li>User-defined functions</li>
<li>Triggers.</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2008/12/01/db2-programming-considerations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何确定DB2 instance 对应的fence user</title>
		<link>http://huojia.b.mumuyin.com/2008/11/19/how-to-determine-the-db2-instance-corresponding-to-the-fence-user/</link>
		<comments>http://huojia.b.mumuyin.com/2008/11/19/how-to-determine-the-db2-instance-corresponding-to-the-fence-user/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 08:59:37 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/?p=391</guid>
		<description><![CDATA[$ more ~db2inst1/sqllib/ctrl/.fencedID
db2fenc1
]]></description>
			<content:encoded><![CDATA[<p>$ more ~db2inst1/sqllib/ctrl/.fencedID<br />
db2fenc1</p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2008/11/19/how-to-determine-the-db2-instance-corresponding-to-the-fence-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 1042c Error</title>
		<link>http://huojia.b.mumuyin.com/2008/09/25/db2-1042c-error/</link>
		<comments>http://huojia.b.mumuyin.com/2008/09/25/db2-1042c-error/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 01:07:11 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/?p=353</guid>
		<description><![CDATA[db2 start 遇到 SQL1042c 错误，检查发现打了Fixpack后，没有升级instance.
* To update the instance to acquire a configuration or access to
function run DB2IUPDT &#60;InstName&#62;.
* If the error occurred while trying to connect to a database, get a
trace (instructions below) and call IBM support.
]]></description>
			<content:encoded><![CDATA[<p>db2 start 遇到 SQL1042c 错误，检查发现打了Fixpack后，没有升级instance.</p>
<p><strong>* To update the instance to acquire a configuration or access to<br />
function run DB2IUPDT &lt;InstName&gt;.</strong><br />
* If the error occurred while trying to connect to a database, get a<br />
trace (instructions below) and call IBM support.</p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2008/09/25/db2-1042c-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 环境 设置</title>
		<link>http://huojia.b.mumuyin.com/2008/08/04/db2-environment-settings/</link>
		<comments>http://huojia.b.mumuyin.com/2008/08/04/db2-environment-settings/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 12:49:24 +0000</pubDate>
		<dc:creator>huojia</dc:creator>
				<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://mumuyin.com:8000/?p=313</guid>
		<description><![CDATA[设置 DB2 环境
恰当地设置 DB2 环境非常重要，这是因为它控制着 DB2 操作和活动的方式。DB2 环境由以下几部分构成：

 DB2 配置文件注册库
 操作系统环境变量
 DB2 数据库管理器配置参数
 DB2 数据库配置参数

























设置配置文件注册库
DB2 配置文件注册库是特定于 DB2 的变量，它会影响 DB2 系统的管理、配置与性能。为使 DB2 配置文件注册库的更改生效，您通常需要停止并重启实例。
要列举所支持的全部 DB2 配置文件注册库：




db2set -lr




要设置 DB2 配置文件注册库：




db2set  registry_variable = value




请注意，在变量名、等号和变量值之间没有空格。下面给出一个将 DB2COMM 注册库变量设置为单一值的示例：




 db2set DB2COMM=TCPIP




将 DB2COMM 注册库变量设置为多个值的示例如下：




 db2set DB2COMM=TCPIP,NPIPE,LOCAL




要将 DB2 配置文件注册库重置为默认值，只需使用与上面相同的命令即可，但不指定任何值：




 db2set  registry_variable =




要显示服务器上当前设置的所有 DB2 配置文件注册库，请执行以下命令：




 db2set -all




您将看到形式如下的输出结果：




[e] DB2PATH=C:\Program Files\IBM\SQLLIB_01
[i] DB2ACCOUNTNAME=IBM-TP101\dwsnow
[i] DB2INSTOWNER=IBM-SB2QTSR5RSN
[i] DB2PORTRANGE=60001:60004
[i] DB2INSTPROF=C:\PROGRA~1\IBM\SQLLIB~1
[i] [...]]]></description>
			<content:encoded><![CDATA[<p><a name="N10203"><span class="smalltitle">设置 DB2 环境</span></a></p>
<p>恰当地设置 DB2 环境非常重要，这是因为它控制着 DB2 操作和活动的方式。DB2 环境由以下几部分构成：</p>
<ul>
<li> DB2 配置文件注册库</li>
<li> 操作系统环境变量</li>
<li> DB2 数据库管理器配置参数</li>
<li> DB2 数据库配置参数</li>
</ul>
<p><span id="more-313"></span></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="https://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="https://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table class="no-print" border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="https://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="https://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="N10221"><span class="smalltitle">设置配置文件注册库</span></a></p>
<p>DB2 配置文件注册库是特定于 DB2 的变量，它会影响 DB2 系统的管理、配置与性能。为使 DB2 配置文件注册库的更改生效，您通常需要停止并重启实例。</p>
<p>要列举所支持的全部 DB2 配置文件注册库：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>db2set -lr</pre>
</td>
</tr>
</tbody>
</table>
<p>要设置 DB2 配置文件注册库：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>db2set  registry_variable = value</pre>
</td>
</tr>
</tbody>
</table>
<p>请注意，在变量名、等号和变量值之间没有空格。下面给出一个将 DB2COMM 注册库变量设置为单一值的示例：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre> db2set DB2COMM=TCPIP</pre>
</td>
</tr>
</tbody>
</table>
<p>将 DB2COMM 注册库变量设置为多个值的示例如下：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre> db2set DB2COMM=TCPIP,NPIPE,LOCAL</pre>
</td>
</tr>
</tbody>
</table>
<p>要将 DB2 配置文件注册库重置为默认值，只需使用与上面相同的命令即可，但不指定任何值：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre> db2set  registry_variable =</pre>
</td>
</tr>
</tbody>
</table>
<p>要显示服务器上当前设置的所有 DB2 配置文件注册库，请执行以下命令：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre> db2set -all</pre>
</td>
</tr>
</tbody>
</table>
<p>您将看到形式如下的输出结果：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>[e] DB2PATH=C:\Program Files\IBM\SQLLIB_01
[i] DB2ACCOUNTNAME=IBM-TP101\dwsnow
[i] DB2INSTOWNER=IBM-SB2QTSR5RSN
[i] DB2PORTRANGE=60001:60004
[i] DB2INSTPROF=C:\PROGRA~1\IBM\SQLLIB~1
[i] DB2COMM=TCPIP,NPIPE,LOCAL
[g] DB2_EXTSECURITY=YES
[g] DB2SYSTEM=IBM-TP101
[g] DB2PATH=C:\Program Files\IBM\SQLLIB_01
[g] DB2INSTDEF=DB2V</pre>
</td>
</tr>
</tbody>
</table>
<p>方括号（<code> []</code>）中包含的标记表示注册库配置文件的作用域，具体解释如下：</p>
<ul>
<li> <code> [e]</code> 表示为当前会话或环境所设置的注册库</li>
<li> <code> [u]</code> 表示用户级注册库</li>
<li> <code> [n]</code> 表示节点级注册库</li>
<li> <code> [i]</code> 表示实例级注册库</li>
<li> <code> [g]</code> 表示全局级注册库</li>
</ul>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="https://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="https://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table class="no-print" border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="https://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="https://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="N10297"><span class="smalltitle">设置系统环境变量</span></a></p>
<p>绝大多数 DB2 环境设置都是由 DB2 配置文件注册库控制的。而那些未存储在配置文件注册库中的设置称为<em>操作系统环境变量</em>。设置系统变量的命令将根据您所使用的平台及 UNIX shell 而有所不同。</p>
<p>下面给出几个示例：</p>
<ul>
<li>在 Windows 中：<code> set DB2INSTANCE=PROD</code></li>
<li> 在 Linux 和 UNIX 的 Korn shell 中： 			       <code> export DB2INSTANCE=PROD</code></li>
</ul>
<p><em> DB2INSTANCE</em> 是一个需要掌握的重要系统变量。它指定当前应用程序的会话或窗口的默认 DB2 实例。一旦设置好该变量，后续的所有 DB2 命令都将在该实例的作用域内执行。</p>
<p>要了解您当前工作在哪个 DB2 实例中，可运行以下 DB2 命令：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>get instance</pre>
</td>
</tr>
</tbody>
</table>
<p>举个例子，为此，您只要运行以下命令即可：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>db2 get instance</pre>
</td>
</tr>
</tbody>
</table>
<p>此命令的输出结果形式如下：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>The current database manager instance is:  DB2V</pre>
</td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="https://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="https://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table class="no-print" border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="https://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="https://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="N102D4"><span class="smalltitle">设置配置参数</span></a></p>
<p>在 DB2 中，存在两个配置 “级别”。在<em>实例</em>（或数据库管理器）级别，您可为该实例配置整个 DB2 环境，这将影响实例中的所有数据库和使用该实例中数据库的所有应用程序。在<em>数据库</em> 级别，您可配置参数，而这些参数将影响到访问特定数据库的所有应用程序的行为。关于参数的更多信息，请参阅 <a href="http://www.ibm.com/developerworks/edu/dm-dw-db2-cert7314.html&amp;S_TACT=105AGX19&amp;S_CMP=db2cert?S_TACT=105AGX52&amp;S_CMP=cn-t-db2">Monitoring DB2 activity</a> 教程。数据库管理器、数据库配置参数及其值均可使用 DB2 Control Center 或 DB2 命令查看及设置。</p>
<p>在 Control Center 中，右击需要配置或更改的实例或数据库，选择 <strong>Configure Parameters</strong>。您将看到一个配置参数的列表，并带有简短的描述、其当前及挂起值.</p>
<p>您还可通过使用如下 DB2 命令获得相同的输出结果：</p>
<table border="1" cellspacing="0" cellpadding="5" width="70%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>db2 get database manager configuration
db2 get database configuration for  database_name</pre>
</td>
</tr>
</tbody>
</table>
<p>要更新 Control Center 中数据库管理器或数据库配置参数的值，打开 DBM 或 DB Configuration 窗口。找到您想要更改的参数，然后双击其值。单击 <strong>&#8216;&#8230;&#8217;</strong> 图标将打开一个包含如何设置变量的提示以及允许范围说明的窗体。</p>
<p>若参数值可立即或动态更改，则在您单击 <strong>OK</strong> 后，更改立即生效。部分重要性较低的参数无法动态更改，在这种情况下，您将看到其当前值与挂起值不同。挂起值是新值，将在该实例或数据库下一次停止并重启后应用。<strong>Pending Value Effective</strong> 列告诉您新值将在何时生效。</p>
<p>也可使用以下命令来设置您的数据库管理器或数据库配置参数的值：</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>db2 update database manager configuration using  parameter new_value
db2 update database configuration for  database_name using  parameter new_value</pre>
</td>
</tr>
</tbody>
</table>
<p>若您所指定的参数更改不能立即生效，则在您运行了 update db/dbm configuration 命令后，将返回形式如下的警告消息：</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre> SQL1362W One or more of the parameters submitted for immediate modification
were not changed dynamically. Client changes will not be effective until the next time
the application is started or the TERMINATE command has been issued.  Server changes
will not be effective until the next DB2START command.</pre>
</td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="https://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="https://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table class="no-print" border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="https://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="https://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="N1032B"><span class="smalltitle">联机设置配置参数</span></a></p>
<p>绝大多数配置参数均可在实例或数据库保持运行的情况下联机设置。只要可能，对这些联机配置参数的更改默认为立即生效。例如，若更改了 <code>sortheap</code> 的值，所有新的 SQL 请求将使用新值。为显式指定这种立即生效的行为，可将 <code> immediate</code> 关键字附加到 <code>update</code> 命令中：</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>db2 update database manager configuration using  parameter new_value
                     immediate
db2 update database configuration for  database_name using
      parameter new_value
                     immediate</pre>
</td>
</tr>
</tbody>
</table>
<p>若您选择将此更改延迟至实例重启或数据库激活时，则应指定 <code>deferred</code> 关键字：</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>db2 update database manager configuration using parameter new_value
                     deferred
db2 update database configuration for database_name using
   parameter new_value
                     deferred</pre>
</td>
</tr>
</tbody>
</table>
<p>有时，您可能希望找出已确定并延迟了哪些更改。为显示数据库管理器配置参数的当前值和挂起值，首先进入实例，然后在 <code> get database manager configuration</code> 命令中指定 <code> show detail</code> 选项，方法如下（请注意，<em>instance_name</em> 是系统环境变量 <em>DB2INSTANCE</em> 设置的值）：</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>  db2 attach to  instance_name
  db2 get database manager configuration  show detail</pre>
</td>
</tr>
</tbody>
</table>
<p>同样地，要列举数据库配置参数的当前值和挂起值，首先连接到数据库，然后使用 <code> show detail</code> 选项：</p>
<table border="1" cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee">
<tbody>
<tr>
<td>
<pre>  db2 connect to  database_name
  db2 get database configuration for  database_name
                     show detail</pre>
</td>
</tr>
</tbody>
</table>
<p>挂起值列于 <strong>Delayed Value</strong> 列中，如下所示。</p>
]]></content:encoded>
			<wfw:commentRss>http://huojia.b.mumuyin.com/2008/08/04/db2-environment-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
