Standards of Performance Tuning required
Hi,
Plz guide me where i would be able to get standards of performance tuning of Oracle DB. So that i can compare the statistics with that.
Regards,
First of all, make sure you understand performance concepts (http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14211/toc.htm), then don't go on comparing statistics as this will not take you but to a dead end filled up with tons of numbers.
It is not possible to talk about a so wide topic here, but If your database is running slow it could be because of one of two reasons, there is an outstanding demand of resources, or there is a lack of resources. Whichever the cause, it produces a bottleneck. Find the bottleneck, troubleshoot it and use statistics to gather a snapshot before and after the procedure.
Similar Messages
-
Application Express performance - tuning required?
We have recently implemented a new Application Express system running under Oracle10g on a Linux/RedHat 4 server (actually a Dell PowerEdge 2850 with 8gb RAM and twin 3gb CPU's). The application mostly flies but on odd days (increasingly) performance degrade to the point where a single refresh takes longer than 5 seconds. We only have about 10 users on the system and the database is shared between about 25 users. We have had the network checked and have ruled that out as it only peaks at about 1.6mbps over a 54mbps line. I have updated stats on the database too. Looking in Enterprise Manager the HTTP_Server is hardly doing anything, the database appears to be using hardly any CPU but the memry allocation line on EM seems to be running along at 8gb all the time. The server is bounced every weekend.
The SQL is nearly all embedded in PL/SQL packages called from App. Ex. We have tried some of the parameter changes mentioned elsewhere in the forum, particularly changing the "keepAlive" parameter = off, from which we saw an immediate performance hike, but which then tailed away.
Can anyone suggest where the problem might be and where I can start looking and tuning to improve the performance of our application. We want to roll it out much more widely but are worried it wont scale to many more users and performance will stop completely.
Its all mighty puzzling so any help would be most welcome.Hi Jeremy,
if you have again such a situation where everything is slow, run your page in debug mode to get some statistics what's taking long. If it is really the rendering of the page or if it is something else (eg network problems).
Just rethought the above what I have written. You can immediately find out if the rendering sometimes really takes longer. Have a look at the dictionary view APEX_WORKSPACE_ACTIVITY_LOG and the column ELAPSED_TIME. It will tell you how long it took to render the page. See if you really have peaks sometimes.
If you don't have a peak there, you probably have more of an network or Apache problem.
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/ -
The table contains 2 crores of records
Its taking lot of time to get executed.
please suggest to improve the performance
The execution of this query taking lot of time in the below procedure
UPDATE ctrl_settled_shipments
SET
msrbnr = v_document_ids (i),
msrdat = SYSDATE
WHERE msdgnr = v_consignment_ids (i) AND msrbnr IS NULL;
PROCEDURE proctest(
data_source IN VARCHAR2,
toll_flag IN NUMBER,
damage_status IN NUMBER,
execid IN NUMBER,
msg OUT VARCHAR2
As
UPDATE controlling
SET
-- MSREKO= rec.lv_consignment_amount,
msrbnr = v_document_ids (i),
msrdat = SYSDATE
WHERE msdgnr = v_consignment_ids (i) AND msrbnr IS NULL;
lv_document_no NUMBER;
lv_consignment_number NUMBER;
lv_consignment_amount NUMBER;
lv_doc_type VARCHAR2 (2);
lv_damage_amount NUMBER;
lv_ilnbetr NUMBER;
lv_spedbetr NUMBER;
lv_spedbetr_flag NUMBER;
lv_ilnbetr_flag NUMBER;
c_consigment_numbers billing_pkg.cursor_typ;
TYPE t_num_array IS TABLE OF NUMBER
INDEX BY BINARY_INTEGER;
TYPE t_char_array IS TABLE OF VARCHAR2 (20)
INDEX BY BINARY_INTEGER;
v_consignment_ids t_char_array;
v_document_ids t_num_array;
v_doc_type_ids t_char_array;
v_consignment_amts t_num_array;
v_spedbetr_amts t_num_array;
v_ilnbetr_amts t_num_array;
v_spedbetr_flags t_num_array;
v_ilnbetr_flags t_num_array;
v_row_count NUMBER := 0;
ort varchar2(50);
cons_query varchar2(1000);
pctx bl_plog.log_ctx
:= bl_plog.init ('BL_UPDATED_CONTROLLING', plevel => bl_plog.LINFO);--NP
BEGIN
pctx.lsubsection := ''||execid;
BL_PLOG.INFO(pctx,' data_source ' || data_source);
IF UPPER (data_source) = 'CONTROLLING' THEN
cons_query :=
' SELECT document_no AS lv_document_no,
blc.msdgnr AS lv_consignment_number,
doc_type AS lv_doc_type,
0 AS lv_consignment_amount,
0 AS lv_ilnbetr,
0 AS lv_spedbetr,
0 AS lv_spedbetr_flag,
0 AS lv_ilnbetr_flag
FROM tmp_header_position_amount1,bl_controlling blc
WHERE document_no IS NOT NULL
and document_no = decode(doc_type,''R'',msrbnr,''G'',msgbnr)
and blc.exec_id = '||execid;
ELSIF UPPER (data_source) = 'BL_CONT_SCHADEN' THEN
cons_query :=
'SELECT document_no AS lv_document_no,
bcs.bcs_msdgnr AS lv_consignment_number,
doc_type AS lv_doc_type,
decode(doc_type,''R'',bcs_msreko,''G'',bcs_msguko) AS lv_consignment_amount,
nvl(bcs.bcs_ilnbetr,0) AS lv_ilnbetr,
nvl(bcs.bcs_spedbetr,0) AS lv_spedbetr,
bcs.bcs_spedbetr_flag AS lv_spedbetr_flag,
bcs.bcs_ilnbetr_flag AS lv_ilnbetr_flag
FROM tmp_header_position_amount1,bl_cont_schaden bcs
WHERE document_no IS NOT NULL
and document_no = decode(doc_type,''R'',bcs_msrbnr,''G'',bcs_msgbnr)
and bcs.exec_id = '||execid;
END IF;
OPEN c_consigment_numbers FOR cons_query;
LOOP
FETCH c_consigment_numbers
BULK COLLECT INTO v_document_ids, v_consignment_ids,
v_doc_type_ids, v_consignment_amts, v_ilnbetr_amts,
v_spedbetr_amts, v_spedbetr_flags, v_ilnbetr_flags LIMIT 200;
EXIT WHEN v_row_count = c_consigment_numbers%ROWCOUNT;
v_row_count := c_consigment_numbers%ROWCOUNT;
FOR i IN 1 .. v_consignment_ids.COUNT
LOOP
--IF UPPER (data_source) ='CONTROLLING' AND rec.lv_doc_type = Billing_Pkg.BILL THEN
IF UPPER (data_source) = 'CONTROLLING'
AND v_doc_type_ids (i) = billing_pkg.bill
THEN
UPDATE ctrl_settled_shipments
SET
msrbnr = v_document_ids (i),
msrdat = SYSDATE
WHERE msdgnr = v_consignment_ids (i) AND msrbnr IS NULL;
end if;
commit;
end loop;
EXCEPTION
WHEN OTHERS
THEN
msg:='records failed to update'||sqlerrm;
rollback;
end proctest;
Edited by: 812809 on 9 Jul, 2011 5:48 AMYou think your problem is the UPDATE? How long does a SINGLE update take? Ever tried? Did you run a trace followed by TKPROF?
Your problem is that you use a lot of code, nested loops, dynamic SQL etc. when you can do the update with a singe MERGE command, which will reduce to less than 10% of your code and be VERY much faster.
something like this. (If I got the idea of your code correct)
MERGE INTO ctrl_settled_shipments X
USING (
SELECT document_no AS lv_document_no,
blc.msdgnr AS lv_consignment_number,
doc_type AS lv_doc_type,
s.rowid rid
FROM tmp_header_position_amount1,
bl_controlling blc,
ctrl_settled_shipments s
WHERE document_no IS NOT NULL
and document_no = decode(doc_type,''R'',msrbnr,''G'',msgbnr)
and blc.exec_id = execid
and s.msdgnr = blc.msdgnr AND s.msrbnr IS NULL) Y
on x.rowid = y.rid
WHEN MATCHED THEN UPDATE
msrbnr = lv_document_no,
msrdat = SYSDATE; -
Performance Tuning for ECC 6.0
Hi All,
I have an ECC 6.0EP 7.0(ABAPJAVA). My system is very slow. I have Oracle 10.2.0.1.
Can you please guide me how to do these steps in the sytem
1) Reorganization should be done at least for the top 10 huge tables
and their indexes
2) Unaccessed data can be taken out by SAP Archiving
3)Apply the relevant corrections for top sap standard objects
4) CBO update statistics must be latest for all SAP and customer objects
I have never done performance tuning and want to do it on this system.
Regards,
JitenderHi,
Below are the details of ST06. Please suggest me what should I do. the system performance is very bad.
I require your inputs for performance tuning
CPU
Utilization user % 3 Count 2
system % 3 Load average 1min 0.11
idle % 1 5 min 0.21
io wait % 93 15 min 0.22
System calls/s 982 Context switches/s 1752
Interrupts/s 4528
Memory
Physical mem avail Kb 6291456 Physical mem free Kb 93992
Pages in/s 473 Kb paged in/s 3784
Pages out/s 211 Kb paged out/s 1688
Pool
Configured swap Kb 26869896 Maximum swap-space Kb 26869896
Free in swap-space Kb 21631032 Actual swap-space Kb 26869896
Disk with highest response time
Name md3 Response time ms 51
Utilization 2 Queue 0
Avg wait time ms 0 Avg service time ms 51
Kb transfered/s 2 Operations/s 0
Current parameters in the system
System: sapretail_RET_01 Profile Parameters for SAP Buffers
Date and Time: 08.01.2009 13:27:54
Buffer Name Comment
Profile Parameter Value Unit Comment
Program buffer PXA
abap/buffersize 450000 kB Size of program buffer
abap/pxa shared Program buffer mode
|
CUA buffer CUA
rsdb/cua/buffersize 3000 kB Size of CUA buffer
The number of max. buffered CUA objects is always: size / (2 kB)
|
Screen buffer PRES
zcsa/presentation_buffer_area 4400000 Byte Size of screen buffer
sap/bufdir_entries 2000 Max. number of buffered screens
|
Generic key table buffer TABL
zcsa/table_buffer_area 30000000 Byte Size of generic key table buffer
zcsa/db_max_buftab 5000 Max. number of buffered objects
|
Single record table buffer TABLP
rtbb/buffer_length 10000 kB Size of single record table buffer
rtbb/max_tables 500 Max. number of buffered tables
|
Export/import buffer EIBUF
rsdb/obj/buffersize 4096 kB Size of export/import buffer
rsdb/obj/max_objects 2000 Max. number of objects in the buffer
rsdb/obj/large_object_size 8192 Bytes Estimation for the size of the largest object
rsdb/obj/mutex_n 0 Number of mutexes in Export/Import buffer
|
OTR buffer OTR
rsdb/otr/buffersize_kb 4096 kB Size of OTR buffer
rsdb/otr/max_objects 2000 Max. number of objects in the buffer
rsdb/otr/mutex_n 0 Number of mutexes in OTR buffer
|
Exp/Imp SHM buffer ESM
rsdb/esm/buffersize_kb 4096 kB Size of exp/imp SHM buffer
rsdb/esm/max_objects 2000 Max. number of objects in the buffer
rsdb/esm/large_object_size 8192 Bytes Estimation for the size of the largest object
rsdb/esm/mutex_n 0 Number of mutexes in Exp/Imp SHM buffer
|
Table definition buffer TTAB
rsdb/ntab/entrycount 20000 Max. number of table definitions buffered
The size of the TTAB is nearly 100 bytes * rsdb/ntab/entrycount
|
Field description buffer FTAB
rsdb/ntab/ftabsize 30000 kB Size of field description buffer
rsdb/ntab/entrycount 20000 Max. number / 2 of table descriptions buffered
FTAB needs about 700 bytes per used entry
|
Initial record buffer IRBD
rsdb/ntab/irbdsize 6000 kB Size of initial record buffer
rsdb/ntab/entrycount 20000 Max. number / 2 of initial records buffered
IRBD needs about 300 bytes per used entry
|
Short nametab (NTAB) SNTAB
rsdb/ntab/sntabsize 3000 kB Size of short nametab
rsdb/ntab/entrycount 20000 Max. number / 2 of entries buffered
SNTAB needs about 150 bytes per used entry
|
Calendar buffer CALE
zcsa/calendar_area 500000 Byte Size of calendar buffer
zcsa/calendar_ids 200 Max. number of directory entries
|
Roll, extended and heap memory EXTM
ztta/roll_area 3000000 Byte Roll area per workprocess (total)
ztta/roll_first 1 Byte First amount of roll area used in a dialog WP
ztta/short_area 3200000 Byte Short area per workprocess
rdisp/ROLL_SHM 16384 8 kB Part of roll file in shared memory
rdisp/PG_SHM 8192 8 kB Part of paging file in shared memory
rdisp/PG_LOCAL 150 8 kB Paging buffer per workprocess
em/initial_size_MB 4092 MB Initial size of extended memory
em/blocksize_KB 4096 kB Size of one extended memory block
em/address_space_MB 4092 MB Address space reserved for ext. mem. (NT only)
ztta/roll_extension 2000000000 Byte Max. extended mem. per session (external mode)
abap/heap_area_dia 2000000000 Byte Max. heap memory for dialog workprocesses
abap/heap_area_nondia 2000000000 Byte Max. heap memory for non-dialog workprocesses
abap/heap_area_total 2000000000 Byte Max. usable heap memory
abap/heaplimit 40000000 Byte Workprocess restart limit of heap memory
abap/use_paging 0 Paging for flat tables used (1) or not (0)
|
Statistic parameters
rsdb/staton 1 Statistic turned on (1) or off (0)
rsdb/stattime 0 Times for statistic turned on (1) or off (0)
Regards,
Jitender -
Performance tuning of this report
Hello friends iam attaching my report give the performance tuning for this report to avoid nested endloops. how to do without using nested endloops.
give me the reply urgent.
REPORT ZDEMO9 NO STANDARD PAGE HEADING
LINE-SIZE 250
LINE-COUNT 22(3). .
TABLES DECLARATION *
TABLES : MARA, "general material data
MAKT, "material description
MARC, "plant data for material
VBAP, "sales document for item data
EKKO, "purchasing document header
EKPO, "purchasing document item
KNA1. "customer master details
INTERNAL TABLE DECLARATION *
DATA : BEGIN OF T_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MEINS LIKE MARA-MEINS,
END OF T_MARA.
DATA : BEGIN OF T_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
SPRAS LIKE MAKT-SPRAS,
END OF T_MAKT.
DATA : BEGIN OF T_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
END OF T_MARC.
DATA : BEGIN OF T_KNA1 OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
LAND1 LIKE KNA1-LAND1,
END OF T_KNA1.
DATA : BEGIN OF T_VBAP OCCURS 0,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
MATKL LIKE VBAP-MATKL,
VBELN LIKE VBAP-VBELN,
END OF T_VBAP.
DATA : BEGIN OF T_EKPO OCCURS 0,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
BUKRS LIKE EKPO-BUKRS,
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
MATNR LIKE EKPO-MATNR,
MANDT LIKE EKPO-MANDT,
END OF T_EKPO.
FINAL INTERNAL TABLE *
DATA : BEGIN OF T_FINAL OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MEINS LIKE MARA-MEINS,
WERKS LIKE MARC-WERKS,
MAKTX LIKE MAKT-MAKTX,
SPRAS LIKE MAKT-SPRAS,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATKL LIKE VBAP-MATKL,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
BUKRS LIKE EKPO-BUKRS,
KUNNR LIKE KNA1-KUNNR,
LAND1 LIKE KNA1-LAND1,
NAME1 LIKE KNA1-NAME1,
LGORT LIKE EKPO-LGORT,
END OF T_FINAL.
*DATA: BEGIN OF V_matnr OCCURS 0,
matnr LIKE mara-matnr,
END OF t_matnr.
data:
a(32) type c.
a = 'IBT000000000000000001000000000000000050'.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_BUKRS FOR EKPO-BUKRS,
S_KUNNR FOR KNA1-KUNNR,
S_WERKS FOR MARC-WERKS,
S_MATNR FOR MARA-MATNR obligatory.
SELECTION-SCREEN END OF BLOCK B1.
START OF SELECTION *
START-OF-SELECTION.
SELECT MATNR mtart meins
FROM MARA
INTO CORRESPONDING FIELDS OF TABLE T_MARA
WHERE MATNR IN S_MATNR.
SELECT MATNR WERKS
FROM MARC
INTO CORRESPONDING FIELDS OF TABLE T_MARC
FOR ALL ENTRIES IN T_MARA
WHERE MATNR = T_MARA-MATNR
and werks in s_werks.
select matnr maktx spras
from makt
into corresponding fields of table t_makt
for all entries in t_mara
where matnr = t_mara-matnr
and spras = sy-langu.
select matnr posnr matkl vbeln
from vbap
into corresponding fields of table t_vbap
for all entries in t_mara
where matnr = t_mara-matnr.
select matnr werks bukrs ebeln ebelp lgort
from ekpo
into corresponding fields of table t_ekpo
for all entries in t_mara
where matnr = t_mara-matnr
and werks in s_werks.
LOOP AT T_MARA.
MOVE T_MARA-matnr TO T_FINAL-matnr.
move t_mara-mtart to t_final-mtart.
move t_mara-meins to t_final-meins.
loop at t_marc where matnr eq t_mara-matnr.
move t_marc-werks to t_final-werks.
loop at t_makt.
move t_makt-maktx to t_final-maktx.
move t_makt-spras to t_final-spras.
loop at t_vbap.
move t_vbap-posnr to t_final-posnr.
move t_vbap-matkl to t_final-matkl.
move t_vbap-vbeln to t_final-vbeln.
loop at t_ekpo.
move t_ekpo-bukrs to t_final-bukrs.
move t_ekpo-ebeln to t_final-ebeln.
move t_ekpo-ebelp to t_final-ebelp.
move t_ekpo-lgort to t_final-lgort.
append t_final.
endloop.
endloop.
endloop.
endloop.
endloop.
SELECT werks KUNNR LAND1 NAME1
INTO CORRESPONDING FIELDS OF TABLE T_KNA1
FROM KNA1.
WHERE WERKS in s_werks.
loop at t_kna1.
move t_kna1-kunnr to t_final-kunnr.
move t_kna1-name1 to t_final-name1.
move t_kna1-land1 to t_final-land1.
append t_final.
endloop.
"endloop.
loop at t_final.
write : 4 t_final-matnr,
20 t_final-mtart,
28 t_final-meins,
46 t_final-werks,
58 t_final-maktx,
71 t_final-spras,
78 t_final-posnr,
100 t_final-matkl,
115 t_final-vbeln,
130 t_final-kunnr,
142 t_final-name1,
156 t_final-land1,
168 t_final-bukrs,
190 t_final-ebeln,
205 t_final-ebelp,
208 t_final-lgort.
endloop.
TOP-OF-PAGE *
top-of-page.
uline.
write : /60 'G E N E R A L D E T A I L S' COLOR 2 INVERSE OFF.
ULINE.
write :/ SY-VLINE, 'MATERIAL' COLOR 4, "12 SY-VLINE,
13 SY-VLINE, 'IND SECTOR',
28 SY-VLINE, 'UNITS',
43 SY-VLINE, 'PLANT',
55 SY-VLINE, 'MAT DESC',
68 SY-VLINE, 'LANGU',
70 SY-VLINE, 'SALES DOC ITEM',
95 SY-VLINE, 'MAT GROUP',
110 SY-VLINE, 'SALES DOC',
125 SY-VLINE, 'CUST ID',
140 SY-VLINE, 'NAME',
155 SY-VLINE, 'COUNTRY',
165 sy-vline, 'company code',
205 sy-vline, 'storge loc'.*& Report YTESTCHA *
REPORT ytestcha NO STANDARD PAGE HEADING
LINE-SIZE 250
LINE-COUNT 22(3). .
TABLES DECLARATION *
TABLES : mara, "general material data
makt, "material description
marc, "plant data for material
vbap, "sales document for item data
ekko, "purchasing document header
ekpo, "purchasing document item
kna1. "customer master details
INTERNAL TABLE DECLARATION *
*DECLARE TYPES FIRST AND THE INTERNAL TABLES
*DONT USE MATNR LIKE MARA-MATNR ,INSTEAD USE MARA TYPE MATNR WHERE MATNR
*IS THE DATA ELEMENT FOR FIELD MATNR.
TYPES: BEGIN OF ty_mara,
matnr TYPE matnr,
mtart TYPE mtart,
meins TYPE meins,
kunnr TYPE wettb,
END OF ty_mara.
TYPES: BEGIN OF ty_makt,
matnr TYPE matnr,
maktx TYPE maktx,
spras TYPE spras,
END OF ty_makt.
TYPES: BEGIN OF ty_marc,
matnr TYPE matnr,
werks TYPE werks_d,
END OF ty_marc.
TYPES : BEGIN OF ty_kna1,
kunnr TYPE kunnr,
name1 TYPE name1_gp,
land1 TYPE land1_gp,
END OF ty_kna1.
TYPES: BEGIN OF ty_vbap,
matnr TYPE matnr,
posnr TYPE posnr_va,
matkl TYPE matkl,
vbeln TYPE vbeln_va,
END OF ty_vbap.
TYPES: BEGIN OF ty_ekpo,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
bukrs TYPE bukrs,
werks TYPE werks_d,
lgort TYPE lgort_d,
matnr TYPE matnr,
mandt TYPE mandt,
END OF ty_ekpo.
DATA:t_mara TYPE TABLE OF ty_mara WITH HEADER LINE,
t_makt TYPE TABLE OF ty_makt WITH HEADER LINE,
t_marc TYPE TABLE OF ty_marc WITH HEADER LINE,
t_kna1 TYPE TABLE OF ty_kna1 WITH HEADER LINE,
t_vbap TYPE TABLE OF ty_vbap WITH HEADER LINE,
t_ekpo TYPE TABLE OF ty_ekpo WITH HEADER LINE.
FINAL INTERNAL TABLE *
TYPES: BEGIN OF ty_final,
matnr TYPE matnr,
mtart TYPE mtart,
meins TYPE meins,
werks TYPE werks_d,
maktx TYPE maktx,
spras TYPE spras,
vbeln TYPE vbeln_va,
posnr TYPE posnr_va,
matkl TYPE matkl,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
bukrs TYPE bukrs,
kunnr TYPE kunnr,
land1 TYPE land1_gp,
name1 TYPE name1_gp,
lgort TYPE lgort_d,
END OF ty_final.
DATA : t_final TYPE TABLE OF ty_final WITH HEADER LINE.
*DATA: BEGIN OF V_matnr OCCURS 0,
matnr LIKE mara-matnr,
END OF t_matnr.
DATA:
a(32) TYPE c.
a = 'IBT000000000000000001000000000000000050'.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_bukrs FOR ekpo-bukrs,
s_kunnr FOR kna1-kunnr,
s_werks FOR marc-werks,
s_matnr FOR mara-matnr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
START OF SELECTION *
START-OF-SELECTION.
*USE SUBROUTINES
*get data
PERFORM get_data.
*populate final table
PERFORM populate_final_table.
END-OF-SELECTION.
*display output
PERFORM display_output.
TOP-OF-PAGE *
TOP-OF-PAGE.
ULINE.
WRITE : /60 'G E N E R A L D E T A I L S' COLOR 2 INVERSE OFF.
ULINE.
WRITE :/ sy-vline, 'MATERIAL' COLOR 4, "12 SY-VLINE,
13 sy-vline, 'IND SECTOR',
28 sy-vline, 'UNITS',
43 sy-vline, 'PLANT',
55 sy-vline, 'MAT DESC',
68 sy-vline, 'LANGU',
70 sy-vline, 'SALES DOC ITEM',
95 sy-vline, 'MAT GROUP',
110 sy-vline, 'SALES DOC',
125 sy-vline, 'CUST ID',
140 sy-vline, 'NAME',
155 sy-vline, 'COUNTRY',
165 sy-vline, 'company code',
205 sy-vline, 'storge loc'.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
*TRY TO CLEAR AND REFRESH TABLES BEFORE SELECT
FORM get_data .
CLEAR t_mara.
REFRESH t_mara.
SELECT matnr
mtart
meins
kunnr
FROM mara
INTO TABLE t_mara
WHERE matnr IN s_matnr.
IF NOT t_mara[] IS INITIAL.
CLEAR t_marc.
REFRESH t_marc.
SELECT matnr
werks
FROM marc
INTO TABLE t_marc
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr
AND werks IN s_werks.
CLEAR t_makt.
REFRESH t_makt.
SELECT matnr
maktx
spras
FROM makt
INTO TABLE t_makt
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr
AND spras = sy-langu.
CLEAR t_vbap.
REFRESH t_vbap.
SELECT matnr
posnr
matkl
vbeln
FROM vbap
INTO TABLE t_vbap
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr.
CLEAR t_ekpo.
REFRESH t_ekpo.
SELECT ebeln
ebelp
bukrs
werks
lgort
matnr
mandt
FROM ekpo
INTO TABLE t_ekpo
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr
AND werks IN s_werks.
ENDIF.
CLEAR t_kna1.
REFRESH t_kna1.
SELECT kunnr
land1
name1
INTO TABLE t_kna1
FROM kna1.
WHERE WERKS in s_werks.
ENDFORM. " GET_DATA
*& Form POPULATE_FINAL_TABLE
text
--> p1 text
<-- p2 text
FORM populate_final_table .
*AVOID LOOPS AND TRY TO USE READ
CLEAR t_final.
REFRESH t_final.
LOOP AT t_mara.
MOVE t_mara-matnr TO t_final-matnr.
MOVE t_mara-mtart TO t_final-mtart.
MOVE t_mara-meins TO t_final-meins.
READ TABLE t_marc WITH KEY matnr = t_mara-matnr.
MOVE t_marc-werks TO t_final-werks.
READ TABLE t_makt WITH KEY matnr = t_mara-matnr.
MOVE t_makt-maktx TO t_final-maktx.
MOVE t_makt-spras TO t_final-spras.
READ TABLE t_vbap WITH KEY matnr = t_mara-matnr.
MOVE t_vbap-posnr TO t_final-posnr.
MOVE t_vbap-matkl TO t_final-matkl.
MOVE t_vbap-vbeln TO t_final-vbeln.
READ TABLE t_ekpo WITH KEY matnr = t_mara-matnr.
MOVE t_ekpo-bukrs TO t_final-bukrs.
MOVE t_ekpo-ebeln TO t_final-ebeln.
MOVE t_ekpo-ebelp TO t_final-ebelp.
MOVE t_ekpo-lgort TO t_final-lgort.
READ TABLE t_kna1 WITH KEY kunnr = t_mara-kunnr.
MOVE t_kna1-kunnr TO t_final-kunnr.
MOVE t_kna1-name1 TO t_final-name1.
MOVE t_kna1-land1 TO t_final-land1.
APPEND t_final.
CLEAR :t_final,t_mara,t_marc,t_makt,t_ekpo,t_vbap.
ENDLOOP.
ENDFORM. " POPULATE_FINAL_TABLE
*& Form DISPLAY_OUTPUT
text
--> p1 text
<-- p2 text
FORM display_output .
LOOP AT t_final.
WRITE : 4 t_final-matnr,
20 t_final-mtart,
28 t_final-meins,
46 t_final-werks,
58 t_final-maktx,
71 t_final-spras,
78 t_final-posnr,
100 t_final-matkl,
115 t_final-vbeln,
130 t_final-kunnr,
142 t_final-name1,
156 t_final-land1,
168 t_final-bukrs,
190 t_final-ebeln,
205 t_final-ebelp,
208 t_final-lgort.
ENDLOOP.
ENDFORM. " DISPLAY_OUTPUT -
Oracle Performance Tuning Certification
Hi Guys
I am going for 10g OCP then maybe 11g Tuning Expert Certification.
1. I look at the prerequisites of 10g Performance Tuning course:
Required Prerequisites:
* Knowledge of Database Administration
* Oracle Database 10g: Administration Workshop I Release 2
* Oracle Database 10g: Administration Workshop II
* Oracle Database 10g: New Features for Administrators Release 2
Does this mean that it is COMPULSORY that I take the 3 courses above first before I can take the Performance tuning course? This cost a lot of $$$! ; o
2. Where can I get 11gTuning Expert Certification practice questions? From the 11g Performance Tuning course? Couldn't find it in SelfTestSoftware....
Advance thanks!user8092567 wrote:
Hi,
Exam # 1Z0-044 does not exist.
Why there is no Oracle exam for Performance Tuning for 10g?
There is one for 9i and there will be one for 11g (currently it is in beta).
Lorrys,
I guess this needs to be corrected a bit. 9i exam is a part of teh OCP track, its not an individual exam which you may clear and would be awarded an certification for it. OCE is itself is an certification track and unlikely OCP, it doesn't need multiple exams to be cleared. You just have to clear one exam and youwould be awarded teh certification. Now, about the 10g exam of PT OCE not being there and given in 11g, it should make sense as 11g is already out and there is no point in launchnig a NEW certification track for a previous version. So that's why 11g PT is launched for the newest release, which is 11g.
That said, I am not from Oracle so its just my own opinion about your comment.
HTH
Aman.... -
Performance Tuning Query on Large Tables
Hi All,
I am new to the forums and have a very specic use case which requires performance tuning, but there are some limitations on what changes I am actualy able to make to the underlying data. Essentially I have two tables which contain what should be identical data, but for reasons of a less than optimal operational nature, the datasets are different in a number of ways.
Essentially I am querying call record detail data. Table 1 (refered to in my test code as TIME_TEST) is what I want to consider the master data, or the "ultimate truth" if you will. Table one contains the CALLED_NUMBER which is always in a consistent format. It also contains the CALLED_DATE_TIME and DURATION (in seconds).
Table 2 (TIME_TEST_COMPARE) is a reconciliation table taken from a different source but there is no consistent unique identifiers or PK-FK relations. This table contains a wide array of differing CALLED_NUMBER formats, hugely different to that in the master table. There is also scope that the time stamp may be out by up to 30 seconds, crazy I know, but that's just the way it is and I have no control over the source of this data. Finally the duration (in seconds) can be out by up to 5 seconds +/-.
I want to create a join returning all of the master data and matching the master table to the reconciliation table on CALLED_NUMBER / CALL_DATE_TIME / DURATION. I have written the query which works from a logi perspective but it performs very badly (master table = 200,000 records, rec table = 6,000,000+ records). I am able to add partitions (currently the tables are partitioned by month of CALL_DATE_TIME) and can also apply indexes. I cannot make any changes at this time to the ETL process loading the data into these tables.
I paste below the create table and insert scripts to recreate my scenario & the query that I am using. Any practical suggestions for query / table optimisation would be greatly appreciated.
Kind regards
Mike
-------------- NOTE: ALL DATA HAS BEEN DE-SENSITISED
/* --- CODE TO CREATE AND POPULATE TEST TABLES ---- */
--CREATE MAIN "TIME_TEST" TABLE: THIS TABLE HOLDS CALLED NUMBERS IN A SPECIFIED/PRE-DEFINED FORMAT
CREATE TABLE TIME_TEST ( CALLED_NUMBER VARCHAR2(50 BYTE),
CALLED_DATE_TIME DATE, DURATION NUMBER );
COMMIT;
-- CREATE THE COMPARISON TABLE "TIME_TEST_COMPARE": THIS TABLE HOLDS WHAT SHOULD BE (BUT ISN'T) IDENTICAL CALL DATA.
-- THE DATA CONTAINS DIFFERING NUMBER FORMATS, SLIGHTLY DIFFERENT CALL TIMES (ALLOW +/-60 SECONDS - THIS IS FOR A GOOD, ALBEIT UNHELPFUL, REASON)
-- AND DURATIONS (ALLOW +/- 5 SECS)
CREATE TABLE TIME_TEST_COMPARE ( CALLED_NUMBER VARCHAR2(50 BYTE),
CALLED_DATE_TIME DATE, DURATION NUMBER )
COMMIT;
--CREATE INSERT DATA FOR THE MAIN TEST TIME TABLE
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 202);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 08:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 19);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 07:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 35);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 09:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 30);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:18:47 AM', 'MM/DD/YYYY HH:MI:SS AM'), 6);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:20:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 20);
COMMIT;
-- CREATE INSERT DATA FOR THE TABLE WHICH NEEDS TO BE COMPARED:
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:10:51 AM', 'MM/DD/YYYY HH:MI:SS AM'), 200);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'00447721345675', TO_DATE( '11/09/2011 08:10:59 AM', 'MM/DD/YYYY HH:MI:SS AM'), 21);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'07721345675', TO_DATE( '11/09/2011 07:11:20 AM', 'MM/DD/YYYY HH:MI:SS AM'), 33);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'+447721345675', TO_DATE( '11/09/2011 09:10:01 AM', 'MM/DD/YYYY HH:MI:SS AM'), 33);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'+447721345675#181345', TO_DATE( '11/09/2011 06:18:35 AM', 'MM/DD/YYYY HH:MI:SS AM')
, 6);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'004477213456759777799', TO_DATE( '11/09/2011 06:19:58 AM', 'MM/DD/YYYY HH:MI:SS AM')
, 17);
COMMIT;
/* --- QUERY TO UNDERTAKE MATCHING WHICH REQUIRES OPTIMISATION --------- */
SELECT MAIN.CALLED_NUMBER AS MAIN_CALLED_NUMBER, MAIN.CALLED_DATE_TIME AS MAIN_CALL_DATE_TIME, MAIN.DURATION AS MAIN_DURATION,
COMPARE.CALLED_NUMBER AS COMPARE_CALLED_NUMBER,COMPARE.CALLED_DATE_TIME AS COMPARE_CALLED_DATE_TIME,
COMPARE.DURATION COMPARE_DURATION
FROM
SELECT CALLED_NUMBER, CALLED_DATE_TIME, DURATION
FROM TIME_TEST
) MAIN
LEFT JOIN
SELECT CALLED_NUMBER, CALLED_DATE_TIME, DURATION
FROM TIME_TEST_COMPARE
) COMPARE
ON INSTR(COMPARE.CALLED_NUMBER,MAIN.CALLED_NUMBER)<> 0
AND MAIN.CALLED_DATE_TIME BETWEEN COMPARE.CALLED_DATE_TIME-(60/86400) AND COMPARE.CALLED_DATE_TIME+(60/86400)
AND MAIN.DURATION BETWEEN MAIN.DURATION-(5/86400) AND MAIN.DURATION+(5/86400);What does your execution plan look like?
-
LDAP Performance Tuning In Large Deployments - numconnect parameter
LDAP Performance Tuning In Large Deployments - numconnect parameter
<p>
Tuning the LDAP connections
(numconnect parameter)
This parameter translates directly into the number of unidas processes that will
be launched when Calendar Server is started. A process takes time to load, uses
RAM, and when active, CPU cycles. And, unidas maintains an LDAP client
connection to a Directory Server which can only support a fixed number of these
connections. Since a calendar client does not require constant directory access
then having a matching number of unidas processes (to match uniengd "client"
processes) is not a good configuration.
Basically, a calendar client will make many requests for LDAP information, even
if the event information being retrieved is not currently view able. For example,
if the calendar client is displaying a week view with 20 events and each event
has 5 attendees, that will translate into at least 100 separate ldap search
requests for the given name and surname of each attendee. What this means is
that an "active" calendar user will require the services of a calendar server
unidas connection quite often.
Recommendation is that you increase the number of unidas connections
to match the number of "active" calendar users. Our experience is that
at least 20% of the number of configured users (lck_users from the
/users/unison/misc/unison.ini file) are actually logged in, and 10% of
those calendar users are active. For example, if have 3000 configured
calendar users, 600 configured are logged in and 10% of the logged in
are active, which would translate into at least 60 unidas connections.
Keep in mind that configured vs logged in vs active might be different at each
customer site, so please adjust your number of unidas connections
accordingly. To set this up, edit the /users/unison/log/unison.ini file and add
the numconnect parameter to the section noted (where "hostname" is the name of
your local host):
[LCK]
lck_users = 600
[hostname,unidas]
numconnect = 60
The calendar server will need to be restarted after making changes
to the /users/unison/log/unison.ini file, before those changes will
take effect.
Note: Due to some architectural changes in the Calendar Server 4.x, the total
number of DAS connections should never be set higher than 250.
Recommendations for num_connect would be a maximum of 5% of logged on users.
However, keep in mind that 250 das connections is a very high number.
Example:
[LCK]
lck_users = 5000
[hostname,unidas]
numconnect = 250Thank you very much, I am looking from now for a good performance Tuning book writen by Jonathan Lewis. I dont think Jonathan can come to Spain and give lessons...Anyway I will email to him...
But, could you please clarify 2 points to me
1- Should I modify manually memory parameters like buffer cache, shared pool, large pool etc...if those areas are spotted Small and areas causes of performace problem in the AWR, ADDM or ASH reports even if the memory is automatic managed ?
In the case of yes, Why Oracle named it "Memory automatic managed" if I have to set some values of memory manually ?
2- When ADDM report suggests me to increase the SGA size; from where ADDM got this recomandation?. I mean is it recomandation based on statistics collected of Both Oracle and OS ? I am asking this question because, from our report I ran 3 weeks ago, ADDM suggested me to increase the SGA to 10GB (total memeory of the serve is 16GB), I did the change and from that moment the server is SWAP... and now ADDM report suggests me again to increase the SGA to 12GB .
Best reagards -
Performance tuning for Sales Order and its configuration data extraction
I write here the data fetching subroutine of an extract report.
This report takes 2.5 hours to extract 36000 records in the quality server.
Kindly provide me some suggestions for performance tuning it.
SELECT auart vkorg vtweg spart vkbur augru
kunnr yxinsto bstdk vbeln kvgr1 kvgr2 vdatu
gwldt audat knumv
FROM vbak
INTO TABLE it_vbak
WHERE vbeln IN s_vbeln
AND erdat IN s_erdat
AND auart IN s_auart
AND vkorg = p_vkorg
AND spart IN s_spart
AND vkbur IN s_vkbur
AND vtweg IN s_vtweg.
IF NOT it_vbak[] IS INITIAL.
SELECT mvgr1 mvgr2 mvgr3 mvgr4 mvgr5
yyequnr vbeln cuobj
FROM vbap
INTO TABLE it_vbap
FOR ALL ENTRIES IN it_vbak
WHERE vbeln = it_vbak-vbeln
AND posnr = '000010'.
SELECT bstkd inco1 zterm vbeln
prsdt
FROM vbkd
INTO TABLE it_vbkd
FOR ALL ENTRIES IN it_vbak
WHERE vbeln = it_vbak-vbeln.
SELECT kbetr kschl knumv
FROM konv
INTO TABLE it_konv
FOR ALL ENTRIES IN it_vbak
WHERE knumv = it_vbak-knumv
AND kschl = 'PN00'.
SELECT vbeln parvw kunnr
FROM vbpa
INTO TABLE it_vbpa
FOR ALL ENTRIES IN it_vbak
WHERE vbeln = it_vbak-vbeln
AND parvw IN ('PE', 'YU', 'RE').
ENDIF.
LOOP AT it_vbap INTO wa_vbap.
IF NOT wa_vbap-cuobj IS INITIAL.
CALL FUNCTION 'VC_I_GET_CONFIGURATION'
EXPORTING
instance = wa_vbap-cuobj
language = sy-langu
TABLES
configuration = it_config
EXCEPTIONS
instance_not_found = 1
internal_error = 2
no_class_allocation = 3
instance_not_valid = 4
OTHERS = 5.
IF sy-subrc = 0.
READ TABLE it_config WITH KEY atnam = 'IND_PRODUCT_LINES'.
IF sy-subrc = 0.
wa_char-obj = wa_vbap-cuobj.
wa_char-atnam = it_config-atnam.
wa_char-atwrt = it_config-atwrt.
APPEND wa_char TO it_char.
CLEAR wa_char.
ENDIF.
READ TABLE it_config WITH KEY atnam = 'IND_GQ'.
IF sy-subrc = 0.
wa_char-obj = wa_vbap-cuobj.
wa_char-atnam = it_config-atnam.
wa_char-atwrt = it_config-atwrt.
APPEND wa_char TO it_char.
CLEAR wa_char.
ENDIF.
READ TABLE it_config WITH KEY atnam = 'IND_VKN'.
IF sy-subrc = 0.
wa_char-obj = wa_vbap-cuobj.
wa_char-atnam = it_config-atnam.
wa_char-atwrt = it_config-atwrt.
APPEND wa_char TO it_char.
CLEAR wa_char.
ENDIF.
READ TABLE it_config WITH KEY atnam = 'IND_ZE'.
IF sy-subrc = 0.
wa_char-obj = wa_vbap-cuobj.
wa_char-atnam = it_config-atnam.
wa_char-atwrt = it_config-atwrt.
APPEND wa_char TO it_char.
CLEAR wa_char.
ENDIF.
READ TABLE it_config WITH KEY atnam = 'IND_HQ'.
IF sy-subrc = 0.
wa_char-obj = wa_vbap-cuobj.
wa_char-atnam = it_config-atnam.
wa_char-atwrt = it_config-atwrt.
APPEND wa_char TO it_char.
CLEAR wa_char.
ENDIF.
READ TABLE it_config WITH KEY atnam = 'IND_CALCULATED_INST_HOURS'.
IF sy-subrc = 0.
wa_char-obj = wa_vbap-cuobj.
wa_char-atnam = it_config-atnam.
wa_char-atwrt = it_config-atwrt.
APPEND wa_char TO it_char.
CLEAR wa_char.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP. " End of loop on it_vbap
Edited by: jaya rangwani on May 11, 2010 12:50 PM
Edited by: jaya rangwani on May 11, 2010 12:52 PMHello Jaya,
Will provide some point which will increase the performance of the program:
1. VBAK & VBAP are header & item table. And so the relation will be 1 to many. In this case, you can use inner join instead multiple select statement.
2. If you are very much confident in handling the inner join, then you can do a single statement to get the data from VBAK, VBAP & VBKD using the inner join.
3. Before using for all entries, check whether the internal table is not initial.
And sort the internal table and delete adjacent duplicates.
4. Sort all the resultant internal table based on the required key fields and read always using the binary search.
You will get a number of documents where you can get a fair idea of what should be done and what should not be while doing a program related to performance issue.
Also you can have number of function module and BAPI where you can get the sales order details. You can try with u2018BAPISDORDER_GETDETAILEDLISTu2019.
Regards,
Selva K. -
Performance tuning: lite sessions and local ServletContext
I have been doing some research on iPlanet performance tuning. In our
current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
we don't use clustering there should be a couple of performance improvements
we can make immediately:
1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
believe that if you use lite sessions, the session data is stored in the kjs
process space as opposed to the kxs process space. This, of course, means
that if a kjs dies the user's on it will lose their session information but
it will provide a performance improvement by reducing kxs/kjs communication.
2. Use local ServletContexts (<distributable>false</distributable> in
web.xml) - This should cause the ServletContext to only be stored in the
originating JVM. So again, if a kjs dies, the user will lose their
ServletContext but again we will get a performance improvement by reducing
kxs/kjs communcation.
What I want to understand is how our load balancing configuration will
effect our production environment if we use this configuration. Right now
we use sticky load balancing on all our servlets but we don't have our JSPs
registered and therefore sticky load balancing cannot always be trusted to
return users to the iAS they came from. We make up for this by using
hardware load balancing that keeps the majority of our users sticky.
However, using lite sessions and local ServletContexts will require that a
user not only stick to an iAS, but to a specific kjs as well. Using sticky
load balancing would ensure that, but since we also rely on our hardware
load balancers, could they create a problem? If a user gets sent back to
the iAS they came from by our hardware load balancers, will the kxs process
be smart enough to return them to the kjs they came from? If so, then I
think that means that we can safely switch to lite sessions and local
ServletContexts, but if not, I think many users will lose their sessions.
Thanks,
LincPlease follow thru this link for your answers
http://developer.iplanet.com/viewsource/char_tuningias/index.jsp
Thanks
Shital Patel
Lincoln wrote:
I have been doing some research on iPlanet performance tuning. In our
current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
we don't use clustering there should be a couple of performance improvements
we can make immediately:
1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
believe that if you use lite sessions, the session data is stored in the kjs
process space as opposed to the kxs process space. This, of course, means
that if a kjs dies the user's on it will lose their session information but
it will provide a performance improvement by reducing kxs/kjs communication.
2. Use local ServletContexts (<distributable>false</distributable> in
web.xml) - This should cause the ServletContext to only be stored in the
originating JVM. So again, if a kjs dies, the user will lose their
ServletContext but again we will get a performance improvement by reducing
kxs/kjs communcation.
What I want to understand is how our load balancing configuration will
effect our production environment if we use this configuration. Right now
we use sticky load balancing on all our servlets but we don't have our JSPs
registered and therefore sticky load balancing cannot always be trusted to
return users to the iAS they came from. We make up for this by using
hardware load balancing that keeps the majority of our users sticky.
However, using lite sessions and local ServletContexts will require that a
user not only stick to an iAS, but to a specific kjs as well. Using sticky
load balancing would ensure that, but since we also rely on our hardware
load balancers, could they create a problem? If a user gets sent back to
the iAS they came from by our hardware load balancers, will the kxs process
be smart enough to return them to the kjs they came from? If so, then I
think that means that we can safely switch to lite sessions and local
ServletContexts, but if not, I think many users will lose their sessions.
Thanks,
Linc -
Performance Tuning for OBIEE Reports
Hi Experts,
I had a requirement for which i have to end up building a snowflakt model in Physical layer i.e. One Dimension table with Three snowflake tables(Materialized views).
The key point is the Dimension table is used in most of the OOTB reports.
so all the reports use other three snowflakes tables in the Join conditions due to which the reports take longer time than ever like 10 mints.
can anyone suggest good performance tuning tips to tune the reports.
i created some indices on Materialized view columns and and on dimension table columns.
i created the Materialized views with cache Enabled and refreshes only once in 24 hours etc
is there anything i have to improve performance or have to consider re-designing the Physical layer without snowflake
Please Provide valuable suggestions and comments
Thank You
KumarKumar,
Most of the Performance Tuning should be done at the Back End , So calculate all the aggregates in the Repository it self and Create a Fast Refresh for MV and you can also do one thing you can schedule an IBOT to run the report every 1 hour or some thing so that the report data will be cached and when the user runs the report the BI Server extracts the data from Cache
Hope that helps
~Srix -
i am fresher in sap-abap. so i have some doubts.
how to increase performance in a report. what r the minimum steps to follow.
expecting the answer more clearlyHi Josh,
Here is a detailed document for performance check:
<b>AWARD POINTS IF IT HELPS:</b>
5.1 SQL
In order to enhance the performance of your ABAP code a number of useful guidelines can be used.
Use SELECT SINGLE wherever possible to retrieve up to one row of information. It is important to specify all the key fields to ensure a unique record.
Be careful using the FOR ALL ENTRIES addition since this is very bad for very large datasets (10,000+ records)
Joins and subqueries are good
Do not use SELECT * statement unless the program needs ALL columns from the table. Instead, only specify the fields you require. This will also avoid unnecessary network transports. The addition INTO CORRESPONDING FIELDS of the INTO clause of the SELECT statement is worthwhile to use only for large amounts of data where the external table and destination fields have the same names. Consider the use of the DISTINCT option in the case of many duplicate entries.
The following example compares selecting all fields to selecting only the document number, the item number and the material.
Avoid:. select * from vbap
where vbeln in s_docno.
endselect.
Use: select vbeln posnr matnr
into (wa_vbap-vbeln, wa_vbap-posnr, wa_vbap-matnr)
from vbap
where vbeln in s_docno.
endselect.
Important Points:
The order of the fields retrieved must match the order of the destination fields in the field list.
Use the SELECT...WHERE clause to restrict data rather than retrieve all rows and use a CHECK or IF statements to filter data.
Avoid: select vbeln posnr matnr
into (wa_vbap-vbeln, wa_vbap-posnr, wa_vbap-matnr)
from vbap.
check s_docno.
endselect.
Use: select vbeln posnr matnr
into (wa_vbap-vbeln, wa_vbap-posnr, wa_vbap-matnr)
from vbap
where vbeln in s_docno.
endselect.
Important Points:
Order the columns in the where clause of a select in the same order as the key or index table.
WHERE Clause Tips
o Exploit the indexes of the database tables for an efficient use of the WHERE clause. To do so check all index fields with the equality operator (EQ, =) and concatenate these checks by AND. The primary key of a database table makes up its primary index automatically. Secondary indexes for a database table can be created in the ABAP Dictionary.
o If possible, include all columns of the key or an index in the where clause. Use a default or appropriate value. If the column(s) is not included, the database may not be able to fully utilise the index.
o Avoid complex WHERE clauses. The system must split up those into single statements for the database system.
o Do not use the logical NOT in WHERE clauses but inverted operators instead. The logical NOT is not supported by the database indexes.
Try to avoid the select endselect programming construct. Rather select all the required records from the database directly into an internal table and loop at the table to process the entries. This is usually faster than the select endselect code, and also allows easier debugging of the code.
Avoid: select vbeln posnr matnr
into (wa_vbap-vbeln, wa_vbap-posnr, wa_vbap-matnr)
from vbap
where vbeln in s_docno.
write:/ wa_vbap-vbeln, wa_vbap-posnr, wa_vbap-matnr.
endselect.
Use: select vbeln posnr matnr into table ts_vbap
from vbap
where vbeln in s_docno.
loop at ts_vbap into wa_vbap.
write:/ wa_vbap-vbeln, wa_vbap-posnr, wa_vbap-matnr.
Endloop.
Avoid nested select statements if possible as they generally have poor performance. It is preferable to select all the entries for each table directly into an internal table and use nested internal table loops to process all the entries.
Check runtime analysis tips and tricks for detailed comparisons in select performance (SM30). SELECT statements.
Use aggregate expressions in the SELECT clause to perform calculations instead of transporting great amounts of data and calculating thereafter. This distributes the processing load and minimises the network data transfer. Valid aggregate functions include: MAX, MIN, AVG, SUM and COUNT.
The storage of database tables in local buffers can lead to significant time savings. Use the buffering of database tables whenever possible. Use the addition BYPASSING BUFFER only if it is really necessary.
If DISTINCT, SINGLE FOR UPDATE, and aggregate expressions are used in the SELECT clause, buffering should be turned off.
Provide the appropriate selection criteria to limit the number of data base reads. Force users to provide selection criteria by evaluating the selection criteria entered on the selection screen during the AT SELECTION-SCREEN event.
Create indices where needed to enhance query performance. This should be used in large table lookups to increase efficiency. For example, SELECT WHERE FieldA = 001. In this case FieldA is not a key field, therefore an index should be created to improve the efficiency of the select statement. Beware that there is always an additional processing system overhead for indices. Therefore, only create indices if a major performance benefit will be realised, especially if the program concerned is executed many times throughout the day and is business critical.
5.1.1 SQL Checklist
Keep the selected dataset small
Keep the transferred data small
Keep the number of database accesses small
Use database buffers
Create views for table joins instead of using multiple selects.
Select data only one time where possible (i.e., dont have multiple selects against the same table - get the data one time and store it in an internal table).
Remove unused indexes from tables.
5.2 General Programming Techniques
Detailed below are a number of additional programming techniques that should be borne in mind when implementing ABAP code.
When testing fields "equal to" something, one can use either the nested IF or the CASE statement. The CASE is better for two reasons. It is easier to read and the performance of the CASE is more efficient.
Do not use MOVE CORRESPONDING unless the data is contiguous.
When records a and b have the exact same structure, it is more efficient to MOVE a TO b than to MOVE-CORRESPONDING a TO b, if records a and b have the exact same structure.
MOVE BSEG TO *BSEG. is better than
MOVE-CORRESPONDING BSEG TO *BSEG.
Do not use the COLLECT statement with large internal tables as this can be very CPU intensive.
When reading a single record in an internal table, the READ TABLE WITH KEY is not a direct READ on a on a sorted table. Therefore, SORT the table and use READ TABLE WITH KEY BINARY SEARCH.
Use the SORT...BY when sorting internal tables.
SORT ITAB BY FLD1 FLD2. is more efficient than
SORT ITAB.
Avoid hard-coding and use of literals in ABAP code. Use reference tables to drive processing to support business change flexibility and reduce ongoing maintenance costs. If hard-coding and literals are required, be sure to include these as constants.
The Tips & Tricks function is very useful in comparing different methods of coding without going to the trouble of coding both and then performing your own run-time analysis. System > Utilities > Runtime Analysis > Tips & Tricks.
5.3 Logical Databases
Use logical databases and GET events wherever reads on parent/child segments need to be performed e.g. require data from both MARA then MARD table - use GET MARA then GET MARD. (Note you do not need to use an LDB if data from only the MARA or MARD table is required.)
Where an LDB is used provide defaults or checks for the standard selection-options/parameters wherever possible.
Avoid use of logical data bases as much as possible - use SELECT statements instead. (Logical databases are good as a reference tool to look up database hierarchies).
 Logical database should only be used when there are no other options.
 Use of Logical database in ABAP programs must be approved by a DEVELOPMENT TEAM LEAD
 Due to strategic importance of LDBs and the potential impact on system performance, careful consideration should be made before creating new LDBs. Consequently no LDBs should be created without approval from the Development Team Lead
5.4 Debugging
When testing ABAP, use of the debugging tool plays an essential role in checking the value of variables during the execution of the program. This tool should be used during the unit testing to ensure programs are executing as desired.
You can use the debugging tool by selecting Program > Debugging from the ABAP program Development Initial screen.
In addition to the static programming of breakpoints, ABAPs on-line debugging tools also allow you to set breakpoints and interrupt conditions dynamically. This makes the whole process of debugging reports much more flexible and the consequent advantage is that you do not have to change your code. Watchpoints can now be set based on the value a field takes (like R/2).
Once you have stopped the report processing, you can view the contents of all the fields (up to 8), internal tables and database tables referenced in the report. The system fields SY-TABIX and SY-DBCNT are now displayed at the bottom of the screen along with SY-SUBRC.
Finally, you can change the contents of fields for debugging purposes and then resume report processing, with the changed data. To set breakpoints select Breakpoints > Set from the ABAP: Editor screen. Then execute the program.
Beware that in order to debug SAPscript programs, hard-coded breakpoints are often required. Be sure to remove these once testing is complete and the program transported. Use the syntax BREAK username, rather than BREAK-POINT, as this will ensure the code only stops when running under the specified username.
6 SAPscript Techniques
6.1 Good Practice
Always copy the SAP standard print programs where available and, in most instances, the layout set. Never start a complex SAPscript (e.g. Invoice, Purchase Order) from the beginning, as this will require far more development time to complete.
When creating a new layout set by copying a SAP standard, always change the original language from D to E and then activate.
6.2 Standards
Naming convention for layout sets this will follow the same as the program name, except the version number will be prefixed L. For example a purchase order layout set would be:
ZMM_DESC where
Z First character of the program
MM SAP R/3 module/component
DESC Meaningful description i.e. PO printing, INVOICE.
When copying SAP standard print programs ensure they have a standard header block as defined earlier. Also ensure that any code that is added, removed or changed is commented in the standard fashion.
6.3 Standard Texts
These should be of the following format:
ZXX_DESC
Where:
Z First character of the program
XX Module name
DESC Meaningful description.
6.4 Tips
Text elements must be maintained individually for each layout set language. Any other changes to the layout set i.e. window size or paragraphs, will be copied from the original language to the other languages.
 As layout sets are client-dependant they must be transported between clients on the same box. To do this use the Copy from Client function from within the target client. This is language specific.
 Always ACTIVATE the layout set each change and in each language before transporting.
 The SAPscript debugger can be sent useful, this is turned on at the front screen on transaction SE71.
 Standard text used within a layout set must be assigned to a transport request using the program RSTXTRAN. Once assigned the transport request can be released in the usual manner via SE10.
7 Changing the SAP Standard
You can adjust the R/3 System to meet your needs in the following ways:
o Customizing: This means setting up specific business processes and functions for your system according to an implementation guide. The need for these changes has already been foreseen by SAP and an implementation procedure has been developed.
o Personalization: This means making changes to certain fields' global display attributes (setting default values or fading fields out altogether), as well as creating user-specific menu sequences.
o Modifications: These are changes to SAP Repository objects made at the customer site. If SAP delivers a changed version of the object, the customer's system must be adjusted to reflect these changes. Prior to Release 4.0B these adjustments had to be made manually using upgrade utilities. From Release 4.5A, this procedure has been automated with the Modification Assistant.
o Enhancements: This means creating Repository objects for individual customers that refer to objects that already exist in the SAP Repository.
o Customer Developments: This means creating Repository objects unique to individual customers in a specific namespace reserved for new customer objects.
If your requirements cannot be met by Customizing or personalization, you may either start a development project or try using a CSP solution (= Complementary Software Product).
A development project falls into the customer development category if the SAP standard does not already contain functions similar to the one you are trying to develop. If, however, a similar SAP function exists, try to assimilate it into your development project by either enhancing or modifying it, by using a user exit, or simply by making a copy the appropriate SAP program.
Modifications can create problems, as new versions of SAP objects must be adjusted after an upgrade to coincide with modified versions of SAP objects you have created. Prior to Release 4.0B these adjustments had to be made manually using upgrade utilities. From Release 4.5A, this procedure has been automated with the Modification Assistant.
Thus, you should only make modifications if:
Customizing or personalizing cannot satisfy your requirements
Enhancements or user exits are not planned
It would not make sense to copy the SAP object to the customer namespace.
7.1 Originals and copies
An object is original in only one system. In the case of objects delivered by SAP, the original system is at SAP itself. These objects are only copies in customer systems. This applies to your development system and all other systems that come after it.
If you write your own applications, the objects that you create are original in your development system. You assign your developments to a change request, which has the type Development/Correction.
This request ensures that the objects are transported from the development system into the subsequent systems
7.2 Corrections and repairs
Changes to an original are called corrections. They are recorded in a change request whose tasks have the type "Development/correction".
If, on the other hand, you change a copy (an object outside its own original system), the change is recorded in a task with the type "Repair". Repairs to SAP objects are called modifications.
When you repair your own objects (for example, if something goes wrong in your production system), you can correct the original in your development system straight away. When you change copies, you must correct the original immediately!
However, you cannot do this with SAP objects, because they are not original in any of your systems.
You should only modify the SAP standard if the modifications you want to make are absolutely necessary for optimizing workflow in your company. Be aware that good background knowledge of application structure and flow are important prerequisites for deciding what kind of modifications to make and how these modifications should be designed.
7.3 Modifications and upgrades
During an upgrade or an import of R/3 Support Packages, new objects delivered overwrite existing objects of the SAP standard. In order to help customers keep those objects that have been modified in a previous release, SAP now offers upgrade adjustment for all objects being upgraded in the form of transactions SPAU and SPDD. These transactions allow customers to enter their modifications into the corresponding new objects being delivered at upgrade. The Modification Assistant supports this process of adopting customer modifications. In general, objects altered using the Modification Assistant can now be automatically accepted into the upgraded system if the modifications undertaken in the original version do not directly overlap those made in the customer version. If collisions occur between the two versions at upgrade (naming collisions, or if SAP has deleted an object modified by a customer), the system offers semi-automatic adjustment support. In some cases, however, you may still have to manually adjust objects using ABAP Workbench tools.
Whenever you upgrade your system, apply a support package, or import a transport request, conflicts can occur with modified objects.
Conflicts occur when you have changed an SAP object and SAP has also delivered a new version of it. The new object delivered by SAP becomes an active object in the Repository of your system.
If you want to save your changes, you must perform a modification adjustment for the objects. If you have a lot of modified SAP objects, your upgrade can be slowed down considerably.
To ensure consistency between your development system and subsequent systems, you should only perform modification adjustments in your development system. The objects from the adjustment can then be transported into other systems.
7.4 Modifications Procedures
A registered developer must register changes to SAP objects. Exceptions to this registration are matchcodes, database indexes, buffer settings, customer objects, patches, and objects whose changes are based on automatic generation (for example, in Customizing). If the object is changed again at a later time, no new query is made for the registration key. Once an object is registered, the related key is stored locally and automatically copied for later changes, regardless of which registered developer is making the change. For the time being, these keys remain valid even after a release upgrade.
How do you benefit from SSCR (SAP Software Change Registration)?
o Quick error resolution and high availability of modified systems
All objects that have been changed are logged by SAP. Based on this information, SAP's First Level Customer Service can quickly locate and fix problems. This increases the availability of your R/3 system.
o Dependable operation
Having to register your modifications helps prevent unintended modification. This in turn ensures that your R/3 software runs more reliably.
o Simplification of upgrades
Upgrades and release upgrades become considerably easier due to the smaller number of modifications.
7.5 Modifications Assistant
The aim of the Modification Assistant is to make modification adjustments easier. This is because (among other reasons) the modifications are registered in a different layer
If you want to change an SAP object, you must provide the following information:
o SSCR key
o Change request
The system informs you that the object is under the control of the Modification Assistant. Only restricted functions are available in the editor.
You can switch the Modification Assistant on or off for the entire system by changing the R/3 profile parameter eu/controlled_modification. SAP recommends that you always work with the Modification Assistant.
You can switch off the Modification Assistant for single Repository Objects. Once you have done so, the system no longer uses the fine granularity of the Modification Assistant.
In modification mode, you have access to a subset of the normal editor tools. You can access these using the appropriate pushbuttons. For example, in the ABAP Editor, you can:
o Insert
The system generates a framework of comment lines between which you can enter your source code.
o Replace
Position the cursor on a line and choose Replace. The corresponding line is commented out, and another line appears in which you can enter coding. If you want to replace several lines, mark them as a block first.
o Delete
Select a line or a block and choose Delete. The lines are commented out.
o Undo modifications
This undoes all of the modifications you have made to this object.
o Display modification overview
Choose this function to display an overview of all modifications belonging to this object.
7.6 Restoring the original
You can reset all of the modifications that you have made to the current object using the Modification Assistant by choosing this function. The record of the modifications is also deleted.
Remember that you cannot selectively undo modifications to an object. You can only undo modifications based on the "all or nothing" principle.
 Any modifications in standard SAP object will require proper justification and needs to be documented. The rights of modification the standard SAP object is limited to PROJECT MANGER only.
Cheers,
ashish. -
Dear All,
In our project we are facing lot of problems with the Performance, users are compaining about the poor performance of the few reports and all, we are in the process of fine tuning the reports by following the all methods/suggestions provided by SAP ( like removing the select queries from Loops, For all entries , Binary serach etc )
But still I want to know from you people what can we check from BASIS percpective ( all the settings ) and also ABAP percpective to improve the performance.
And also I have one more query that what is " Table Statistics " , what is the use of this ...
Please give ur valueble suggestions to us in improving the performance .
Thanks in Advance !Hi
<b>Ways of Performance Tuning</b>
1. Selection Criteria
2. Select Statements
Select Queries
SQL Interface
Aggregate Functions
For all Entries
Select Over more than one Internal table
<b>Selection Criteria</b>
1. Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement.
2. Select with selection list.
<b>Points # 1/2</b>
SELECT * FROM SBOOK INTO SBOOK_WA.
CHECK: SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
ENDSELECT.
The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list
SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
WHERE SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
<b>Select Statements Select Queries</b>
1. Avoid nested selects
2. Select all the records in a single shot using into table clause of select statement rather than to use Append statements.
3. When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
4. For testing existence , use Select.. Up to 1 rows statement instead of a Select-Endselect-loop with an Exit.
5. Use Select Single if all primary key fields are supplied in the Where condition .
<b>Point # 1</b>
SELECT * FROM EKKO INTO EKKO_WA.
SELECT * FROM EKAN INTO EKAN_WA
WHERE EBELN = EKKO_WA-EBELN.
ENDSELECT.
ENDSELECT.
The above code can be much more optimized by the code written below.
SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
FROM EKKO AS P INNER JOIN EKAN AS F
ON PEBELN = FEBELN.
Note: A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. One should therefore use nested SELECT loops only if the selection in the outer loop contains very few lines or the outer loop is a SELECT SINGLE statement.
<b>Point # 2</b>
SELECT * FROM SBOOK INTO SBOOK_WA.
CHECK: SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
ENDSELECT.
The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list and puts the data in one shot using into table
SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
WHERE SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
<b>Point # 3</b>
To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields . In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
<b>Point # 4</b>
SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT.
The above code is more optimized as compared to the code mentioned below for testing existence of a record.
SELECT * FROM SBOOK INTO SBOOK_WA
WHERE CARRID = 'LH'.
EXIT.
ENDSELECT.
<b>Point # 5</b>
If all primary key fields are supplied in the Where condition you can even use Select Single.
Select Single requires one communication with the database system, whereas Select-Endselect needs two.
<b>Select Statements contd.. SQL Interface</b>
1. Use column updates instead of single-row updates
to update your database tables.
2. For all frequently used Select statements, try to use an index.
3. Using buffered tables improves the performance considerably.
<b>Point # 1</b>
SELECT * FROM SFLIGHT INTO SFLIGHT_WA.
SFLIGHT_WA-SEATSOCC =
SFLIGHT_WA-SEATSOCC - 1.
UPDATE SFLIGHT FROM SFLIGHT_WA.
ENDSELECT.
The above mentioned code can be more optimized by using the following code
UPDATE SFLIGHT
SET SEATSOCC = SEATSOCC - 1.
<b>Point # 2</b>
SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
WHERE CARRID = 'LH'
AND CONNID = '0400'.
ENDSELECT.
The above mentioned code can be more optimized by using the following code
SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
WHERE MANDT IN ( SELECT MANDT FROM T000 )
AND CARRID = 'LH'
AND CONNID = '0400'.
ENDSELECT.
<b>Point # 3</b>
Bypassing the buffer increases the network considerably
SELECT SINGLE * FROM T100 INTO T100_WA
BYPASSING BUFFER
WHERE SPRSL = 'D'
AND ARBGB = '00'
AND MSGNR = '999'.
The above mentioned code can be more optimized by using the following code
SELECT SINGLE * FROM T100 INTO T100_WA
WHERE SPRSL = 'D'
AND ARBGB = '00'
AND MSGNR = '999'.
<b>Select Statements contd Aggregate Functions</b>
If you want to find the maximum, minimum, sum and average value or the count of a database column, use a select list with aggregate functions instead of computing the aggregates yourself.
Some of the Aggregate functions allowed in SAP are MAX, MIN, AVG, SUM, COUNT, COUNT( * )
Consider the following extract.
Maxno = 0.
Select * from zflight where airln = LF and cntry = IN.
Check zflight-fligh > maxno.
Maxno = zflight-fligh.
Endselect.
The above mentioned code can be much more optimized by using the following code.
Select max( fligh ) from zflight into maxno where airln = LF and cntry = IN.
<b>Select Statements contd For All Entries</b>
The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
The plus
Large amount of data
Mixing processing and reading of data
Fast internal reprocessing of data
Fast
The Minus
Difficult to program/understand
Memory could be critical (use FREE or PACKAGE size)
<u>Points to be must considered FOR ALL ENTRIES</u> Check that data is present in the driver table
Sorting the driver table
Removing duplicates from the driver table
Consider the following piece of extract
Loop at int_cntry.
Select single * from zfligh into int_fligh
where cntry = int_cntry-cntry.
Append int_fligh.
Endloop.
The above mentioned can be more optimized by using the following code.
Sort int_cntry by cntry.
Delete adjacent duplicates from int_cntry.
If NOT int_cntry[] is INITIAL.
Select * from zfligh appending table int_fligh
For all entries in int_cntry
Where cntry = int_cntry-cntry.
Endif.
<b>Select Statements contd Select Over more than one Internal table</b>
1. Its better to use a views instead of nested Select statements.
2. To read data from several logically connected tables use a join instead of nested Select statements. Joins are preferred only if all the primary key are available in WHERE clause for the tables that are joined. If the primary keys are not provided in join the Joining of tables itself takes time.
3. Instead of using nested Select loops it is often better to use subqueries.
<b>Point # 1</b>
SELECT * FROM DD01L INTO DD01L_WA
WHERE DOMNAME LIKE 'CHAR%'
AND AS4LOCAL = 'A'.
SELECT SINGLE * FROM DD01T INTO DD01T_WA
WHERE DOMNAME = DD01L_WA-DOMNAME
AND AS4LOCAL = 'A'
AND AS4VERS = DD01L_WA-AS4VERS
AND DDLANGUAGE = SY-LANGU.
ENDSELECT.
The above code can be more optimized by extracting all the data from view DD01V_WA
SELECT * FROM DD01V INTO DD01V_WA
WHERE DOMNAME LIKE 'CHAR%'
AND DDLANGUAGE = SY-LANGU.
ENDSELECT
<b>Point # 2</b>
SELECT * FROM EKKO INTO EKKO_WA.
SELECT * FROM EKAN INTO EKAN_WA
WHERE EBELN = EKKO_WA-EBELN.
ENDSELECT.
ENDSELECT.
The above code can be much more optimized by the code written below.
SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
FROM EKKO AS P INNER JOIN EKAN AS F
ON PEBELN = FEBELN.
<b>Point # 3</b>
SELECT * FROM SPFLI
INTO TABLE T_SPFLI
WHERE CITYFROM = 'FRANKFURT'
AND CITYTO = 'NEW YORK'.
SELECT * FROM SFLIGHT AS F
INTO SFLIGHT_WA
FOR ALL ENTRIES IN T_SPFLI
WHERE SEATSOCC < F~SEATSMAX
AND CARRID = T_SPFLI-CARRID
AND CONNID = T_SPFLI-CONNID
AND FLDATE BETWEEN '19990101' AND '19990331'.
ENDSELECT.
The above mentioned code can be even more optimized by using subqueries instead of for all entries.
SELECT * FROM SFLIGHT AS F INTO SFLIGHT_WA
WHERE SEATSOCC < F~SEATSMAX
AND EXISTS ( SELECT * FROM SPFLI
WHERE CARRID = F~CARRID
AND CONNID = F~CONNID
AND CITYFROM = 'FRANKFURT'
AND CITYTO = 'NEW YORK' )
AND FLDATE BETWEEN '19990101' AND '19990331'.
ENDSELECT.
<b>Internal Tables</b>
1. Table operations should be done using explicit work areas rather than via header lines.
2. Always try to use binary search instead of linear search. But dont forget to sort your internal table before that.
3. A dynamic key access is slower than a static one, since the key specification must be evaluated at runtime.
4. A binary search using secondary index takes considerably less time.
5. LOOP ... WHERE is faster than LOOP/CHECK because LOOP ... WHERE evaluates the specified condition internally.
6. Modifying selected components using MODIFY itab TRANSPORTING f1 f2.. accelerates the task of updating a line of an internal table.
<b>Point # 2</b>
READ TABLE ITAB INTO WA WITH KEY K = 'X BINARY SEARCH.
IS MUCH FASTER THAN USING
READ TABLE ITAB INTO WA WITH KEY K = 'X'.
If TAB has n entries, linear search runs in O( n ) time, whereas binary search takes only O( log2( n ) ).
<b>Point # 3</b>
READ TABLE ITAB INTO WA WITH KEY K = 'X'. IS FASTER THAN USING
READ TABLE ITAB INTO WA WITH KEY (NAME) = 'X'.
<b>Point # 5</b>
LOOP AT ITAB INTO WA WHERE K = 'X'.
ENDLOOP.
The above code is much faster than using
LOOP AT ITAB INTO WA.
CHECK WA-K = 'X'.
ENDLOOP.
<b>Point # 6</b>
WA-DATE = SY-DATUM.
MODIFY ITAB FROM WA INDEX 1 TRANSPORTING DATE.
The above code is more optimized as compared to
WA-DATE = SY-DATUM.
MODIFY ITAB FROM WA INDEX 1.
7. Accessing the table entries directly in a "LOOP ... ASSIGNING ..." accelerates the task of updating a set of lines of an internal table considerably
8. If collect semantics is required, it is always better to use to COLLECT rather than READ BINARY and then ADD.
9. "APPEND LINES OF itab1 TO itab2" accelerates the task of appending a table to another table considerably as compared to LOOP-APPEND-ENDLOOP.
10. DELETE ADJACENT DUPLICATES accelerates the task of deleting duplicate entries considerably as compared to READ-LOOP-DELETE-ENDLOOP.
11. "DELETE itab FROM ... TO ..." accelerates the task of deleting a sequence of lines considerably as compared to DO -DELETE-ENDDO.
<b>Point # 7</b>
Modifying selected components only makes the program faster as compared to Modifying all lines completely.
e.g,
LOOP AT ITAB ASSIGNING <WA>.
I = SY-TABIX MOD 2.
IF I = 0.
<WA>-FLAG = 'X'.
ENDIF.
ENDLOOP.
The above code works faster as compared to
LOOP AT ITAB INTO WA.
I = SY-TABIX MOD 2.
IF I = 0.
WA-FLAG = 'X'.
MODIFY ITAB FROM WA.
ENDIF.
ENDLOOP.
<b>Point # 8</b>
LOOP AT ITAB1 INTO WA1.
READ TABLE ITAB2 INTO WA2 WITH KEY K = WA1-K BINARY SEARCH.
IF SY-SUBRC = 0.
ADD: WA1-VAL1 TO WA2-VAL1,
WA1-VAL2 TO WA2-VAL2.
MODIFY ITAB2 FROM WA2 INDEX SY-TABIX TRANSPORTING VAL1 VAL2.
ELSE.
INSERT WA1 INTO ITAB2 INDEX SY-TABIX.
ENDIF.
ENDLOOP.
The above code uses BINARY SEARCH for collect semantics. READ BINARY runs in O( log2(n) ) time. The above piece of code can be more optimized by
LOOP AT ITAB1 INTO WA.
COLLECT WA INTO ITAB2.
ENDLOOP.
SORT ITAB2 BY K.
COLLECT, however, uses a hash algorithm and is therefore independent
of the number of entries (i.e. O(1)) .
<b>Point # 9</b>
APPEND LINES OF ITAB1 TO ITAB2.
This is more optimized as compared to
LOOP AT ITAB1 INTO WA.
APPEND WA TO ITAB2.
ENDLOOP.
<b>Point # 10</b>
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING K.
This is much more optimized as compared to
READ TABLE ITAB INDEX 1 INTO PREV_LINE.
LOOP AT ITAB FROM 2 INTO WA.
IF WA = PREV_LINE.
DELETE ITAB.
ELSE.
PREV_LINE = WA.
ENDIF.
ENDLOOP.
<b>Point # 11</b>
DELETE ITAB FROM 450 TO 550.
This is much more optimized as compared to
DO 101 TIMES.
DELETE ITAB INDEX 450.
ENDDO.
12. Copying internal tables by using ITAB2[ ] = ITAB1[ ] as compared to LOOP-APPEND-ENDLOOP.
13. Specify the sort key as restrictively as possible to run the program faster.
<b>Point # 12</b>
ITAB2[] = ITAB1[].
This is much more optimized as compared to
REFRESH ITAB2.
LOOP AT ITAB1 INTO WA.
APPEND WA TO ITAB2.
ENDLOOP.
<b>Point # 13</b>SORT ITAB BY K. makes the program runs faster as compared to SORT ITAB.
<b>Internal Tables contd
Hashed and Sorted tables</b>
1. For single read access hashed tables are more optimized as compared to sorted tables.
2. For partial sequential access sorted tables are more optimized as compared to hashed tables
Hashed And Sorted Tables
<b>Point # 1</b>
Consider the following example where HTAB is a hashed table and STAB is a sorted table
DO 250 TIMES.
N = 4 * SY-INDEX.
READ TABLE HTAB INTO WA WITH TABLE KEY K = N.
IF SY-SUBRC = 0.
ENDIF.
ENDDO.
This runs faster for single read access as compared to the following same code for sorted table
DO 250 TIMES.
N = 4 * SY-INDEX.
READ TABLE STAB INTO WA WITH TABLE KEY K = N.
IF SY-SUBRC = 0.
ENDIF.
ENDDO.
<b>Point # 2</b>
Similarly for Partial Sequential access the STAB runs faster as compared to HTAB
LOOP AT STAB INTO WA WHERE K = SUBKEY.
ENDLOOP.
This runs faster as compared to
LOOP AT HTAB INTO WA WHERE K = SUBKEY.
ENDLOOP.
<b>Reward if usefull</b> -
Performance Tuning for BAM 11G
Hi All
Can anyone guide me for any documents or any tips realted to performance tuning for BAM 11G on on LinuxIt would help to know if you have any specific issue. There are number of tweaks all they way from DB to Browser.
Few key things to follow:
1. Make sure you create index on DO. If there are too much old data in the DO and not useful then periodically delete it. Similar to relational database indexes, defining indexes in Oracle BAM creates and maintains an ordered list of data object elements for fast retrieval.
2. Ensure that IE setup to do automatic caching. This will help with reducing server round trips.
3. Tune DB performance. This would typically require DBA. Identify the SQL statements most likely to be causing the waits by looking at
the drilldown Top SQL Statements Ordered by Wait Time. Use SQL Analyze, EXPLAIN PLAN, or the tkprof utility to tune the queries that were identified.
Check the Dataobject tables involved in the query for missing indexes.
4. Use batching (this is on by default for most cases)
5. Fast network
6. Use profilers to look at machine load/cpu usage and distribute components on different boxes if needed.
7. Use better server AND client hardware. BAM dashboard are heavy users of ajax/javascript logic on the client -
Performance Tuning Section in Business Blueprint
Dear Gurus,
I am at a client location doing a blueprint. We are in the closure level of the business blueprint and one of the sections need to be added is the Performance Tuning. Can anybody suggest me what would be content to be added in the Performance Tuning section of blueprint. If anybody got the content section with them please forward that to my mail id, i.e. [email protected]
Thanks and regards
VijayHi,
Think abt all BI is made up of an dhow to tune them..
Some hints:
1 Performance tuning for data loads : ( number range buffering, parallel loading..pseudo delta..chnging technical properties of tables if rec >100,000...IDOC clogging...etc)
2) Performnce tuing for Queries Aggregate...Cube modelling, OLAP cache....efficient multiprovider queries.etc.)
MEntion about transactiona whoich you will require for these things..such as RSRV..RSRTRACE..STO3n..ST05..etc...
gaurav
Maybe you are looking for
-
Simultaneous display of english & greek characteristics texts in web report
We have a web query that displays several characteristics as a hierarchy. Half of the characteristics are english and half are greek. Both languages (EN and EL) are maintained for each characteristic texts (even having greek chars in english text). U
-
Urgent status management question
Hi, I've a problem with my status profile.I assigned a status profile to my quotations that's working fine but now I need a special requirement. The user wants to set a new status step identically to another with a different label of course (includin
-
The activity universe returns everything in GMT I want to convert it to EST any ideas on how to do this?
-
List of BCC roles with explanation
Hi, does anybody have a list with an explanation of some of the roles available in BCC? I am mainly looking for: 100001-gear-manager 100001-guest 100001-leader 100001-page-manager 100001-portal-admin (where is the difference to 100001-member?) 100001
-
I need to regularly paste long PDF docs into Word docs and not as links that will open the PDF (so I can have the Word docs header/footer as banner on the PDF pages). I am currently saving the PDF as a tiff or jpeg and then copying/pasting each page