1. First introduction to the Environment Operating system: Windows R2 (64bits) Oracle database: 10GR2 10.2.0.3.0 (32bits) MySQL database: 5.1 (32bits) 2. Download MySQL ODBC driver, I use the Mysql-connector-odbc-5.3.4-win32 and Installation Note: Be sure to 32bits,oracle because it is 32bits all that use 32bits, truthfully 64bit please use 64bit 3. Configure an ODBC data source, Configure it in the Control Panel, use the System DSN (be sure to use), named MySQL Note: Because I am in the 64bits system, you should use 32bits ODBC files,%windir%/syswow64/odbcad32.exe 4. In%oracle _home%/hs/admin build Initmysql.ora File input:
hs_fds_connect_info = mysql # mysql is the ODBC connection name
hs_fds_trace_level = 0
5. Modified under%oracle_home%/network/admin Listener.ora attached to: sid_list content
(Sid_desc = (sid_name = mysql) # mysql is in HS with Initmysql.ora counterpart
(oracle_home = corresponding ORACLE directory)
(program = HSODBC)
#10g使用的是hsodbc驱动
)
6. Modify the Tnsnames.ora input:
MySQL=
= = = = = 1521))
= (SID= mysql)) = OK)
7. Create Dblink
Create Public Database Link Mysqllink
to "Scott"
by "Tiger" 'mysql';
8. Access tables in MySQL library user, note case.
Select"username"from "user"@mysqllink
The tests were executed successfully. Because of the use of dblink, each operation requires commit or rollback, otherwise the session will be long, the ORA error session is terminated.
Oracle creates a dblink with MySQL