<?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>天道酬勤 &#187; gateway</title>
	<atom:link href="http://www.ochef.net/tag/gateway/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ochef.net</link>
	<description>Oracle and My Life</description>
	<lastBuildDate>Mon, 09 Jan 2012 05:39:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configure Ora11gR2 T-gateway for DB2UDB</title>
		<link>http://www.ochef.net/2009/11/configure-ora11gr2-t-gateway-for-db2udb.html</link>
		<comments>http://www.ochef.net/2009/11/configure-ora11gr2-t-gateway-for-db2udb.html#comments</comments>
		<pubDate>Sat, 14 Nov 2009 13:28:39 +0000</pubDate>
		<dc:creator>ochef</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[11gR2]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[gateway]]></category>

		<guid isPermaLink="false">http://www.ochef.net/?p=704</guid>
		<description><![CDATA[Oracle使用Generic Heterogeneous Services和Transparent Gateways两种方式访问non-oracle 数据库系统，前者是使用不同数据源的ODBC驱动访问，后者使用各自的native driver访问，这里主要说说Gateway。 测试环境：DB2：OEL5.3 + DB2UDB 9.7 ORACLE：OEL5.3 + Oracle 11.2 可以看到，11gR2确实有了更多人性化的东西，除了安装RDBMS时的“Fix &#38; Check Again”功能外，在安装透明网关时也比之前的版本更方便，需要手工配置的地方越来越少，充分体现了User love simplicity。 在安装完gateway之后，在$ORACLE_HOME目录下会有一个dg4db2/admin的文件夹(目录命名发生了点变化，以前为：tg4drda)，有三个模板文件：initdg4db2.ora、listener.ora.sample、tnsnames.ora.sample。复制一份initdg4db2.ora文件命名为initdb2inst1.ora（db2inst1为db2的实例名）。打开initdb2inst1.ora配置如下参数： HS_FDS_CONNECT_INFO=[ochef.db2]:50000/sample,LUW HS_FDS_TRACE_LEVEL=OFF HS_FDS_RECOVERY_ACCOUNT=RECOVER HS_FDS_RECOVERY_PWD=RECOVER HS_TRANSACTION_MODEL=COMMIT_CONFIRM HS_FDS_TRANSACTION_ISOLATION=READ_COMMITTED HS_FDS_SUPPORT_STATISTICS=TRUE HS_FDS_RESULTSET_SUPPORT=FALSE HS_FDS_PACKAGE_COLLID=ORACLEGTW HS_IDLE_TIMEOUT=0 以上参数基本上不用修改，都是在安装时在上图中填写的参数值自动生成。将listener.ora.sample、tnsnames.ora.sample文件中的内容分别添加到$ORACLE_HOME/network/admin下对应的listener.ora和tnsnames.ora文件。具体内容如下： Listener.ora文件中添加如下内容： SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (SID_NAME=db2inst1) (ORACLE_HOME=/u01/app/oracle/product/11.2.0) (PROGRAM=dg4db2) ) ) tnsnames.ora文件，添加如下内容： db2inst1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ochef.11g)(PORT [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-db2-9-1-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install DB2 9.1 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fdb2_vs_oracle_01.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DB2对比Oracle学习系列之:instance &amp; database concepts</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Foracle-database-11g-r2-for-linux-released.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle Database 11g R2 for Linux Released</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Finstall-and-configure-db2-v9-7-client-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install and configure DB2 V9.7 client for linux</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Oracle使用Generic Heterogeneous Services和Transparent Gateways两种方式访问non-oracle 数据库系统，前者是使用不同数据源的ODBC驱动访问，后者使用各自的native driver访问，这里主要说说Gateway。<br />
测试环境：DB2：OEL5.3 + DB2UDB 9.7    ORACLE：OEL5.3 + Oracle 11.2<br />
可以看到，11gR2确实有了更多人性化的东西，除了安装RDBMS时的“<span style="color: #ff0000;">Fix &amp; Check Again</span>”功能外，在安装透明网关时也比之前的版本更方便，需要手工配置的地方越来越少，充分体现了User love simplicity。</p>
<p><img class="alignnone size-medium wp-image-705" title="dg4db2" src="http://www.ochef.net/wp-content/uploads/2009/11/dg4db2-300x141.jpg" alt="dg4db2" width="300" height="141" /></p>
<p>在安装完gateway之后，在$ORACLE_HOME目录下会有一个<span style="color: #ff0000;">dg</span><span style="color: #ff0000;">4db2</span>/admin的文件夹(目录命名发生了点变化，以前为：tg4drda)，有三个模板文件：initdg4db2.ora、listener.ora.sample、tnsnames.ora.sample。复制一份initdg4db2.ora文件命名为init<span style="color: #ff0000;">db2inst1</span>.ora（db2inst1为db2的实例名）。打开initdb2inst1.ora配置如下参数：</p>
<blockquote><p>HS_FDS_CONNECT_INFO=[ochef.db2]:50000/sample,LUW</p>
<p>HS_FDS_TRACE_LEVEL=OFF</p>
<p>HS_FDS_RECOVERY_ACCOUNT=RECOVER</p>
<p>HS_FDS_RECOVERY_PWD=RECOVER</p>
<p>HS_TRANSACTION_MODEL=COMMIT_CONFIRM</p>
<p>HS_FDS_TRANSACTION_ISOLATION=READ_COMMITTED</p>
<p>HS_FDS_SUPPORT_STATISTICS=TRUE</p>
<p>HS_FDS_RESULTSET_SUPPORT=FALSE</p>
<p>HS_FDS_PACKAGE_COLLID=ORACLEGTW</p>
<p>HS_IDLE_TIMEOUT=0</p></blockquote>
<p>以上参数基本上不用修改，都是在安装时在上图中填写的参数值自动生成。将listener.ora.sample、tnsnames.ora.sample文件中的内容分别添加到$ORACLE_HOME/network/admin下对应的listener.ora和tnsnames.ora文件。具体内容如下：</p>
<p>Listener.ora文件中添加如下内容：</p>
<blockquote><p>SID_LIST_LISTENER=</p>
<p>(SID_LIST=</p>
<p>(SID_DESC=</p>
<p>(SID_NAME=db2inst1)</p>
<p>(ORACLE_HOME=/u01/app/oracle/product/11.2.0)</p>
<p>(PROGRAM=dg4db2)</p>
<p>)</p>
<p>)</p></blockquote>
<p>tnsnames.ora文件，添加如下内容：</p>
<blockquote><p>db2inst1 =</p>
<p>(DESCRIPTION =</p>
<p>(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ochef.11g)(PORT = 1521)))</p>
<p>(CONNECT_DATA =  (SID = db2inst1))</p>
<p>(hs = ok)</p>
<p>)</p></blockquote>
<p>启动监听</p>
<p>[oracle@ochef ~]$ lsnrctl start</p>
<p>创建dblink连接db2的数据库实例db2inst1</p>
<p>[oracle@ochef ~]$ sqlplus “/as sysdba”</p>
<p>SQL&gt; create public database link ora4db2 connect to db2inst1 identified by db2inst1  using &#8216;db2inst1&#8242;;</p>
<p>检查db2link ora4db2是否连接成功：</p>
<p>SQL&gt;select * from db2inst1.employee@ora4db2;</p>
<p>SQL&gt; select count(*) from db2inst1.employee@ora4db2;</p>
<p>COUNT(*)</p>
<p>&#8212;&#8212;&#8212;-</p>
<p>42</p>
<p>Simple无处不在。</p>
<p>-The End-</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-db2-9-1-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install DB2 9.1 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fdb2_vs_oracle_01.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DB2对比Oracle学习系列之:instance &amp; database concepts</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Foracle-database-11g-r2-for-linux-released.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle Database 11g R2 for Linux Released</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Finstall-and-configure-db2-v9-7-client-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F11%2Fconfigure-ora11gr2-t-gateway-for-db2udb.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install and configure DB2 V9.7 client for linux</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.ochef.net/2009/11/configure-ora11gr2-t-gateway-for-db2udb.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

