You are on page 1of 5

OracIe Heterogeneous Configuration Service (ORACLE to MySQL)

1. ODBC Driver Setup: [Configurations to be done in the server where oracle will be running]
Step 1: nstall mysqI-connector-odbc-3.51.12-2.2 rpm
Step 2: Configure ODBC parameters in the following file as shown:
commond vi /etc/odbc.ini
[SID_NAME,
Driver = MySQL JDBC 3.51 Driver
DATABASE = <REMJTE_DATABASE_NAME
DESCRIPTIJN =
PWD = <REMJTE_DB_PASSWJRD
PJRT = <DEFAULT_REMJTE_DATABASE_PJRT
SERVER = <IP_ADDRESS
UID = <REMJTE_DATABASE_USER_NAME
Example:
[mysqldb]
Driver = MySQL ODBC 3.51 Driver
DATABASE = test
DESCRIPTION =
PWD = BMPUSER
PORT = 3306
SERVER = 10.0.3.181
UID = BMPUSER
2. Configure HSODBC: [Configurations to be done in the server where oracle will be running]
Step 1: listener.ora to be configured with SD description as shown in below example.
LOG_STATUS = OFF
LOGGING_BPLORA = OFF
SUBSCRIBE_FOR_NODE_DOWN_EVENT_BPLORA=OFF
BPLORA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.0.3.178) (PORT = 1521))
)
SID_LIST_BPLORA =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = BPLORA.localhost.localdomain)
(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
(SID_NAME = BPLORA)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = mysqldb)
(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
(PROGRAM = hsodbc)
)
)
3. #eload Listener with HSODBC configurations as shown below.
Command: lsnrctl reload
. Check the Listener status for the newly added service(s) whether handlers are added or not.
Commandlsnrctl status
Note: once the above command execute, it will display the services with available handlers as.
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 06-JUN-2011
15:25:57
Copyright (c) 1991, 2005, Jracle. All rights reserved.
Connecting to (ADDRESS= (PRJTJCJL=tcp) (HJST=) (PJRT=1521))
STATUS of the LISTENER
------------------------
Alias bplora
Version TNSLSNR for Linux: Version 10.2.0.1.0 -
Production
Start Date 02-JUN-2011 16:15:54
Uptime 3 days 23 hr. 10 min. 2 sec
Trace Level off
Security JN: Local JS Authentication
SNMP JFF
Listener Parameter File
/opt/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listening Endpoints Summary...
(DESCRIPTIJN= (ADDRESS= (PRJTJCJL=tcp) (HJST=10.0.3.178)
(PJRT=1521)))
Services Summary...
Service "BPLJRA" has 1 instance(s).
Instance "BPLJRA", status READY, has 1 handler(s) for this service...
Service "BPLJRA.localhost.localdomain" has 1 instance(s).
Instance "BPLJRA", status UNKNJWN, has 1 handler(s) for this
service...
Service "BPLJRAXDB" has 1 instance(s).
Instance "BPLJRA", status READY, has 1 handler(s) for this service...
Service "BPLJRA_XPT" has 1 instance(s).
Instance "BPLJRA", status READY, has 1 handler(s) for this service...
Service "mysqldb" has 1 instance(s).
Instance "mysqldb", status UNKNJWN, has 1 handler(s) for this
service...
The command completed successfully

5. dit tnsnames.ora to add the new service for heterogeneous service as shown in the example
below.
xample:
mysqldb =
(DESCRIPTION=
(ADDRESS= (PROTOCOL=TCP) (HOST=l0.0.3.l78) (PORT=l52l))
(CONNECT_DATA= (SID=mysqldb))
(HS=OK)
)


. confiqure 5Ok4cL_nOM/hs/odmin/inithsodbcoro. (This ls a sample agenL lnlL flle LhaL conLalns
Lhe PS parameLers LhaL are needed for an Cu8C AgenL)
xample:
HS_FDS_CONNECT_INFO = mysqldb
HS_FDS_TRACE_LEVEL = OFF
#HS_FDS_SHAREABLE_NAME = /usr/local/lib/libodbc.so
HS_FDS_SHAREABLE_NAME = /usr/lib/libmyodbc3.so

# Lnv|ronment var|ab|es requ|red for the nonCrac|e system

set ODBCINI=/etc/odbc.ini


. Set the following nvironment variables on the shell:

export ORACLE_BASE=
export ORACLE_HOME=
export ORACLE_SID=
export LD_LIBRARY_PATH=
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ODBCINI=/etc/odbc.ini

. check tnspinq for the service new/y odded.



Command:tnsping mysqIdb

Note: It shaII dispIay as beIow.



TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 06-
JUN-2011 15:49:08
Copyright (c) 1997, 2005, Oracle. All rights reserved.

Used parameter files:
/opt/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.3.178)(PORT=1521))
(CONNECT_DATA=(SID=mysqldb)) (HS=OK))
OK (0 msec)


. creote uotobose Link to the remote dotobose /oqqinq in into oroc/e user from where the remote
dotobose to be contocted

commond sqlplus username/password@servicename

commond CREATE DATABASE LINK <service_name> CONNECT TO
"user_name" IDENTIFIED BY "password" USING 'service_name'

xomp/e
commond sqlplus wmca/wmca@bplora
commond CREATE DATABASE LINK mysqldb CONNECT TO
"BMPUSER" IDENTIFIED BY "BMPUSER" USING 'mysqldb'
















































-O1 Moke sure thot the mysq/ user creoted in the MY5L server must be creoted
ond qronted with fo//owinq permissions

commond ck41 u5k user_nomeQoroc/e_dotobose_server_ip lu-1lllu 8Y possword
xomp/e ck41 u5k 8MPu5kQ100l178 lu-1lllu 8Y 8MPu5k


commond 6k4-1 4LL PklvlL65 O- user_nome* 1O
user_nomeQoroc/e_dotobose_server_ip lu-1lllu 8Y possword
xomp/e 6k4-1 4LL PklvlL65 O- 8MPu5k* 1O 8MPu5kQ100l178 lu-1lllu 8Y
8MPu5k

commond
updote user set
5e/ect_privYlnsert_privYupdote_privYue/ete_privYcreote_privYurop_privYke/ood_p
rivY5hutdown_privY Process_privY li/e_privY6ront_privYkeferences_privY
lndex_privY4/ter_privY5how_db_privY5uper_privY5uper_privYcreote_tmp_tob/e_priv
Y Lock_tob/es_privYxecute_privY
kep/_s/ove_privYkep/_c/ient_privYcreote_view_privY5how_view_privYcreote_routine_pri
vY4/ter_routine_privYcreote_user_privYmox_questions10000000000mox_updotes100000
000mox_connections100000mox_user_connections1000000 where user user_nome

xomp/e updote user set
5e/ect_privYlnsert_privYupdote_privYue/ete_privYcreote_privYurop_privYke/ood_p
rivY5hutdown_privY Process_privY li/e_privY6ront_privYkeferences_privY
lndex_privY4/ter_privY5how_db_privY5uper_privY5uper_privYcreote_tmp_tob/e_priv
Y Lock_tob/es_privYxecute_privY
kep/_s/ove_privYkep/_c/ient_privYcreote_view_privY5how_view_privYcreote_routine_pri
vY4/ter_routine_privYcreote_user_privYmox_questions10000000000mox_updotes100000
000mox_connections100000mox_user_connections1000000 where user 8MPu5k


. -ow oroc/e queries con be executed on the remote mysq/ dotobose

xomp/e

; se/ect * from Mk4ll_151Qmysq/db

You might also like