Solved

Slow performance when using Linked Server on Oracle

Posted on 2010-11-13
9
1,977 Views
Last Modified: 2012-08-13
Hi,

To do a short story, I setup a linked server to an Oracle database in MSSQL 2008 using the ODBC driver provided by the Oracle client installation. Connection is good and I can browse table and data.

When I insert data using the query:
INSERT INTO [Oracle]..[SAPLQP].[ZMARKPACK] .....
it takes between 3-14 seconds to executes. Which is, of course, unacceptable, I can't stall the whole process for 3-14 sec while it writes into Oracle.

SELECT * FROM [Oracle]..[SAPLQP].[ZMARKPACK] takes around 3-6 sec.
Oracle server is oversea in Europe. Ping time is around 15-30 ms.

I wanted to replace an existing program written in VB6 installed in the MSSQL server that read the SQL table and write into Oracle using the same ODBC driver (ADODB connection). Throught this program, I can write 3-4 rows in Oracle per seconds.

Why is it so bad when I use Linked Server? It's the very same ODBC driver, pointing to the very same Oracle listener..

thanks for your time and help
0
Comment
Question by:Dominic34
9 Comments
 
LVL 2

Expert Comment

by:prhowe
Comment Utility
If you don't use OpenQuery your linked server connection will be extremely slow.

Read this:  http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/d7057388-231b-47f6-b232-b8fcd5fa634e

0
 
LVL 15

Expert Comment

by:AmmarR
Comment Utility
What driver are you using in your linked server

is it MSDAORA or MSDASQL

try using ORAOLEDB.Oracle, its much faster

check

http://www.sqlmonster.com/Uwe/Forum.aspx/sql-server-connect/4772/Linked-Server-to-Oracle-10g-and-INSERT-performance

setup linked server using ORAOLEDB
http://www.mssqltips.com/tip.asp?tip=1433
0
 

Author Comment

by:Dominic34
Comment Utility
thanks for the replies. We use Oracle 9i with OraHome9 ODBC driver installed from the Oracle setup program.

Why performance are really bad when I use that ODBC driver on a linked server, but is really good when used from a VB6 program ? is it the Linked Server architecture by itself?

I thought about building a SSIS to "fix" this performance problem. It will to the bridge between MSSQL and Oracle. Rows have to be inserted in Oracle (SAP) at every 2-3 seconds, so I'm wondering if a SSIS will help me in this case...
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
ODBC it's old technology so should be always slower than others solution. Why don't you create a Linked Server without ODBC solution? Use Oracle Client directly.

Good luck
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:Dominic34
Comment Utility
How can I setup a linked server directly with Oracle client ???
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
Check my screenshot please.
OracleOLEDB.bmp
0
 
LVL 2

Assisted Solution

by:manukapoor
manukapoor earned 100 total points
Comment Utility
Yes, OLDDB provider has huge performance gains than ODBC driver but My best advice will be to use SSIS as it has several performance enhancements than any other transformation tool whether custom made or third-party.

SSIS is multi-threaded, fast and will give you between 20-25 times faster performance than other options. I will be happy to offer you more help on this, if you are willing to use SSIS, as i have some great experiences using them.

Thanks
0
 

Author Comment

by:Dominic34
Comment Utility
thanks for reply

I thought about creating a SSIS that will read a table (2 minutes scheduled), get rows to be treated and insert them in the Oracle database. How can I setup destination connection to Oracle, if I'm not to use ODBC driver?
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 400 total points
Comment Utility
In SSIS you have connection objects. You only need to configure them to use OLEDB instead of ODBC (almost like in Linked Server).
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now