<?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>Sys-Admin Information&#039;s &#187; ODBC</title>
	<atom:link href="http://sysinfo.bascomp.org/category/oracle/odbc/feed/" rel="self" type="application/rss+xml" />
	<link>http://sysinfo.bascomp.org</link>
	<description></description>
	<lastBuildDate>Fri, 23 Apr 2010 09:43:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Oracle Heterogeneous Configuration Service (ORACLE to MySQL)</title>
		<link>http://sysinfo.bascomp.org/2008/03/setting-oracle-heterogenous-service-mysql-to-oracle/</link>
		<comments>http://sysinfo.bascomp.org/2008/03/setting-oracle-heterogenous-service-mysql-to-oracle/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 06:55:36 +0000</pubDate>
		<dc:creator>Henri Simatupang</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle to Mysql]]></category>

		<guid isPermaLink="false">http://sysinfo.bascomp.org/2008/03/05/setting-oracle-heterogenous-service-mysql-to-oracle/</guid>
		<description><![CDATA[PART I : Setting up ODBC driver
1. Install mysql-connector-odbc-3.51.12-linux-i686.rpm

bash&#62; rpm –ivh mysql-connector-odbc-3.51.12-linux-i686.rpm

2. Start Mysql Daemon

bash&#62; /etc/init.d/mysqld start
Initializing MySQL database:                               &#91;  OK  &#93;

3. Configure [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PART I : Setting up ODBC driver</strong></p>
<p>1. Install mysql-connector-odbc-3.51.12-linux-i686.rpm</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span> rpm –ivh mysql-connector-odbc-3.51.12-linux-i686.rpm</pre></div></div>

<p>2. Start Mysql Daemon</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysqld start
Initializing MySQL database:                               <span style="color: #7a0874; font-weight: bold;">&#91;</span>  OK  <span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>3. Configure ODBC</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span> ODBCConfig</pre></div></div>

<p>4. Modify : /etc/odbc.ini</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>odbc.ini</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[trans]
Driver = MySQL ODBC 3.51 Driver
DATABASE = kampus
DESCRIPTION = punya_kampus
PWD = password
PORT = 3306
SERVER = localhost
UID = root</pre></div></div>

<p><span id="more-46"></span></p>
<p>5. Test Connection</p>
<p><code>isql DSN [UID [PWD]] [options]</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span> isql <span style="color: #660033;">-v</span> trans root password</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">+---------------------------------------+
| Connected!
|
| sql-statement
| help [tablename]
| quit
|
+---------------------------------------+</pre></div></div>

<p><strong>PART II :  How 2 Configure HSODBC</strong></p>
<p>1. Listener</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
&nbsp;
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = trans)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0)
(PROGRAM = hsodbc)
)
)
&nbsp;
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = OraHost)(PORT = 1521))
)
)</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt; lsnrctl reload</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt; lsnrctl status
LSNRCTL <span style="color: #000000; font-weight: bold;">for</span> Linux: Version 10.2.0.1.0 - Production on <span style="color: #000000;">12</span>-NOV-<span style="color: #000000;">2006</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">50</span>:<span style="color: #000000;">28</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1991</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
Connecting to <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">DESCRIPTION</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">ADDRESS</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">PROTOCOL</span>=IPC<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">KEY</span>=EXTPROC1<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
STATUS of the LISTENER
<span style="color: #660033;">------------------------</span>
Alias                     LISTENER
Version                   TNSLSNR <span style="color: #000000; font-weight: bold;">for</span> Linux: Version 10.2.0.1.0 - Production
Start Date                <span style="color: #000000;">12</span>-NOV-<span style="color: #000000;">2006</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">42</span>:<span style="color: #000000;">34</span>
Uptime                    <span style="color: #000000;">0</span> days <span style="color: #000000;">0</span> hr. <span style="color: #000000;">7</span> min. <span style="color: #000000;">54</span> sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   <span style="color: #000000; font-weight: bold;">/</span>u01<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>10.2.0<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">/</span>listener.ora
Listener Log File         <span style="color: #000000; font-weight: bold;">/</span>u01<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>10.2.0<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>listener.log
Listening Endpoints Summary...
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">DESCRIPTION</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">ADDRESS</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">PROTOCOL</span>=ipc<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">KEY</span>=EXTPROC1<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">DESCRIPTION</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">ADDRESS</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">PROTOCOL</span>=tcp<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">HOST</span>=OraHost<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">PORT</span>=<span style="color: #000000;">1521</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Services Summary...
Service <span style="color: #ff0000;">&quot;PLSExtProc&quot;</span> has <span style="color: #000000;">1</span> instance<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
Instance <span style="color: #ff0000;">&quot;PLSExtProc&quot;</span>, status UNKNOWN, has <span style="color: #000000;">1</span> handler<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">for</span> this service...
Service <span style="color: #ff0000;">&quot;prod&quot;</span> has <span style="color: #000000;">1</span> instance<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
Instance <span style="color: #ff0000;">&quot;prod&quot;</span>, status READY, has <span style="color: #000000;">1</span> handler<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">for</span> this service...
Service <span style="color: #ff0000;">&quot;prodXDB&quot;</span> has <span style="color: #000000;">1</span> instance<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
Instance <span style="color: #ff0000;">&quot;prod&quot;</span>, status READY, has <span style="color: #000000;">1</span> handler<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">for</span> this service...
Service <span style="color: #ff0000;">&quot;prod_XPT&quot;</span> has <span style="color: #000000;">1</span> instance<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
Instance <span style="color: #ff0000;">&quot;prod&quot;</span>, status READY, has <span style="color: #000000;">1</span> handler<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">for</span> this service...
Service <span style="color: #ff0000;">&quot;trans&quot;</span> has <span style="color: #000000;">1</span> instance<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>.
Instance <span style="color: #ff0000;">&quot;trans&quot;</span>, status UNKNOWN, has <span style="color: #000000;">1</span> handler<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">for</span> this service...
The <span style="color: #7a0874; font-weight: bold;">command</span> completed successfully</pre></div></div>

<p>2. Edit tnsnames.ora</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
&nbsp;
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = OraHost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = prod)
)
)
&nbsp;
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
&nbsp;
trans =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = OraHost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = trans))
(HS = OK)
)</pre></div></div>

<p>3. Configure $ORACLE_HOME/hs/admin/inithsodbc.ora<br />
# This is a sample agent init file that contains the HS parameters that are<br />
# needed for an ODBC Agent.<br />
# HS init parameters<br />
#<br />
HS_FDS_CONNECT_INFO = trans<br />
HS_FDS_TRACE_LEVEL = off<br />
HS_FDS_SHAREABLE_NAME = /usr/lib/libmyodbc3.so<br />
#<br />
# ODBC specific environment variables<br />
#set ODBCINI=/etc/odbc.ini<br />
#<br />
# Environment variables required for the non-Oracle system<br />
#<br />
# set &lt;envvar&gt;=&lt;value&gt;<br />
#</p>
<p>4. Configure Environment &amp; Test tnsping</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> .bash_profile</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># User specific environment and startup programs
PATH=$PATH:$HOME/bin
# Henri Configure
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORACLE_SID=prod
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=$PATH:$ORACLE_HOME/bin:/sbin:.
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ODBCINI=/etc/odbc.ini</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span> tnsping trans
TNS Ping Utility <span style="color: #000000; font-weight: bold;">for</span> Linux: Version 10.2.0.1.0 - Production on <span style="color: #000000;">12</span>-NOV-<span style="color: #000000;">2006</span> <span style="color: #000000;">23</span>:<span style="color: #000000;">21</span>:<span style="color: #000000;">43</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1997</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
Used parameter files:
<span style="color: #000000; font-weight: bold;">/</span>u01<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>10.2.0<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">/</span>sqlnet.ora
Used TNSNAMES adapter to resolve the <span style="color: #7a0874; font-weight: bold;">alias</span>
Attempting to contact <span style="color: #7a0874; font-weight: bold;">&#40;</span>DESCRIPTION = <span style="color: #7a0874; font-weight: bold;">&#40;</span>ADDRESS_LIST = <span style="color: #7a0874; font-weight: bold;">&#40;</span>ADDRESS = <span style="color: #7a0874; font-weight: bold;">&#40;</span>PROTOCOL = TCP<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>HOST = OraHost<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>PORT = <span style="color: #000000;">1521</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>CONNECT_DATA = <span style="color: #7a0874; font-weight: bold;">&#40;</span>SID = trans<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>HS = OK<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
OK <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">10</span> msec<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>5. Creating Database Link</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> conn kadal<span style="color: #66cc66;">/</span>kadal
Connected<span style="color: #66cc66;">.</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SQL<span style="color: #000000; font-weight: bold;">&gt;</span> CREATE DATABASE LINK trans CONNECT TO <span style="color: #ff0000;">&quot;root&quot;</span> IDENTIFIED BY <span style="color: #ff0000;">&quot;password&quot;</span> USING <span style="color: #ff0000;">'trans'</span>;
Database <span style="color: #c20cb9; font-weight: bold;">link</span> created.</pre></div></div>

<p>6. Test Koneksi</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SQL<span style="color: #000000; font-weight: bold;">&gt;</span> SELECT <span style="color: #000000; font-weight: bold;">*</span> FROM MHS<span style="color: #000000; font-weight: bold;">@</span>TRANS;</pre></div></div>

<p><em>Note : Case Sensitive</em></p>
]]></content:encoded>
			<wfw:commentRss>http://sysinfo.bascomp.org/2008/03/setting-oracle-heterogenous-service-mysql-to-oracle/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
