Read SQL Server table from Oracle
Hi,
Oracle 11.2.0.1
Windows XP Prof Edition
After creating DSN name opd when I tried to connect sql server Enterprise Edition 2005 database on the same PC, I failed to establish connectivity.
Here it is what I have and done :
C:\Documents and Settings\Administrator>type %oracle_home%\network\admin\listener.ora
# listener.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM=extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
(SID_DESC=
(SID_NAME = opd)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = dg4odbc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = newserver4)(PORT = 1521))
ADR_BASE_LISTENER = C:\app\Administrator
C:\Documents and Settings\Administrator>type %oracle_home%\network\admin\tnsnames.ora
# tnsnames.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = newserver4)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
opd =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=newserver4)
(PORT=1521)
(CONNECT_DATA=(SID=opd))
(HS=OK)
C:\Documents and Settings\Administrator>type %oracle_home%\network\admin\sqlnet.ora
# sqlnet.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
C:\Documents and Settings\Administrator>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 31-DEC-2013 18:26:13
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Start Date 31-DEC-2013 18:05:31
Uptime 0 days 0 hr. 20 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
Listener Log File c:\app\administrator\diag\tnslsnr\newserver4\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=newserver4)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "opd" has 1 instance(s).
Instance "opd", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
C:\Documents and Settings\Administrator>tnsping opd
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 31-DEC-2013 18:26:29
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=TCP) (HOST=newserver4) (PORT=1521))) (CONNECT_DATA=(SID=opd)) (HS=OK))
OK (40 msec)
C:\Documents and Settings\Administrator>type %oracle_home%\hs\admin\initopd.ora
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
# HS init parameters
HS_FDS_CONNECT_INFO = opd
HS_FDS_TRACE_LEVEL = off
# Environment variables required for the non-Oracle system
#set <envvar>=<value>
C:\Documents and Settings\Administrator>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 31 18:27:18 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> drop database link opd;
Database link dropped.
SQL> create database link opd connect to "sa" identified by "girish" using 'opd';
Database link created.
SQL> select count(*) from ny@opd;
select count(*) from ny@opd
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified {IM002}
ORA-02063: preceding 2 lines from OPD
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\Documents and Settings\Administrator>
PS : I don't know why I am not able to see my above question on Heterogeneous Connectivity forum, while the thread has been generated :https://community.oracle.com/thread/2616787
Thanks and Regards
Girish Sharma
Thanks Sb.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> drop database link opd;
Database link dropped.
SQL> create database link opd connect to "SA" identified by "girish" using 'opd';
Database link created.
SQL> select count(*) from ny@opd;
select count(*) from ny@opd
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified {IM002}
ORA-02063: preceding 2 lines from OPD
Regards
Girish Sharma
Similar Messages
-
Querying SQL server table from Oracle database 11g
Hi all
We are using oracle database 11g R2 on REL 5 and i have an SQL server database used by one of our application.
In my Oracle database, i want to query one table in my SQL server database and to link it in a table in Oracle database to compare data.
Is there a way like database link or something else to do this need>
Please send a link or pots here step by step the way on how to accomplish my query.
Thank you.Yes, you can set up your SQL Server as an external database link, using Oracle Heterogeneous Services with SQL Server as an ODBC connection (easier to do if your Oracle server is a Windows server, a little more tricky if your Oracle server is *nix based)
Here's the documentation... for 11gR2
http://www.oracle.com/pls/db112/search?remark=quick_search&word=heterogeneous+services -
Error while Viewing SQL Server data from Oracle
Dear Friends,
I am using Oracle10g XE.
I have made a connection to view or insert data in SQL Server Database from Oracle.
I have done all the things with the help of below link.
http://www.databasejournal.com/features/oracle/article.php/3442661/Making-a-Connection-from-Oracle-to-SQL-Server.htm
Everything worked fine. but when i run below query
select "EmployeeNo" from hrtattendance@mysqlserverdsn
it gives an error which is mentioned below
ERROR at line 1:
ora-28545: error diagnosed by Net8 when connecting to an agent
Unable to reteieve text of NETWORK/NCR MESSAGE 65535
ORA-02063: preceding 2 lines from MYSQLSERVERDSN
Please help. I will be thankful.
Regards,Dear Klaus,
Here u go.
C:\>C:\oraclexe\app\oracle\product\10.2.0\server\bin\hsodbc
Oracle Corporation --- TUESDAY JUN 24 2014 16:28:20.146
Heterogeneous Agent Release 10.2.0.1.0 - Production Built with
Driver for ODBC
C:\>C:\oraclexe\app\oracle\product\10.2.0\server\bin\tnsping MYSQLSERVERDSN
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 24-JUN-2
014 16:28:33
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT
=1522)) (CONNECT_DATA=(SID=MYSQLSERVERDSN)) (HS=OK))
TNS-12541: TNS:no listener
C:\>C:\oraclexe\app\oracle\product\10.2.0\server\bin\lsnrctl status LISTENERMYSQLSERVERDSN
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 24-JUN-2014 16:28
:48
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
32-bit Windows Error: 61: Unknown error
Connecting to (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
32-bit Windows Error: 2: No such file or directory
C:\>
Regards, -
Recreating SQL Server Tables on Oracle
Hello,
I need to recreate several SQL Server tables in Oracle and am trying to figure out if there is an easier way to do it other than manually recreating them.
I have the SQL Server table scripts, and I have data load xls files that also contain the column names. I use TOAD for Oracle to do my database management, but there is currently no way to autmoatically create a table based on an external file.
Does anyone have any suggestions?
Thanks,
ChristineManually re-creating these SQL Server tables for Oracle is exactly the right thing to do.
SQL Server != Oracle
In other words, there are numerous differences. You need to look at each table and decide on the type of table (hash table, index organised table, partitioned tables), whether to cluster tables, the types of indexes to use, the data types for the columns to use (Oracle does not have boolean or auto incrementing data types). Oracle supports LONG, RAW, CLOB and BLOB for dealing with different types of binary and large data structures. LONG for example should not be used anymore. There are also specialised data types like BFILE. One can also define your own SQL data types.
You will only be doing yourself a favour, and the final database application, by going through the learning curve and manually converting each and every table. And no, it is not a huge task either. It sounds a lot more daunting that what it really is. -
I want to query sql server database from oracle
i want to query sql server database from oracle
can anyone help me in this regardFirst of all - you are in the wrong forum.
Look either for the Database general or search for Transparant / Heterogenous Gateways.
cu
Andreas -
Access SQL-Server Data from Oracle 10gXE
Hello,
I want to access sql-server data from oracle 10g XE. I need the same functionality provided by Sql-server by Linked Servers, by which we can query on any data source(oracle, Excel, Access).
do, Oracle 10gXE provide us with same functionality ???
any pointers ???Yes, it does work with Express Edition.
Here is a thread from the XE forum with examples.
Re: Database Link to MS Access
They refer to a MS Access database, but the procedure is the same.
Doug -
Calling SQL Server Function from Oracle Database link
Hi ,
i have some data from a old SQL server i would i can access with a database link but i cant call function from my database link.
i would like to do something like
@SPAN_PROD = Database link
_EnerttObtApReelBassSys is a Table function from my SQL server
SELECT *
FROM "_EnerttObtApReelBassSys('20120504',4,1)"@SPAN_PROD
WHERE DateEffectiveDebut <= GetDate()
AND DateEffectiveFin > GetDate()
any help ?
Thnx951879 wrote:
I have a SP in SQL Server which will return a Result Set.
My requirement is to call that procedure in ORACLE using DB Link and insert that resultset(Data) in the temp table.First you need to setup Oracle to SQL Server connectivity. To do that you can either use HS - heterogeneous connectivity which comes for free or use Oracle Transparent Gateway which is not free. HS uses ODBC, so if your Oracle database in not on windows, you'll have to get ODBC SQL Server driver for Unix/Linux (e.g. from EasySoft). Since SQL Server selecting from table function syntax is different from Oracle's you will have to, if you use HS, to use DBMS_HS_PASSTHROUGH package. I never worked with Oracle Transparent Gateway to SQL Server, so I don't know if and how it supports selecting from SQL Server table function.
SY. -
How to insert into SQL server table form oracle forms
I created a form with oracle as my database. But there one trigger where I need to insert the data into a sql server table.
Is this possible. If so can any help me out.
Thanks in advance.
AshaHi,
You can insert into sql server database using the following steps
Note: Check wether you are using Forms 32 bit drivers. If not the Odbc data source will not work.
step 1: Create ODBC data source for SQL server(one time creation);
step 2: Logout from Oracle and login to SQL server giving the user name,password and host string as odbc:<odbc datasource name>;
step 3: use EXEC SQL statement to insert the values into the SQL server and then logout and login again to your oracle database.
Second Method.
Check the sql server documentation to insert the values using command line parameters. Then you can call the host command to execute this.
Third Method.
Write a VB exe to enter the values in the sql server making two connections one to oracle another to SQL server and then getting values from Oracle and putting in the SQL server database. You can call this exe using the Host command.
Hope this will help You.
Regards
Gaurav Thakur -
Executing sql server procedure from oracle via db link with out parameters
HI
we have successfully created the link between oracle and sql server via DB LINK also able to access table from the
sqlserver via dblink
Can any one tell me how to execute procedure with 1 input and 4 out parameters from pl\sql
is it possible using
dbms_hs_passthroughYou should be able to call it like you would any other procedure:
dbo.procedure_name@dblink(parameter_list); -
ODBC connect to SQL Server 2005 from Oracle 10.2.0.3 32bit Linux
I’m unable to establish a connection from Oracle 10.2.0.3 32bit Linux to SQL Server 2005.
The ODBC driver is the 32bit DataDirect 5.3 drivers and when I do a status on the listener it does have a handler for SQLDB
Any help is appreciated.
Received the following error:
SQL> select count(*) from columns@SQLDB;
select count(*) from columns@SQLDB
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Generic Connectivity Using ODBC]DRV_InitTdp: DB_ODBC_INTERFACE (718): ; [C077]
Could not find symbol 'SQLAllocConnect' in dynamic library
DB_ODBC_INTERFACE (722): ; [C079] Failed to load dynamic library
'/app/DataDirect/lib/libodbc.so'
ORA-02063: preceding 3 lines from SQLDB
-----Contents of trace file------------------
Oracle Corporation --- THURSDAY JUL 10 2008 10:17:16.251
Version 10.2.0.3.0
hoagprd (2): ; hoagprd Entered.
HOACONN.C (244): ; [Generic Connectivity Using ODBC] version: 4.8.2.0.0080
HOACONN.C (288): ; Class version: 250
hoagprd (2): ; hoagprd Exited with retcode = 0.
hoainit (3): ; hoainit Entered.
(0): ; connect string is: defTdpName=SQLDB;SYNTAX=(ORACLE8_HOA, BASED_ON=
ORACLE8, IDENTIFIER_QUOTE_CHAR="", CASE_SENSITIVE=CASE_SENSITIVE_QUOTE);
BINDING=<navobj><binding><datasources><datasource name='SQLDB' type='GENERIC_
ODBC_FOR_HS' connect='SQLDB'><driverProperties/></datasource></datasources><
remoteMachines/><environment><optimizer noFlattener='true'/><misc
year2000Policy='-1' consumerApi='1' sessionBehavior='4'/><queryProcessor
parserDepth='2000' tokenSize='1000' noInsertParameterization='true'
noThreadedReadAhead='true' noCommandReuse='true'/><debug driverTrace='true'
generalTrace='true'/></environment></binding></navobj>
ORACLE GENERIC GATEWAY Log File Started at 2008-07-10T10:17:16
hoainit (3): ; hoainit Exited with retcode = 0.
hoalgon (7): ; hoalgon Entered. name = dbuser.
sysbase.c (677): ; libodbcinst.so: cannot open shared object file: No such
file or directory
DB_ODBC_INTERFACE (718): ; [C077] Could not find symbol 'SQLAllocConnect' in
dynamic library
DB_ODBC_INTERFACE (722): ; [C079] Failed to load dynamic library '/app/
DataDirect/lib/libodbc.so'
DB_ODBC_INTERFACE (727): ; [C077] Could not find symbol 'SQLAllocConnect' in
dynamic library
DRV_InitTdp: DB_ODBC_INTERFACE (718): ; [C077] Could not find symbol '
SQLAllocConnect' in dynamic library
DB_ODBC_INTERFACE (722): ; [C079] Failed to load dynamic library '/app/
DataDirect/lib/libodbc.so'
nvRETURN (./drv_bind.c 230): -2220
nvRETURN (./nav_bind.c 298): -2220
hoalgon (7): ; hoalgon Exited with retcode = 28500.
hoaexit (6): ; hoaexit Entered.
hoaexit (6): ; hoaexit Exited with retcode = 0.
(0): ; Closing log file at THU JUL 10 10:17:16 2008.
--------------end of trace file ---------------
--------TNS entry ----------
SQLDB=
(DESCRIPTION =
(ADDRESS =(PROTOCOL = TCP)
(Host = oracledbhost)
(Port = 1521)
(CONNECT_DATA = (SID =SQLDB)
(HS=OK)
-------Listener.ora entry----------
(SID_DESC=
(SID_NAME=SQLDB)
(ORACLE_HOME=/app/oracle10g/product/10.2)
(PROGRAM=hsodbc)
-------initSQLDB.ora----------
# This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent.
# HS init parameters
HS_FDS_CONNECT_INFO = SQLDB
HS_FDS_TRACE_LEVEL = 4
HS_FDS_TRACE_FILE_NAME=/app/DataDirect/SQLDB.trc
HS_FDS_SHAREABLE_NAME=/app/DataDirect/lib/libodbc.so
# ODBC specific environment variables
set ODBCINI=/app/DataDirect/odbc.ini
------odbc.ini entry------------
[SQLDB]
Driver=/app/DataDirect/lib/ivmsss23.so
Description=DataDirect 5.2 SQL Server Wire Protocol
Address=SQLServerhost,1401
AlternateServers=
AnsiNPW=Yes
ConnectionRetryCount=0
ConnectionRetryDelay=3
Database=SQLServerDB
LoadBalancing=0
LogonID=
Password=
QuotedId=No
SnapshotSerializable=0The error message is indicating problems loading the driver manager.
A common issue on Linux (especially on Suse Linux) is related to library caching. First of all make sure you add the LD_LIBRARY_PATH to your listener.ora file to guarantee the correct libraries will be loaded. Your SID section will then look like:
(SID_DESC=
(SID_NAME=SQLDB)
(ORACLE_HOME=/app/oracle10g/product/10.2)
(ENVS=LD_LIBRARY_PATH=/app/oracle10g/product/10.2/lib:/app/DataDirect/lib)
(PROGRAM=hsodbc)
After changing the listener.ora file stop and start the listener.
Details about the set up can be found in Metalink note:
Note.264567.1 P216. How To Setup Generic Connectivity - HSODBC - on Linux
If this does not help enable strace and check out from which location libodbc.so is being loaded.
Please be also aware HSODBC has been desupported 15th of March. As you start a new project you should proceed with the follow up product DG4ODBC. -
Invoking SQL Server function from Oracle
Hi all,
My question involves Oracle and SQL Server. I have a function in SQL Server that returns the count of rows in a table in SQL Server itself. I
wish to invoke this function (in SQL Server) from Oracle. I have Transparent Gateway through which I usually connect to SQL Server to get the count. Is there a way in which I can execute the function (in SQL Server) from Oracle, something like below:
select function_in_sql_server@transparent_gateway from dual;Thanks,
...I found below two links:
how to call a sql server stored procedure from oracle
http://en.allexperts.com/q/Oracle-1451/2008/6/Calling-SQL-Stored-procedure-1.htm
Regards
Girish Sharma -
Problem in reading Sql server data from text file.
I am selecting record from sql server 2005 and save the result in text file.
The text file contains , delimiter.
I am reading same txt file from java & insert into database.
But it shows "��S and box like characters along with original text.
Regards
JoeI also tried a lot for this. And didn't want to do copy paste for all .sql files. Finally the files could be read as is the clue is to read the file using UTF-16 format like
BufferedReader br=new BufferedReader(new InputStreamReader(fis,Charset.forName("UTF-16")));
I guess it would help and save work to copy paste text to other files and resaving it! -
Execute Sql Server Procedure from Oracle Forms
Hi,
I have Forms6i and need to create a form that execute a procedure in a SQL Server Database. This procedure inserts records retrieves from our Oracle Database (i passed the fields as parameters of the SQL Server procedure).
What did i need to do to achieve this task.-
Thanks in advance.-See
http://www.oracle.com/technology/products/forms/pdf/275201.pdf
Also search the forum and you will find discussions on this topic.
Message was edited by:
Mark Roberts -
SQL Server Connectivity from Oracle Solaris 9.2
Hi,
We have data in SQL Server 2000 database and we need to transfer this to Oracle 9.2 database in SOLARIS environment. To do this, we would like to connect to SQL Server from Oracle Solaris, we explored options like
Transparent Gateway and Hetrogeneous Services.
We doubt whether it is possible to do so from Solaris environment to SQL Server, which runs only in Windows OS.
We tried connecting from SQL Server to Oracle Solaris, which we could not able to do it successfully.
Please guide us the various methods available to accomplish the same, thank you.
Regards,
DevaYou need an ODBC driver for Solaris.
Sybrand Bakker
Senior Oracle DBA -
Connecting to SQL Server 2000 from Oracle 9iDS
hi
I want to connect Forms Developer 9i to a SQL Server 2000 Database for integration purposes. Mentioning that I don't have any Oracle servers on my system.
Thankshi
I want to connect Forms Developer 9i to a SQL Server 2000 Database for integration purposes. Mentioning that I don't have any Oracle servers on my system.
Thanks
Maybe you are looking for
-
What is the best way to connect macbook running sling adapter to the tv
what is the best way to connect macbook running slig adapter content to the tv
-
Where can I download Acrobat XI Professional?
I bought Adobe Acrobat XI Pro and need the link to download the software.
-
No vibration for incoming email
My phone does not vibrate for incoming email
-
How to use media in another application?
Say I wish to use some of my video clips in After Effects. How do I import them into AE? The FCPX Library, of course, cannot be opened by the AE import dialog.
-
I updated to FF 4 and now cannot access Windows Media-help please
I recently upgraded to FF 4. Since then, I am unable to play music or open email with a Windows Media attachment. When I try, I get the following message: "windows media player encountered a problem" I'm given two choices - "close or help". I tried "