Extremely slow Oracle Loading

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Extremely slow Oracle Loading

Post by gateleys »

Hi, I have a very simple job which uses a flat-file source that passes through a transformer, where a couple of new fields are appended with some default values and then loaded into Oracle via OCI stage. I use DS7 on Windows, Oracle 9i. The problem is it starts loading at a rate of about 250 rows/sec and starts decreasing steadily, finally to 8 or 9 rows/sec. The total # of rows that need to be loaded are approximately 200,000 with about 12 fields. I tried to load it into a flat-file instead, and it loads in a few seconds. The oracle table definition does contain quite a few constraints. But, I have other tables with similar structure, and they do not exhibit this decrease in performance. Can anybody help me with the problem?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Reasons inserting into a table progressively degrades, any number of the following: indexes, FK constraints, rollback, commit, triggers, tablespaces, partitions. Triggers are huge impactors of insert performance. Then again, what is your SQL? Insert only or are there inserts and updates?

Take your target table and make a copy of it: create table fred as select * from yourslowtable. Create the primary key index just like on yourslowtable so that INSERT else UPDATE is supported with the primary key index. Use this as a target and run your job. If it's wicked fast, then your issue is all of the junk hanging on the real table. If it's just as slow, then it's your job design.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Can you disable the constraints or create a test dummy table in the same schema without the constraints and do a comparison run - this will help localize the cause of the slow load.

Also, can you use the bulk loader (if you are doing pure INSERTS) or are you doing upserts?
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

1. Is the job running in to some kind of warnings. If yes then you need to remove them, as the warnings tend to reduce the performance significantly.
2. Try running the job by changing the options of the processing (to use performance tab in the job properties). In Process.
3. Request your DBA to observe is there any kind of DB activity going on or not?
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

The job contains simple inserts, no updates. Will get my DBA to create a new dummy table without the constraints and check the performance again. Thanks.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you are doing pure inserts you really should look at the performance benefits of doing a bulk load - which can include turning off and subsequently re-enabling constraints for quicker loading. The downside is that if you load data that violates constraints you will have a table with a very upset stomach :roll:
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

Do you have a primary key or unique index on the table? When I have seen loads slow down this much it was because we were getting primary key or unique index violations.

Does your log give you any useful information?
sjhouse
Premium Member
Premium Member
Posts: 43
Joined: Tue Nov 02, 2004 12:11 pm
Location: Minneapolis, MN

Post by sjhouse »

Have you set your 'Array Size' and 'Rows per Transaction'? These 2 parameters in the stage affect our loads into Oracle.

Also, we disable indexes other than the primary key to improve performance.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

kwwilliams wrote:Do you have a primary key or unique index on the table? When I have seen loads slow down this much it was because we were getting primary key or unique index violations.

Does your log give you any useful information?
Yeah, there is a unique index on the table, apart from a few other indices. But, there are no unique index violations since I have had no rejects until about 80,000 rows (Note: the slow performance did not start here, i.e at 80,000 rows, but was there from the very beginning). The log is clean. But, when we tried to remove the constraints, Oracle said that the resource was busy--due to my process. It seems that since I had killed the job (a number of times) because of the slow performance, Oracle still maintained those processes. Would that be the reason for the degradation?
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

sjhouse wrote:Have you set your 'Array Size' and 'Rows per Transaction'? These 2 parameters in the stage affect our loads into Oracle.

Also, we disable indexes other than the primary key to improve performance.
It has been set at 1000 rows. I was trying to load it without disabling any constraints since my previous loads to similar tables did not have the same issue. The only difference is that this table already has over a couple of million records. I guess I have to disable the indices and rebuild them later.

thanks
gateleys
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

As Williams said, it is also likely that you are trying to load duplicate data, thereby violating the unique index, thereby slowing down the load performance.

Please check whether your flat-file has duplicate records or not.

Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

You have to engage your DBA to check what's happening in the system. For resource busy problem there is something running which avoids you to drop any objects on that table. Check with DBA what jobs are running or any locks in your table. Try to clear this off first and do a clean run. After that post your findings further...
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Post by rafidwh »

contact your DBA,some process might be running which needs to be cleaned up and ask the DBA to purge the log file.

No problem with your datastage job,it is the Database issue.

Saik
anujgarg
Participant
Posts: 38
Joined: Sun Jun 26, 2005 11:17 pm

Post by anujgarg »

Hi,

Can you try by collecting DBMS WRITEERROR records.That may also be the reason for slow performance as records may be getting rejected or some problems in writing the records.
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

If you have processes that are tying up the load job, your DBA should be able to see waits taking place. That may be one of the problems that you are having. If you have stopped and started your job multiple times, oracle would lock records and then when your next process starts and the two processes arrive at the same record then it would start cause a wait to take place. But typically those would not take very long to clear, leading me to think this is not the underlying cause of your problem. You still had the first job that had slow performance that would have caused you to stop the job in the first place.

Could you explain the entire layout of your job? Something like:

ODBC Stage --> Transformer --> Oracle Stage

Maybe there is something else there that we are not seeing. One of the more difficult things to debug has always been the handoff from DataStage to the Database and the performance problems that ensue. Is it the database or your job? Tricky question.

Another question do you clear the table before inserting into it? If not, are you sure that the primary key for that table does not exist before you insert into it?
Post Reply