BookmarkSubscribeRSS Feed
kuppusamy
Fluorite | Level 6

I need to extract the data from oracle (Transactional data) but it is taking too much time. For extraction single date data, its taking 5min. 

 

I tried,

Passthrough query

normal proc sql by assigng library

 

not worked. Any idea ?

7 REPLIES 7
LinusH
Tourmaline | Level 20

Some hard facts could help understand your scenario (table structure, example query, logs).

But given what you wrote, I don't think it's an optimizing code task.

Extracting data performance depends on indexing/partitioning in the database, and potentially the bandwidth from SAS to the database server.

What is your task generally speaking?

5 minutes doesn't sound like a lot of time if it should be a daily batch.

Also, consider put the subsequent processing in the DB to minimize transport of data.

Data never sleeps
kuppusamy
Fluorite | Level 6

Do you have any code or program options which is different from normal?

Sajid01
Meteorite | Level 14

Rather that pull date from database, take processing to where the data resides.

You may get some ideas here https://documentation.sas.com/doc/en/pgmsascdc/v_033/indbug/n1lo1d19ercldkn14vm45k13z3so.htm

SASKiwi
PROC Star

Run a test converting your query into a count of the rows being selected. If this is no faster than reading the selected data into a SAS dataset then it is an Oracle query performance problem. I've found Oracle hints can be helpful for this. A row count test looks like this:

proc sql;
select count(*)
from <My Oracle table>
where <My where clause>
;
quit;

If it is a lot faster than transmitting of the data across your IT network back to SAS (CREATE TABLE) is the bottleneck.

LinusH
Tourmaline | Level 20

READBUFF (as @Ksharp shows in his example) is the only option I know about that could affect performance in the data transfer from Oracle.

BULKOAD does not help here, it helps you when you want to load Oracle tables.

So again, network bandwidth, and Oracle query performance is the two other areas you can look into.

Data never sleeps
Kurt_Bremser
Super User

Please post the complete log of the SQL step that runs too long.

Also let us know how many observations you pull, and the observation size.

Ksharp
Super User
libname x oracle datasrc=....  readbuff=10000 bulkload=yes  ;
proc copy in=x out=work memtype=data ;
select your-table-name ; run;

Try READBUFF= option.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2155 views
  • 2 likes
  • 6 in conversation