Last week I were asked if we could share the supplier master contained in a table on an Oracle db with our warehouse management software that uses a database on SQL Server 2005 platform. A quick Google search led me to
linked servers, or components of Microsoft SQL Server (I used version 2005 Standard Edition) that allow this RDBMS to communicate with heterogeneous data sources such as Oracle or AS400 and even Excel spreadsheets!
The components of a linked server are two: *
OLE DB (a DLL that handles communication with a data source) * OLE DB data source
Looking for a guide that explains how to set up a linked server from SQL Server to Oracle I came across this blog post by Greg Wright
, really clear and well done. Basically, Greg suggests in the first instance to install the Oracle client (Possibly in a version compatible with the Oracle db which must be connected) on the same machine on which you installed SQL Server, and then, using Net Manager or by manually editing the tnsnames.ora file, you must configure a service name that points db Oracle desired. In the post, following the configuration of the linked server, and finally launched an example of a query via SQL Server db on Oracle to which you connect to. select * from OPENQUERY (linked server, 'select * from dbname.tablename where clause') The key to the previous statement is function
openquery whose purpose is to return a table with a record set of the query (the second parameter of the function) run on the db (Oracle) to which you connect through linked server (the first parameter of the function). Wishing You can also perform joins between tables in SQL Server and Oracle tables with a syntax like this: select
tabellaSQLServer.campo1, X.campo2, X.campo3 from tabellaSQLServer
join openquery (nomeLinkedServer, 'select * from AltraTabella where Condition = 1 ') X = on tabellaSQLServer.campoSQLServer X.campoAltraTabella
Well, everything is now continuing with my connection test SQL Server - Oracle!
The testing phase is vital to ensure that the update is successful and does not create problems, once installed, the configuration of server / DBMS
For this time all the material there is plenty to digest. In the next post will deal installing CPU Jan 2009 on my test system, ie a virtual machine Debian GNU / Linux installed with Oracle Database version 10.2.0.4, all VMware ESXi!
Blogger allows, once set up the skeleton of your blog (via GUI css ready for use, gadgets for inclusion in the side panel to enrich your pages, etc.), to further extend the functionality through the inclusion of widgets created by third parties, provided compatible with the platform itself. Definitely cool to do some testing!
. The howto presented by Tenebrae, the author of the blog, there are indeed numerous and well made and I recommend you read if you're interested in this!
"Read more"