SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sql Server 2000 Openquery insert takes too long


Sql Server 2000 Openquery insert takes too long

Author
Message
Stewart Fay
Stewart Fay
SSC-Enthusiastic
SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)

Group: General Forum Members
Points: 111 Visits: 51
To whom can help,

I am using Sql Server 2000 and have a linked server to Oracle.

I am doing an insert into the oracle from data on the Sql Server 2000.

it is taking 26 minutes to process 2210 records. at 85 records per minute this appears to be a long time for a relatively small amount of records.

Someone has mentioned that I may be inserting each record row by row instead of all 2210 at the same time. is this possible and if so how can I check.

Basically I want to speed this up (hopefully using setup) and not have to give the answer to the client that their network is rubbish.

Any suggestions or pushes inthe right directions would be useful.

Provider using: Microsoft OLE DB Provider for Oracle (Currently Can't get Oracle Provider for OLE DB to work (error 7399 returned) should I get this working?)

Query is:
Insert into OpenQuery (FinPRUAT, 'Select Field1 From Table1 Where Field1 1=0')
Select Field1 From Table1
Inner Join Table2
On Table2.Field1 = Table1.Field1
Where Table2.Field2 = 10001228
Thanks
Stewart Fay
Stewart Fay
SSC-Enthusiastic
SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)

Group: General Forum Members
Points: 111 Visits: 51
Hello,

Just to let people know, we have run a trace on Oracle and it shows that the ODBC does infact process the insert of each record 1 by 1.

Is there a bulk insert type of 'thing' we could use with openQuery? i.e. I would like to send all 2000 records in 1 go.

the problem is the 'SQL*Net message from client' always waits after each insert.
Max-146500
Max-146500
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1227 Visits: 363
Hi Stewart

I'm not really an expert but I don't recall having to specify a where clause in the openquery destination. Perhaps it is this that is causing the row level operations?

Other things you could check is if it is a regular issue, does it happen at all times of the day - check off-peak performance as well.

Max
Stewart Fay
Stewart Fay
SSC-Enthusiastic
SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)

Group: General Forum Members
Points: 111 Visits: 51
Your exactly right... Peak periods does relate to this. however, the biggest impact is the number of records. at peak time 20 records will transfer relatively quickly compared to 2000 records at the same time.

I still have no solution. and am thinking about transferring the data in one big field.
Max-146500
Max-146500
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1227 Visits: 363
Can you let me know what the purpose of the WHERE clause is in the destination table?

Couple of more suggestions:
1. In your Oracle ODBC DSN, disable LOBs if you're not using them.
2. In your Oracle ODBC DSN, increase the Prefetch Count (memory permitting)
3. Consider dumping the recordset to file and then kicking off a sqlcmd to kick off a batch file to import the data using sqlldr.

Max
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search