High Database server load from expensive SQL statements
Dear all,
I am facing problem in the production sever there is high Database server load from expensive SQL statements as per EVA report
Buffer Load [%] Disk Load [%] CPU Load [%]
55 69 0
Analysis of DB SQL CACHE
EXPENSIVE SQL STATEMENTS OVERVIEW
Object Name CPU Load [%] I/O Load [%] Elapsed Time [%] Executions Records Processed
BSIS 1 9 0 22 90462
CDEF$ 6 6 0 2131113 2575694
BSAD 1 3 0 21 408576
MKPF 1 32 0 180 3899
ICOL$ 9 1 0 2575694 8703798
OBJ$ 6 1 0 3405254 3400023
COL$ 12 0 0 2138793 22919657
MKPF 1 13 0 75 396
MCHB 7 0 0 366543 41708
Please suggest the step by step to reduce the expensive SQL from these table.
Regards
Hi,
In tx code ST05 i have find the following deatails.
Duration |Obj. name |Op. |Recs.|RC |Statement
4 TSP03A REOPEN 0 SELECT WHERE "NAME" = 'LOCL' AND "P" = 'S_CLIENTS' 344 TSP03A FETCH 1 0 42 ZRIN DECLARE 0 SELECT WHERE "MANDT" = :A0 AND "BCQ" = :A1 442 ZRIN PREPARE 0 SELECT WHERE "MANDT" = :A0 AND "BCQ" = :A1 3 ZRIN OPEN 0 SELECT WHERE "MANDT" = '600' AND "BCQ" = 'BCQ'
2,181,565 ZRIN FETCH 4 1403
706,267 DBA_SEGME FETCH 99 0 8,248 DBA_SEGME FETCH 99 0 44,994 DBA_SEGME FETCH 99 0 67,713 DBA_SEGME FETCH 99 0
1,367,923 DBA_SEGME FETCH 99 0
16,735|TADIR |FETCH | 1| 1403| |
5
TADIR
REOPEN
0
SELECT WHERE "PGMID" = 'R3TR' AND "OBJECT" = 'TABL' AND "OBJ_NAME" = 'CME__TEXT'
22,415
TADIR
FETCH
1
1403
4
TADIR
REOPEN
0
SELECT WHERE "PGMID" = 'R3TR' AND "OBJECT" = 'TABL' AND "OBJ_NAME" = 'CME_PATTERN_SIGN'
232
TADIR
FETCH
1
1403
4
TADIR
REOPEN
0
SELECT WHERE "PGMID" = 'R3TR' AND "OBJECT" = 'TABL' AND "OBJ_NAME" = 'CML_ARC_DEADLINE'
19,189
TADIR
FETCH
1
1403
4
TADIR
REOPEN
706,267
DBA_SEGME
FETCH
99
0
|
44,994
DBA_SEGME
FETCH
99
0
67,713
DBA_SEGME
FETCH
99
0
Please suggest how to reduce it.
Regards,
Similar Messages
-
How to restore a database backup taken from a SQL Server 2012 instance to SQL Server 2014
I am trying to restore a database backup taken from a SQL Server 2012 instance to my new SQL Server 2014 instance. When I add the .bak through the Mgmt studio UI, it does not seem to find a backup set in the file so I cannot proceed (does not give
me any errors though either. I tried restoring through TSQL command but only got a database restore terminating abnormally error with no other details. How can I restore this database to SQL 2014?Hello,
Please examine SQL Server Error Log and share with us any error you can find. The following article may locate the log:
http://msdn.microsoft.com/en-us/library/ms187109.aspx
Regards,
Alberto Morillo
SQLCoffee.com -
EarlyWatch - Expensive SQL Statements help
Hi all,
i need to analyze an EWA report and i don't know how exactly can i identify an "expensive SQL statement".
The report says:
During this session, the following expensive SQL statements were identified as causing a database load of at least 1%.
The corresponding stored procedure names are referenced in the table below.
And in the table with stored procedure names, a row looks like this:
ID Stored Procedure Name
1 ##Y4DCWWES7EHY100000053960000254832042037
What does it mean and how can i identify the name of program and the exact statement (probably select) that is causing this problem?
Thank you,
OndrejHi Ondrej,
you're running on SQL Server. SAP creates stored procedures for each and every statement run against the database. The name you get seems to be a temporary stored procedure which (if I'm not wrong) is marked by the two # characters at the beginning. You may be still find it in the stored procedures of your system.
Open the Enterprise Manager and open your database, then the stored procedure link (you should run the Enterprise Manager on the server or on a PC with enough RAM). The search for the procedure and double click on it. I think that should show you the SQL statement. There should also the report name is a comment.
Regards
Ralph -
Expensive SQL statements in EWA
Hi experts,
how can I add expensive SQL statements to Early watch alert reports? In my IDES system this is generated automatically but not for different other systems. Can this be activated by specific settings?
Thanks and best regards, BastiHi bd,
Please check these points:
What database are you using?
What is the version of the ST-SER in your solution manager?
Is the service preparation finished in the managed system(run se38 -> RTCCTOOL to check)?
Have you checked note 1564508?
Besides that, do you see any issue in the SDCCN collection logs for the EWA?
Regards,
Daniel. -
Expensive SQL Statements of the day?
Hi...
How can i find out Expensive SQL Statements of the day please.?
Our SAP Version is ECC 6.0 on Oracle 10.2.0.4.0
RgdsHi Srinivas,
On ECC 6.0, go to ST04 t-code --> performance --> SQL Cache --> You see SQL Statements where you need to sort by SQL Statements by Total Execution Time(ms).
I have tried on one of my R/3 4.7EE system, ST04n --> Resource COnsumption --> Top SQL Statements --> you will see 50 Top most expensive SQL Statements interms of wait time.
also Read: [Re: Diagnosis of the expensive ABAP programs having database time > 90%;
[Please Read before Posting in the Performance and Tuning Forum;
Regards,
Kanthi Kiran -
Expensive SQL statements & no proper indexing INCLUDE LPSSTU03-PSST FuncGrp
Hi there forum
During a recent upgrade we have implemented EhP4 with relevant Support Packs.
Our Early Watch Report nows highlights INCLUDE LPSSTU03 in Function Module Group PSST as having expensive SQL statements along with improper indexing.
Although I have seached through OSS and Forums I can find nothing of help.
Is there an EXPERT out there who can help because SAP tells me that is the way it works!
Thanks.
Carl Cavendish-DaviesHerewith the latest results from the Early Watch report on this issue:
Object Type Total Executions Disk Reads Elapsed Time Buffer Gets Records Processed
TABLE 242481 1873373 12035981 36237218 34390383
SELECT
"MANDT" , "OBJNR" , "STAT" , "CHGNR" , "USNAM" , "UDATE" , "UTIME" , "TCODE" , "CDTCODE" , "INACT" , "CHIND"
FROM
"JCDS"
WHERE
"MANDT" = :A0 AND "OBJNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 )&
Execution Plan
V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
SELECT STATEMENT Estimated Costs= 6 Estimated Rows= 0 Optimizer: ALL_ROWS
3 INLIST ITERATOR
2 TABLE ACCESS BY INDEX ROWID JCDS
Estimated Costs= 5 Estimated Rows= 28 Estim. Bytes: 1,848
Estim. CPU-Costs = 41,426 Estim. IO-Costs = 5
1 INDEX RANGE SCAN JCDS~0
Estimated Costs= 1 Estimated Rows= 28 Access predicates:
"MANDT"=:A0 AND (("OBJNR"=:A1 OR "OBJNR"=:A2 OR "OBJNR"=:A3 OR "OBJNR"=:A4
OR "OBJNR"=:A5)) Search Columns: 2 Estim. CPU-Costs = 6,777 Estim. IO-Costs = 1
Program Data:
Origin of ABAP coding
Program Name Line Created By Last Changed By Last Changed On
LPSSTU03 44 SAP SAP 25.03.2003
000044 SELECT * FROM JCDS
000045 APPENDING CORRESPONDING FIELDS OF TABLE T_JCDS
000046 FOR ALL ENTRIES IN R_OBJNR
000047 WHERE OBJNR = R_OBJNR-OBJNR. -
Expensive SQL statements & no proper indexing INCLUDE LBSVAU14-BSVA FuncGrp
Expensive SQL statements & no proper indexing INCLUDE LBSVAU14 - Function Group BSVA (Status management)
Hi there Forum
During a recent upgrade we have implemented EhP4 with relevant Support Packs.
Our Early Watch Report nows highlights INCLUDE LBSVAU14 as having expensive SQL statements along with improper indexing.
Although I have seached through OSS and Forums I can find nothing of help.
Is there an EXPERT out there who can help because SAP tell me that is the way it works!
Thanks.
Carl Cavendish-DaviesHerewith the latest results from the Early Watch report on this:
Object Type Total Executions Disk Reads Elapsed Time Buffer Gets Records Processed
TABLE 457663 3282704 21081305 28310151 20031340
SELECT
FROM
"JEST"
WHERE
"MANDT" = :A0 AND "OBJNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 )&
Execution Plan
V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
SELECT STATEMENT Estimated Costs= 3 Estimated Rows= 0 Optimizer: ALL_ROWS
3 INLIST ITERATOR
2 TABLE ACCESS BY INDEX ROWID JEST
Estimated Costs= 3 Estimated Rows= 10 Estim. Bytes: 330
Estim. CPU-Costs = 20,886 Estim. IO-Costs = 3
1 INDEX RANGE SCAN JEST~0
Estimated Costs= 1 Estimated Rows= 10 Access predicates:
"MANDT"=:A0 AND (("OBJNR"=:A1 OR "OBJNR"=:A2 OR "OBJNR"=:A3 OR "OBJNR"=:A4
OR "OBJNR"=:A5)) Search Columns: 2 Estim. CPU-Costs = 6,137 Estim. IO-Costs = 1
Program Data:
Origin of ABAP coding
Program Name Line Created By Last Changed By Last Changed On
LBSVAU14 110 SAP SAP 08.04.2007
000110 SELECT * FROM JEST CLIENT SPECIFIED
000111 APPENDING TABLE JEST_BUF
000112 FOR ALL ENTRIES IN OBJNR_TAB
000113 WHERE MANDT EQ CLIENT
000114 AND OBJNR = OBJNR_TAB-OBJNR. -
Expensive SQL statements & no proper indexing INCLUDE LBSVAF14-BSVA FuncGrp
Expensive SQL statements & no proper indexing INCLUDE LBSVAF14 - Function Group BSVA (Status management)
Hi there Forum
During a recent upgrade we have implemented EhP4 with relevant Support Packs.
Our Early Watch Report nows highlights INCLUDE LBSVAF14 as having expensive SQL statements along with improper indexing.
Although I have seached through OSS and Forums I can find nothing of help.
Is there an EXPERT out there who can help because SAP tell me that is the way it works!
Thanks.
Carl Cavendish-DaviesHerewith the latest results from the Early Watch report on this:
Cache Statistics
Object Type Total Executions Disk Reads Elapsed Time Buffer Gets Records Processed
TABLE 1716707 1854501 13325961 25580720 19606427
SELECT
FROM
"JEST"
WHERE
"MANDT" = :A0 AND "OBJNR" = :A1&
Execution Plan
V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
SELECT STATEMENT Estimated Costs= 2 Estimated Rows= 0 Optimizer: ALL_ROWS
2 TABLE ACCESS BY INDEX ROWID JEST
Estimated Costs= 1 Estimated Rows= 2 Estim. Bytes: 66
Estim. CPU-Costs = 8,804 Estim. IO-Costs = 1
1 INDEX RANGE SCAN JEST~0
Estimated Costs= 1 Estimated Rows= 2
Access predicates: "MANDT"=:A0 AND "OBJNR"=:A1 Search Columns: 2
Estim. CPU-Costs = 5,817 Estim. IO-Costs = 1
Program Data:
Origin of ABAP coding
Program Name Line Created By Last Changed By Last Changed On
LBSVAF14 81 SAP SAP 08.04.2007
000080 * Einzelstatus von DB lesen in interne Tabelle
000081 SELECT * FROM JEST CLIENT SPECIFIED
000082 APPENDING TABLE JEST_TAB
000083 WHERE MANDT = MANDT
000084 AND OBJNR = OBJNR. -
Expensive SQL statements & no proper indexing in INCLUDE LV70AF01-SAPLV70A
Hi there forum
During a recent upgrade we have implemented EhP4 with relevant Suppoert Packs.
Our Early Watch Report nows highlights INCLUDE LV70AF01 in Module SAPLV70A as havinf a multitude of expensive SQL statements along with improper indexing.
Although I have seached through OSS and Forums I can find nothing of help.
Is there an EXPERt out there who can help because SAP tell me that is the way it works!
Thanks.
Carl Cavendish-DaviesHerewith the results of our latest Early Watch report on this issue:
Statement Data:
Cache Statistics
Object Type Total Executions Disk Reads Elapsed Time Buffer Gets Records Processed
TABLE 261 1107862 11465343 170865092 4
SELECT
FROM
"NAST"
WHERE
"MANDT" = :A0 AND "KAPPL" = :A1 AND "KSCHL" = :A2 AND "NACHA" = :A3 AND "VSTAT" = :A4 AND "VSZTP" = :A5 AND "AKTIV" = :A6&
Execution Plan
V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
SELECT STATEMENT Estimated Costs= 1,338 Estimated Rows= 0 Optimizer: ALL_ROWS
2 TABLE ACCESS BY INDEX ROWID NAST
Estimated Costs= 1,338 Estimated Rows= 150
Filter predicates: ("NACHA"=:A3 AND "VSTAT"=:A4 AND "VSZTP"=:A5)
Estim. Bytes: 41,700 Estim. CPU-Costs = 13,539,142 Estim. IO-Costs = 1,336
1 INDEX RANGE SCAN NAST~I
Estimated Costs= 19 Estimated Rows= 8,093 Filter predicates: "AKTIV"=:A6
Access predicates: "MANDT"=:A0 AND "KAPPL"=:A1 AND "KSCHL"=:A2 AND "AKTIV"=:A6
Search Columns: 4 Estim. CPU-Costs = 988,073 Estim. IO-Costs = 19
Program Data:
Origin of ABAP coding
Program Name Line Created By Last Changed By Last Changed On
LV70AF01 930 SAP SAP 07.06.2001
000930 SELECT * FROM nast INTO TABLE ct_messages
000931 WHERE kappl IN irt_application
000932 AND kschl IN irt_type
000933 AND nacha IN irt_medium
000934 AND vstat IN irt_status
000935 AND vsztp IN irt_timing
000936 AND aktiv EQ space. -
Hi Guys,
I have just received an email from our basis team where they said I am using an expensive SQL statement.
There is a loop on a table of people with the following statement
SELECT * FROM catsdb INTO TABLE w_cats
WHERE arbid EQ i_data-arbid
AND raufpl EQ i_data-aufpl
AND raplzl EQ i_data-aplzl
AND workdate IN s_wdate
AND status EQ '30'.
Is it me or is this the quickest way possible??
Can anyone think of a better way to do this??
Thanks ExpertsFirst of all, did you ever hear about indices? Please check whether there is an index (SE11) with has fields of your WHERE-condition.
=> if this is not the case the it will be slow, until an index is created.
Second, change the LOOP into a FOR ALL ENTRIES, don't forget to check whether the itab is initial. -
How to export the result from executing sql statement to excel file ?
HI all,
Great with Oracle SQL Developer, but I have have a trouble as follwing :
I want to export the result from executing sql statement to excel file . I do easily like that in TOAD ,
anyone can help me to do that ? Thanks so much
SigmasvnHello Sue,
I just tried to export to excel with the esdev extension and got java.lang.NumberFormatException. I found the workaround at Re: Windows Multi-language env, - how do I set English for application lang?
open the file sqldeveloper\jdev\bin\sqldeveloper.conf and add the following two lines:
AddVMOption -Duser.language=en
AddVMOption -Duser.country=USyet now my date formats in excel are 'american-style' instead of german. For example 01-DEC-01 so excel does not recognize it as date and therefore I can not simply change the format.
When export to excel will be native to 1.1 perhaps someone can have a look at this 'feature'
Regards
Marcus -
Expensive SQL statements in GTS
Hi,
Recently EWA has been run for the GTS system.There are expensive SQL statements that were causing the Performance issue.It would be a great help if anyone can advise on how these expensive SQL statments can be fine tuned. As all these statements were in standard SAP programs is it that we had the only option to create secondary indices ?
Moderator message - Please respect the 5,000 character maximum when posting. Post only the relevant portions of code
Please see Please Read before Posting in the Performance and Tuning Forum before posting
Any suggestion on performance improvement is appreciated.
Thanks in advance!!
Regards,
Sharon.
Edited by: Rob Burbank on Nov 15, 2010 9:08 AMplease ask specific questions.
Otherwise there are services by SAP, either training or support, but they are not for free.
Siegfried -
Hi all,
Am a new bee to this group I'll be greateful if any one help me in understanding about the Expensive SQL Statements.why n where thy r used
Thanks..
MohammedHi shankaran,
1. Is there any way in finding out the expensive sql statements been used in a program.
There is no direct way to find out.
2. Only when the program is run,
and thru basis tcodes/performance testing tcodss,
can we know whether some sqls are very heavy !
3. PERFORMANCE TUNING IS VERY SENSITIVE TOPIC
4. There are some basic recommendatations.
a) don't use select *, just use select fied1,field2
b) Incrase the fileter criteria (ie. more where conditions to narrow down the search cretierai)
c) Create secondar indexes on columns
of tables, which are frequently
used in programs.
regards,
amit m. -
Loading from MS SQl Server to Oracle
Hello,
I am trying to load data from MS SQL Server to Oracle using LKM SQL to ORACLE, this works well with the tables with less number of rows but I have some tables with rows over few Mils so I am trying to use BCP to export into a flat file and then use SQL LDR to load into Oracle.
My problem is ODI sits on UNIX and dosent support the BCP file format. Has someone ran into similar situation or have a solution to this?
Thanks!Hi Srinivash, You can follow below KMs
1. LKM SQL to SQL
2. CKM ORACLE
3. IKM SQL Incremntal Update (Insert and update)/ IKM SQL Control APpend (Insert only )
Hope it helps.
Thanks -
How to get the SQL Primary and Mirrored Database Server Name from Witness Server
Hello,
Can Someone help me with the way to get SQL Primary and Mirrored server name from Witness server?
Any Powershell script/SQL Query..etc or share the alternative?
Regards,
Julieselect principal_server_name,mirror_server_name,* from sys.database_mirroring_witnesses
-Prashanth
Maybe you are looking for
-
Animated GIFs won't display properly in Mail.app
I have a weird problem with animated GIFs received as attachments in Mail.app. On my Mac mini, they're only displayed as the first frame within the Mail message window and the animations don't play. But on my iMac G4, the same messages display the an
-
Photoshop Album S.E. 3.2 un-install - re-install
Hi, My version of photoshop album starter edition 3.2 is not syncing with my iphone anymore. After it's found all the images a termination window appears and i have to close it down. I believe the best thing i can do is un-install and then re-install
-
Can't locate AppleTalk printer on my net
I have a NEC Silentwriter 95f I haven't used in a while. I'm waiting for my regular inkjet to be replaced by Epson and trying to get this (network) laser printer on-line. It doesn't appear in the Chooser on my older Mac (or in Classic). Within OS X (
-
Uploading Contracts through XI into CCM
Hi, We are using SRM 5.0, CCM 2.0, XI 3.0, EBP 5.5. Kindly let me know what is the process of uploading contracts using XI from SRM's EBP to CCM. Thanks, Swetha
-
Unix Command run successfully through PL/SQL but showing no impact in UNIX.
Hi, I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C. I created a shared lib (libextproc.so) for the following function. int sysrun(char *command) return system(command); This funct