Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to imporve a slowly performing openquery state

Author  Topic 

pras2007
Posting Yak Master

216 Posts

Posted - 2012-09-13 : 09:17:45
Hello All,

I created a linked server to Oracle 11g. The goal is to import all 350 oracle tables into my SQL Server 2008 database.

I executed the below openquery sql statement at once:

SELECT * INTO dbo.Oracle1 FROM OPENQUERY(LinkServer, 'SELECT * FROM Oracle1')
SELECT * INTO dbo.Oracle2 FROM OPENQUERY(LinkServer, 'SELECT * FROM Oracle2')
SELECT * INTO dbo.Oracle3 FROM OPENQUERY(LinkServer, 'SELECT * FROM Oracle3')
.
.
.
SELECT * INTO dbo.Oracle350 FROM OPENQUERY(LinkServer, 'SELECT * FROM Oracle350')

The process completed in 2 days! :(

Is there's a way to improve the execution time of the above openquery sql statement?

Thanks.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-09-13 : 09:29:51
If you're importing every table every time it would be better to use SSIS for this, it's optimized for data import and export.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-13 : 10:25:56
I also second Rob on this. Export Import wizard helps you to export all tables data from oracle efficiently

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -