<?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; 透明网关</title>
	<atom:link href="https://www.xifenfei.com/tag/%e9%80%8f%e6%98%8e%e7%bd%91%e5%85%b3/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Wed, 04 Nov 2026 15:33:30 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>oracle to sql 透明网络配置</title>
		<link>https://www.xifenfei.com/2020/01/oracle-to-sql-gateway.html</link>
		<comments>https://www.xifenfei.com/2020/01/oracle-to-sql-gateway.html#comments</comments>
		<pubDate>Thu, 09 Jan 2020 09:20:38 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[oracle 访问sql]]></category>
		<category><![CDATA[透明网关]]></category>
		<category><![CDATA[透明网关 oracle sql]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=8424</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2020/01/oracle-to-sql-gateway.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2020/01/oracle-to-sql-gateway.html" target="_blank">oracle to sql 透明网络配置</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>一直比较抵触oracle 透明网关,最近有朋友说他们客户坚持要使用这个(不想修改程序),无奈之下进行了配置.<br />
<strong>透明网关需求</strong><br />
Oracle透明网关链接sqlserver<br />
<br />
Oracle：<br />
OS：Red Hat Enterprise Linux Server release 6.8<br />
DB：Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 &#8211; 64bit<br />
Ip：192.168.222.11<br />
<br />
Sqlserver<br />
OS：windows server 2003 x86<br />
DB：sqlserver2005<br />
IP：192.168.222.1<br />
实例名称：MSSQLSERVER<br />
指向的DB：xifenfei<br />
<br />
<strong>安装 Gateway软件</strong><br />
使用oracle用户安装，并且使用空目录(不建议使用oracle_home目录)<br />
配置oracle_base和oracle_home<br />
ORACLE_BASE=/u01/app/oracle<br />
ORACLE_HOME=/u01/app/oracle/product/11.2.0/wangguan<br />
<a href="//www.xifenfei.com/wp-content/uploads/2020/01/1.jpg"><img src="//www.xifenfei.com/wp-content/uploads/2020/01/1.jpg" alt="1" width="558" height="434" class="alignnone size-full wp-image-8425" /></a><br />
<a href="//www.xifenfei.com/wp-content/uploads/2020/01/2.jpg"><img src="//www.xifenfei.com/wp-content/uploads/2020/01/2.jpg" alt="2" width="555" height="419" class="alignnone size-full wp-image-8426" /></a><br />
<hr />
<strong>配置Gateway数据库连接信息</strong></p>
<pre class="brush: bash; title: ; notranslate">
[oracle@ora11g admin]$ pwd
/u01/app/oracle/product/11.2.0/wangguan/dg4msql/admin
[oracle@ora11g admin]$  cat initdg4msql.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server

#
# HS init parameters
#
HS_FDS_CONNECT_INFO=[192.168.222.1]:1433//xifenfei
# alternate connect format is hostname/serverinstance/databasename
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
</pre>
<p><strong>配置Gateway监听配置</strong></p>
<pre class="brush: bash; title: ; notranslate">
[oracle@ora11g admin]$ pwd
/u01/app/oracle/product/11.2.0/wangguan/network/admin
[oracle@ora11g admin]$ cat listener.ora 
# Generated by Oracle configuration tools.

LISTENERSQL =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora11g)(PORT = 1522))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    )
  )
SID_LIST_LISTENERSQL =
  (SID_LIST =
    (SID_DESC=
      (SID_NAME = dg4msql)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/wangguan)
      (PROGRAM = dg4msql)
    )
  )
ADR_BASE_LISTENERSQL = /u01/app/oracle

</pre>
<p><strong>配置Gateway tns信息</strong><br />
在oracle数据库的oracle_home中配置,如果有设置tns_admin,在该目录下处理</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@ora11g admin]$ pwd
/u01/app/oracle/product/11.2.0/db_1/network/admin
[oracle@ora11g admin]$ cat tnsnames.ora 
# Generated by Oracle configuration tools.

tomssql =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.222.11)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = dg4msql)
    )
     (HS = OK)
  )
[oracle@ora11g admin]$ tnsping tomssql

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 09-JAN-2020 09:10:06

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.222.11)(PORT = 1522)) 
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dg4msql)) (HS = OK))
OK (20 msec)</pre>
<p><strong>创建dblink to sql</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; create public database link to_sql2012 connect to sa identified by &quot;sa&quot; using 'tomssql';

Database link created.
</pre>
<p><strong>验证Gateway </strong><br />
sql server中查询<br />
<a href="//www.xifenfei.com/wp-content/uploads/2020/01/3.jpg"><img src="//www.xifenfei.com/wp-content/uploads/2020/01/3.jpg" alt="3" width="548" height="340" class="alignnone size-full wp-image-8427" /></a><br />
<hr />
oracle 通过gateway查询<br />
<a href="//www.xifenfei.com/wp-content/uploads/2020/01/4.jpg"><img src="//www.xifenfei.com/wp-content/uploads/2020/01/4.jpg" alt="4" width="562" height="270" class="alignnone size-full wp-image-8428" /></a><br />
<hr />
至此oracle to sql server Gateway 配置成功.如果需要配置多个$ORACLE_HOME/dg4msql/admin/init网关SID.ora文件并新增多个静态监听和tns指向网关SID即可</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/03/tns-12518.html" rel="bookmark" class="crp_title">TNS-12518: TNS:listener could not hand off client connection</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/%e6%8f%90%e9%ab%98%e7%9f%ad%e8%bf%9e%e6%8e%a5%e6%80%a7%e8%83%bd%e6%96%b9%e6%b3%95%e6%b5%8b%e8%af%95.html" rel="bookmark" class="crp_title">提高短连接性能方法测试</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/10/dns%e8%a7%a3%e6%9e%90%e5%af%bc%e8%87%b4opiodr-aborting-process-unknown-ospid-7266-as-a-result-of-ora-609%e7%b1%bb%e4%bc%bc%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">dns解析导致opiodr aborting process unknown ospid (7266) as a result of ORA-609类似错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/%e5%90%8c%e5%8f%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%a4%9a%e7%89%88%e6%9c%ac%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9b%91%e5%90%ac%e9%85%8d%e7%bd%ae.html" rel="bookmark" class="crp_title">同台服务器多版本数据库监听配置</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/hostname%e9%85%8d%e7%bd%ae%e4%b8%8d%e5%88%87%e5%bd%93%e5%af%bc%e8%87%b4tns-12542%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">hostname配置不切当导致TNS-12542错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/10/ora-01034-ora-27101.html" rel="bookmark" class="crp_title">ORA-01034 ORA-27101故障分析</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/02/connect-pdb-sid-use_sid_as_service_listener.html" rel="bookmark" class="crp_title">使用sid方式直接访问pdb(USE_SID_AS_SERVICE_LISTENER)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/%e5%9b%a0%e5%9f%9f%e5%90%8d%e8%a7%a3%e6%9e%90%e5%af%bc%e8%87%b4%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bf%9e%e6%8e%a5%e5%bb%b6%e8%bf%9f%e5%88%86%e6%9e%90.html" rel="bookmark" class="crp_title">因域名解析导致数据库连接延迟分析</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/08/oracle-recovery-tools-202008.html" rel="bookmark" class="crp_title">Oracle Recovery Tools&#8212;202008</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/06/%e5%9b%a0ipc%e5%af%bc%e8%87%b4%e5%a4%9a%e4%b8%aa%e7%9b%91%e5%90%ac%e4%b8%8d%e8%83%bd%e6%ad%a3%e5%b8%b8%e5%90%af%e5%8a%a8.html" rel="bookmark" class="crp_title">因IPC导致多个监听不能正常启动</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/linux%e4%b8%ad%e4%b8%8d%e8%83%bdping%e9%80%9ahostname%e5%8f%af%e8%83%bd%e5%ad%98%e5%9c%a8%e9%97%ae%e9%a2%98.html" rel="bookmark" class="crp_title">linux中不能ping通hostname可能存在问题</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/02/%e8%bf%9c%e7%a8%8b%e8%ae%bf%e9%97%aeasm.html" rel="bookmark" class="crp_title">远程访问ASM</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2020/01/oracle-to-sql-gateway.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
