Solved

Slow performance when using Linked Server on Oracle

Posted on 2010-11-13
9
2,022 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
ID: 34130040
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
ID: 34130073
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
ID: 34136523
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 46

Expert Comment

by:Vitor Montalvão
ID: 34143789
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:Dominic34
ID: 34145191
How can I setup a linked server directly with Oracle client ???
0
 
LVL 46

Expert Comment

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

Assisted Solution

by:manukapoor
manukapoor earned 100 total points
ID: 34153613
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
ID: 34154512
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 46

Accepted Solution

by:
Vitor Montalvão earned 400 total points
ID: 34155533
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Caste datetime 2 50
Stored Procedure 2 47
Restrict result set 1 33
Rename SQL Instance/SQL Developer Edition 2012 2 7
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
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.

914 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