|
|
|
|
|
Re: How to tune my sql script [message #228514 is a reply to message #228456] |
Tue, 03 April 2007 04:43 |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
Memory:
What is the expected time in which this procedure should finish and what is the actual time that it takes?
One thing that may help is run your statement that creates the main cursor, in a sql prompt and check whether this uses the indexes or not.
SELECT ATTRIB_03 FROM SIEBEL.S_CONTACT_FNXM WHERE ATTRIB_06=V_ATTRIB_06 AND LENGTH(ATTRIB_03) =V_ASSET_LENGTH)
MINUS
(SELECT ASSET.ASSET_NUM PID FROM SIEBEL.S_ASSET ASSET, SIEBEL.S_PROD_INT PROD
WHERE ASSET.PROD_ID=PROD.ROW_ID AND
PROD.DETAIL_TYPE_CD IN(V_PRODUCT_TYPE_SVNG,V_PRODUCT_TYPE_TD)
AND LENGTH(ASSET.ASSET_NUM) =V_ASSET_LENGTH))
--run explain plan for this statement and check its output.
Similarly check the explain plans for the update statements like:
UPDATE SIEBEL.CBR_PROD_BAL SET DAT_LAST_MNT = V_MAX_FILE_DATE
WHERE COD_CUST_NATL_ID = tblMissingPID(nRowCounter);
are they using indexes are doing full table scans?
One more thing in the code is:
[B]SET TRANSACTION USE ROLLBACK SEGMENT SBP_BIG_RBS;[/B]
Instead of using RBS , consider using Undo tablespace.
|
|
|
|
|
|
|
Re: How to tune my sql script [message #228720 is a reply to message #228566] |
Tue, 03 April 2007 22:27 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Add a statement after each SQL that inserts a log message into a log table along with the current SYSDATE.
Inspect the log after a full run and work out which bit takes the longest time, and give us THAT to tune, not the entire program.
Ross Leishman
|
|
|