Fetching data form oracle

Reply
Frequent Contributor
Posts: 87

Fetching data form oracle

I am fetching huge data from oracle based on ASOFDATE conditionbut it is taking more then 50 minutes

PROC SQL;

connect to oracle(user=XXXXXXX password="XXXXXXXX" path='XXXXXXXXXXXX');

CREATE TABLE ABC AS SELECT * FROM CONNECTION TO ORACLE

(SELECT * XYZ where ASOFDATE='15-AUG-2014');

DISCONNECT FROM ORACLE;

QUIT;

is there any way to minimise time taking


Occasional Contributor
Posts: 10

Re: Fetching data form oracle

Hi Santosh

You can use ORACLE LIBNAME Engine to reduce the time.

Hope following will work for you - please set options correctly. ( path, schema, user , orapw )

LIBNAME oradbms ORACLE PATH=  SCHEMA=  USER=  ORAPW=   ACCESS = READONLY DBINDEX = YES ;

Best Regards

Chandra Prakash

Super User
Super User
Posts: 7,955

Re: Fetching data form oracle

Posted in reply to cpagrawal

Hi,

I wouldn't expect there to be any difference in the operation of the libname syntax against the connect in the proc sql as the actual connection would be a tiny amount of time. 

I would suggest that you have a look at the data on the database and see if there are ways to cut down the amount of data to be output, firstly, do you really want all the variables to come out, if not remove the *.  How many records are you talking about with the where ASOFDATE='15-AUG-2014', restriction?  Maybe try parting it out into smaller subgroups.  It could also be other things, network speed, where files are being written to, amount of ram/processor etc.

Have you tried running the query in Toad or similar to see the operation there?  Also consider writing the data directly out to CSV from the database, then import to SAS, maybe quicker.

Ask a Question
Discussion stats
  • 2 replies
  • 172 views
  • 0 likes
  • 3 in conversation