Oracle access MySql via unixODBC by DBLINK(四)
uccessfully
[oracle@gtserdev admin]$ tnsping test
TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 26-MAR-2013 17:20:03
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))) (CONNECT_DATA = (SID= test)) (HS=OK))
OK (0 msec)
[oracle@gtserdev admin]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Mar 26 16:17:37 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1272600 bytes
Variable Size 62915816 bytes
Database Buffers 100663296 bytes
Redo Buffers 2920448 bytes
Database mounted.
Database opened.
SQL> drop database link
mysql;
Database link dropped.
SQL> CREATE PUBLIC DATABASE LINK mysql CONNECT TO "gtlions" IDENTIFIED BY "000000" USING 'TEST';
Database link created.
SQL> select * from "access_by_oracle"@mysql;
id name
---------- --------------------
1 gtlions
2 laidye
-EOF-