App. Server performance Tuning issue
Hi.
Platform:
iAS : Oracle Application server Version 10.1.2.0.2
Installation Type : Forms and Reports Services
OS : Windows server 2003 SP2
DB server : Oracle 10g ver.10.2.0.4.0 win.server 2003
programs developed with developer suite 10g.
Problem:
When the user login screen pop up in internet browser and user type the user id and password then click enter the iAS is taking between 12 to 15 seconds to connect to db, once is connected the application works fine but ..
Is there any way to speed up the first time connection?
I will appreciate whatever help.
Thanks in advance
Check the order of connection mechanisms in your SQLNET.ORA file. If LDAP is first in the list, the login process will look for OID and if it finds one running, will look for your user there. If there is no OID running, it may wait for a timeout before moving on to the next listed connection mechanism. In general, if you're not using OID to authenticate to your database, you should make sure it's not first in the list in SQLNET.ORA.
TGF
Similar Messages
-
Office web apps server 2013 install issue
Dear All,
when i install office web apps server in a new server(OS:Windows Server 2008 SP1) with PowerShell Scripts it keep the installing status for more than four hours .
what should i do now ,i think it should not take such long time as i do the same installing in the other server before which takes less than 1 hours.
beg your suggestions!Hey
please take these points into your considerations:
- OWA server can be installed on Windows server 2008 R2 or Windows server 2012
- Log in as administrator and preferred to use domain administrator account specially to create new office web apps farm
- run the script
Add-WindowsFeature Web-Server,Web-Mgmt-Tools,Web-Mgmt-Console,Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Static-Content,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Security,Web-Filtering,Web-Windows-Auth,Web-App-Dev,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Includes,InkandHandwritingServices,NET-Framework-Features,NET-Framework-Core
It takes approximately 20 minutes :)
Also check this link for Required Server Roles, and Features for Office Web Apps
http://technet.microsoft.com/en-us/library/jj219435.aspx
Ahmed Said Moussa SharePoint Consultant -
Office web apps server (2013) certificate issue
If the name of the farm is different from the name of the individual office web apps server machine is there any way to deploy office web apps server with a single domain SSL certificate?
My office web apps server is working, but reporting itself unhealthy, apparently due to the fact that the SSL cert is for the name of the farm and that is different from the name of the machine.
Errors are 2004, 1004, 2156, 1156, "could not establish trust relationship for the SSL/TLS secure channel"
Going to the farm's discovery URL in the browser works fine, but going to the machine name (plus /hosting/discovery) gives an SSL error because the name of the farm is not the same as the name of the machine.
Is there any way to make it use the farm's URL instead of the machine's URL in its own internal watchdog operations? Or any way to make it use a self signed certificate on the machine's URL for it's own health checks and still use the legitimate purchased
SSL cert for user access? Or any other way you can think of to use a $5.99/yr single domain certificate instead of a $89.99/yr multiple domain certificate?
Bill CoulterI am experiencing this same issue. The OWA server has sp1 installed. In the OWA event logs I am getting health fails for 2 events and as best I can tell it seems to be related to this issue.
We are also using a single godaddy certificate with a non machine name FQDN. Both internal and external url's of the OWA farm are set to this same name.
The problem only seems to occur with the 'Proofing Watchdog' (See events below).
Has anyone got any update on whether this is supposed to be fixed ?
<?xml version="1.0" encoding="utf-16"?>
<HealthReport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<HealthMessage>ProofingWatchdog reported status for Proofing in category 'PositiveWeb'. Reported status: Spelling attempt exception for "good": System.Net.WebException: The underlying connection was closed: Could not establish
trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
<?xml version="1.0" encoding="utf-16"?>
<HealthReport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<HealthMessage>ProofingWatchdog reported status for Proofing in category 'NegativeWeb'. Reported status: Spelling attempt exception for "baad": System.Net.WebException: The underlying connection was closed: Could not establish
trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception -
Exchange 2013 CU7 server performance/outage issues.
Hi Forum,
We are constantly faced with incidents from users that the connections are lost with the exchange server. As a result, we hired a consultant to install an new Exchange 2013 environment based on the Microsoft, VM-Ware and NetApp best practices.
We are still having problems with performance issues. From the client prospective, the performance has not changed, weekly hangs are still happening and I’m at my wits end.
This is our configuration:
2 Windows Server 2012 R2 CAS and DB
VM with 4 vCpu, 16GB, 1 Vmxnet3, IPv6 disabled (the Microsoft way)
VM Ware 5.1 U1
Cluster without AAP
DB1 active on Server 1 (Datacenter 1 with 3 host cluster)
DB2 active on Server 2 (Datacenter 2 with 3 host cluster)
Veeam 8 Backup (Move-ActiveMailboxDatabase DB2 -ActivateOnServer Server1 , backup server 2 then Move-ActiveMailboxDatabase back to
Server2.
Exchange is in Online-Mode due to Citrix XD VDI clients.
1300 Mailboxes and 750 users.
NetApp with SATA disks. (1.5TB E: Vol for DB1/1.5TB F: Vol for DB2)
No archiving
Unlimited mailbox sizes.
The problems are:
If we migrate a non-Exchange VM in the same cluster or to\from the same host, this results in a 30 second to 5 min Outlook outage;
If we make both DB’s active on mail server 1 and reboot server 2, this results in a 30 second to 5 min Outlook outage;
If we make both DB’s active on mail server 1 and do a Veeam backup of server 2, sometimes one of the DB’s go back to server 1, on its own;
While monitoring we see that the w3wp.exe and the Microsoft.Exchange.Store.worker.exe are consuming most of the cpu and memory;
What can I do to solve the outages?
Tnx. Timotatty.
Exchange server performance issues.
Hi Forum,
We are constantly faced with incidents from users that the connections are lost with the exchange server. As a result, we hired a consultant to install an new Exchange 2013 environment based on the Microsoft, VM-Ware and NetApp best practices.
We are still having problems with performance issues. From the client prospective, the performance has not changed, weekly hangs are still happening and I’m at my wits end.
This is our configuration:
2 Windows Server 2012 R2 CAS and DB
VM with 4 vCpu, 16GB, 1 Vmxnet3, IPv6 disabled (the Microsoft way)
VM Ware 5.1 U1
Cluster without AAP
DB1 active on Server 1 (Datacenter 1 with 3 host cluster)
DB2 active on Server 2 (Datacenter 2 with 3 host cluster)
Veeam 8 Backup (Move-ActiveMailboxDatabase DB2 -ActivateOnServer Server1 , backup server 2 then Move-ActiveMailboxDatabase back to
Server2.
Exchange is in Online-Mode due to Citrix XD VDI clients.
1300 Mailboxes and 750 users.
NetApp with SATA disks. (1.5TB E: Vol for DB1/1.5TB F: Vol for DB2)
No archiving
Unlimited mailbox sizes.
The problems are:
If we migrate a non-Exchange VM in the same cluster or to\from the same host, this results in a 30 second to 5 min Outlook outage;
If we make both DB’s active on mail server 1 and reboot server 2, this results in a 30 second to 5 min Outlook outage;
If we make both DB’s active on mail server 1 and do a Veeam backup of server 2, sometimes one of the DB’s go back to server 1, on its own;
While monitoring we see that the w3wp.exe and the Microsoft.Exchange.Store.worker.exe are consuming most of the cpu and memory;
What can I do to solve the outages?
Tnx. Timotatty.Hi Simon,<o:p></o:p>
Apparently we are using basic authentication which result in a FailingCode=401 as seen in the Event Log under Active Monitoring --> Probe Results from ECP and others. This
became apparent after reading this blog:
http://blogs.technet.com/b/ehlro/archive/2014/02/20/exchange-2013-managed-availability-healthset-troubleshooting.aspx<o:p></o:p>
We are now overriding some of the monitors which require Forms Based Authentication.<o:p></o:p>
Regarding the other 2 issues we have changed the licensing model for Veeam 8 to allow full throughput which will reduce the backup time and add compression.
The KEMP support team helped us by deselecting Use HTTP/1.1 under View/Modify Services --> ECP –> Modify --> Real Servers. This
now only flags a service (ECP or ActiveSync or OWA) as being down instead of an etire server should one component fail.<o:p></o:p>
I am satisfied but still not happy with the steps required to troubleshoot an Unhealthy Health Sets:<o:p></o:p>
Invoke-MonitoringProbe always returns with: WARNING: Could not find assembly or object type associated with monitor identity '<Healthe Set >\< Probe >'. Please ensure
that the given monitor identity exists on the server.
This makes it very difficult to troubleshoot
Unhealthy Health Sets.
Regards,
Timotatty -
Hi folks,
I having a problem with performance tuning ... Below is a sample query
SELECT /*+ PARALLEL (K 4) */ DISTINCT ltrim(rtrim(ibc_item)), substr(IBC_BUSINESS_CLASS, 1,1)
FROM AAA K
WHERE ltrim(rtrim(ibc_item)) NOT IN
select /*+ PARALLEL (II 4) */ DISTINCT ltrim(rtrim(THIRD_MAINKEY)) FROM BBB II
WHERE SECOND_MAINKEY = 3
UNION
SELECT /*+ PARALLEL (III 4) */ DISTINCT ltrim(rtrim(BLN_BUSINESS_LINE_NAME)) FROM CCC III
WHERE BLN_BUSINESS_LINE = 3
The above query is having a cost of 460 Million. I tried creating index but oracle is not using index as a FT scan looks better. (I too feel FT scan is the best as 90% of the rows are used in the table)
After using the parallel hint the cost goes to 100 Million ....
Is there any way to decrease the cost ...
Thanks in advance for ur help !Be aware too Nalla, that the PARALLEL hint will rule out the use of an index if Oracle adheres to it.
This is what I would try:
SELECT /*+ PARALLEL (K 4) */ DISTINCT TRIM(ibc_item), substr(IBC_BUSINESS_CLASS, 1,1)
FROM AAA K
WHERE NOT EXISTS (
SELECT 1
FROM BBB II
WHERE SECOND_MAINKEY = 3
AND TRIM(THIRD_MAINKEY) = TRIM(K.ibc_item))
AND NOT EXISTS (
SELECT 1
FROM CCC III
WHERE BLN_BUSINESS_LINE = 3
AND TRIM(BLN_BUSINESS_LINE_NAME) = TRIM(K.ibc_item))But I don't like this at all: TRIM(K.ibc_item), and you never need to use DISTINCT with NOT IN or NOT EXISTS.
Try this:
SELECT DISTINCT TRIM(ibc_item), substr(IBC_BUSINESS_CLASS, 1,1)
FROM AAA K
WHERE NOT EXISTS (
SELECT 1
FROM BBB II
WHERE SECOND_MAINKEY = 3
AND TRIM(THIRD_MAINKEY) = K.ibc_item
AND NOT EXISTS (
SELECT 1
FROM CCC III
WHERE BLN_BUSINESS_LINE = 3
AND TRIM(BLN_BUSINESS_LINE_NAME) = K.ibc_itemThis may not work though, since you may have whitespaces in K.ibc_item. -
Webi Server Performance Tuning
We have Webi Server in a clustered environment.
Our environment doesn't have much reports for Webi server to handle..
But, webi server goes down often and i have to restart the physical server to get webi running.
Is there a way to tune webi performance or find the root cause where the problem is ?Yes, there are.
In CMC got o servers and view properties for Webi report server, Admin guide will have details on those parameters and possible tunigs...
Also, applying latest Service Packs and Fix PAcks helps a lot.
Improving report design helps tremendously.
To troubleshoot issues - you need to enable tracing, review log files. -
Oracle Web App Server performance problems
I am evaluating Oracle Web Application Server 3.0 and while
everything seems to work ok, the performance is noticeably
slower than Oracle Web Server 1.0 or 2.0. I have narrowed the
problem down to the access/execution time to a database
package. In other words, the PL/SQL code I have built does not
contain any Oracle SQL statements. The package simply builds a
small web page. If I had to guess, I would say it appears to be
related to either a log-in to Oracle (which does not take that
long in a ProC program) or excessive child process creation
overhead (other programs like Apache handle this just fine). I
created the package in the www_user account, set a virtual path
of /test/owa/ to access it and while the page displays
correctly, it takes about 12 to 13 seconds to do so.
I'm running Linux on a Dell 400 MHz Pentium II with 1 Gb of
ram. I have tried changing the cartridge configuration so that
it starts with 2 processes instead of the default 0. This
helped some after the first execution of the package (response
time went from 12 seconds down to about 7). I am running it
without security on the virtual path (I thought maybe that was
slowing things down). I tried setting the user sessions to true
(default was false) and setting a timeout of 1200. None of
these things helped (nor did they make it any worse).
On an old HP system (much slower SQLPlus response time than this
Dell system), web pages fly at a pretty good speed using PL/SQL
and version 2 of the web server. Except for the actual database
query time to perform SQL queries, pages display in subsecond
time frames; not 12 seconds.
Please give me some idea how to improve the performance.
Obviously, something is different with 3.0 than the older wrb
and server.
Thanks,
Bob
[email protected]
nullI am evaluating Oracle Web Application Server 3.0 and while
everything seems to work ok, the performance is noticeably
slower than Oracle Web Server 1.0 or 2.0. I have narrowed the
problem down to the access/execution time to a database
package. In other words, the PL/SQL code I have built does not
contain any Oracle SQL statements. The package simply builds a
small web page. If I had to guess, I would say it appears to be
related to either a log-in to Oracle (which does not take that
long in a ProC program) or excessive child process creation
overhead (other programs like Apache handle this just fine). I
created the package in the www_user account, set a virtual path
of /test/owa/ to access it and while the page displays
correctly, it takes about 12 to 13 seconds to do so.
I'm running Linux on a Dell 400 MHz Pentium II with 1 Gb of
ram. I have tried changing the cartridge configuration so that
it starts with 2 processes instead of the default 0. This
helped some after the first execution of the package (response
time went from 12 seconds down to about 7). I am running it
without security on the virtual path (I thought maybe that was
slowing things down). I tried setting the user sessions to true
(default was false) and setting a timeout of 1200. None of
these things helped (nor did they make it any worse).
On an old HP system (much slower SQLPlus response time than this
Dell system), web pages fly at a pretty good speed using PL/SQL
and version 2 of the web server. Except for the actual database
query time to perform SQL queries, pages display in subsecond
time frames; not 12 seconds.
Please give me some idea how to improve the performance.
Obviously, something is different with 3.0 than the older wrb
and server.
Thanks,
Bob
[email protected]
null -
Performance tuning issues -- plz help
Hi Tuning gurus
this querry works fine for lesser number of rows
eg :--
where ROWNUM <= 10 )
where rnum >=1;
but takes lot of time as we increase rownum ..
eg :--
where ROWNUM <= 10000 )
where rnum >=9990;
results are posted below
pls suggest me
oracle version -Oracle Database 10g Enterprise Edition
Release 10.2.0.1.0 - Prod
os version red hat enterprise linux ES release 4
also statistics differ when we use table
and its views
results of view v$mail
[select * from
( select a.*, ROWNUM rnum from
( SELECT M.MAIL_ID, MAIL_FROM, M.SUBJECT
AS S1,CEIL(M.MAIL_SIZE) AS MAIL_SIZE,
TO_CHAR(MAIL_DATE,'dd Mon yyyy hh:mi:ss
am') AS MAIL_DATE1, M.ATTACHMENT_FLAG,
M.MAIL_TYPE_ID, M.PRIORITY_NO, M.TEXT,
COALESCE(M.MAIL_STATUS_VALUE,0),
0 as email_address,LOWER(M.MAIL_to) as
Mail_to, M.Cc, M.MAIL_DATE AS MAIL_DATE,
lower(subject) as subject,read_ipaddress,
read_datetime,Folder_Id,compose_type,
interc_count,history_id,pined_flag,
rank() over (order by mail_date desc)
as rnk from v$mail M WHERE M.USER_ID=6 AND M.FOLDER_ID =1) a
where ROWNUM <= 10000 )
where rnum >=9990;]
result :
11 rows selected.
Elapsed: 00:00:03.84
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=14735 Card=10000 B
ytes=142430000)
1 0 VIEW (Cost=14735 Card=10000 Bytes=142430000)
2 1 COUNT (STOPKEY)
3 2 VIEW (Cost=14735 Card=14844 Bytes=211230120)
4 3 WINDOW (SORT) (Cost=14735 Card=14844 Bytes=9114216)
5 4 TABLE ACCESS (BY INDEX ROWID) OF 'MAIL' (TABLE) (C
ost=12805 Card=14844 Bytes=9114216)
6 5 INDEX (RANGE SCAN) OF 'FOLDER_USERID' (INDEX) (C
ost=43 Card=14844)
Statistics
294 recursive calls
0 db block gets
8715 consistent gets
8669 physical reads
0 redo size
7060 bytes sent via SQL*Net to client
504 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
6 sorts (memory)
0 sorts (disk)
11 rows processed
SQL> select count(*) from v$mail;
Elapsed: 00:00:00.17
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=494 Card=1)
1 0 SORT (AGGREGATE)
2 1 INDEX (FAST FULL SCAN) OF 'FOLDER_USERID' (INDEX) (Cost=
494 Card=804661)
Statistics
8 recursive calls
0 db block gets
2171 consistent gets
2057 physical reads
260 redo size
352 bytes sent via SQL*Net to client
504 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
results of original table mail
[select * from
( select a.*, ROWNUM rnum from
( SELECT M.MAIL_ID, MAIL_FROM, M.SUBJECT
AS S1,CEIL(M.MAIL_SIZE) AS MAIL_SIZE,
TO_CHAR(MAIL_DATE,'dd Mon yyyy hh:mi:ss
am') AS MAIL_DATE1, M.ATTACHMENT_FLAG,
M.MAIL_TYPE_ID, M.PRIORITY_NO, M.TEXT,
COALESCE(M.MAIL_STATUS_VALUE,0),
0 as email_address,LOWER(M.MAIL_to) as
Mail_to, M.Cc, M.MAIL_DATE AS MAIL_DATE,
lower(subject) as subject,read_ipaddress,
read_datetime,Folder_Id,compose_type,
interc_count,history_id,pined_flag,
rank() over (order by mail_date desc)
as rnk from mail M WHERE M.USER_ID=6 AND M.FOLDER_ID =1) a
where ROWNUM <= 10000 )
where rnum >=9990;]
result :
11 rows selected.
Elapsed: 00:00:03.21
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=14735 Card=10000 B
ytes=142430000)
1 0 VIEW (Cost=14735 Card=10000 Bytes=142430000)
2 1 COUNT (STOPKEY)
3 2 VIEW (Cost=14735 Card=14844 Bytes=211230120)
4 3 WINDOW (SORT) (Cost=14735 Card=14844 Bytes=9114216)
5 4 TABLE ACCESS (BY INDEX ROWID) OF 'MAIL' (TABLE) (C
ost=12805 Card=14844 Bytes=9114216)
6 5 INDEX (RANGE SCAN) OF 'FOLDER_USERID' (INDEX) (C
ost=43 Card=14844)
Statistics
1 recursive calls
119544 db block gets
8686 consistent gets
8648 physical reads
0 redo size
13510 bytes sent via SQL*Net to client
4084 bytes received via SQL*Net from client
41 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
11 rows processed
SQL> select count(*) from mail;
Elapsed: 00:00:00.34
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=494 Card=1)
1 0 SORT (AGGREGATE)
2 1 INDEX (FAST FULL SCAN) OF 'FOLDER_USERID' (INDEX) (Cost=
494 Card=804661)
Statistics
1 recursive calls
0 db block gets
2183 consistent gets
2062 physical reads
72 redo size
352 bytes sent via SQL*Net to client
504 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
Thanks n regards
ps : sorry i could not preserve the format plz
Message was edited by:
Cool_Jr.DBA
Message was edited by:
Cool_Jr.DBA
Message was edited by:
Cool_Jr.DBA
Message was edited by:
Cool_Jr.DBA
Message was edited by:
Cool_Jr.DBAJust to answer the OP's fundamental question:
The query starts off quick (rows between 1 and 10)
but gets increasingly slower as the start of the
window increases (eg to row 1000, 10,000, etc).
The original (unsorted) query would get first rows
very quickly, but each time you move the window, it
has to fetch and discard an increasing number of rows
before it finds the first one you want. So the time
taken is proportional to the rownumber you have
reached.
With Charles's correction (which is unavoidable), the
entire query has to be retrieved and sorted
before the rows you want can be returned. That's
horribly inefficient. This technique works for small
sets (eg 10 - 1000 rows) but I can't tell you how
wrong it is to process data in this way especially if
you are expecting lacs (that's 100,000s isn't
it) of rows returned. You are pounding your database
simply to give you the option of being able to go
back as well as forwards in your query results. The
time taken is proportional to the total number of
rows (so the time to get to the end of the entire set
is proportional to the square of the total
number of rows.
If you really need to page back and forth
through large sets, consider one of the following
options:
1) saving the set (eg as a materialised view or in a
temp table - and include "row number" as an indexed
column)
2) retrieve ALL the rowids into an array/collection
in a single pass, then go get 10 rows by rowid for
each page
3) assuming you can sort by a unique identifier, use
that (instead of rownumber) to remember the first row
in each page; use a range scan on the index on that
UID to get back the rows you want quickly (doing this
with a non-unique sort key is quite a bit harder)
Remember also that if someone else inserts into your
table while you are paging around, some of these
methods can give confusing results - because every
time you start a new query, you get a new
read-consistent point.
Anyway, try to redesign so you don't need to page
through lacs of rows....
HTH
Regards NigelYou are correct regarding the OP's original SQL statement that:
"the entire query has to be retrieved and sorted before the rows you want can be returned"
However, that is not the case with the SQL statement that I posted. The problem with the SQL statement I posted is that Oracle insists on performing full tablescans on the table. The following is a full test run with 2,000,000 rows in a table, including an analysis of the problem, and a method of working around the problem:
CREATE TABLE T1 (
MAIL_ID NUMBER(10),
USER_ID NUMBER(10),
FOLDER_ID NUMBER(10),
MAIL_DATE DATE,
PRIMARY KEY(MAIL_ID));
<br>
CREATE INDEX T1_USER_FOLDER ON T1(USER_ID,FOLDER_ID);
CREATE INDEX T1_USER_FOLDER_MAIL ON T1(USER_ID,FOLDER_ID);
<br>
INSERT INTO
T1
SELECT
ROWNUM MAIL_ID,
DBMS_RANDOM.VALUE(1,30) USER_ID,
DBMS_RANDOM.VALUE(1,5) FOLDER_ID,
TRUNC(SYSDATE-365)+ROWNUM/10000 MAIL_DATE
FROM
DUAL
CONNECT BY
LEVEL<=1000000;
<br>
INSERT INTO
T1
SELECT
ROWNUM+1000000 MAIL_ID,
DBMS_RANDOM.VALUE(1,30) USER_ID,
DBMS_RANDOM.VALUE(1,5) FOLDER_ID,
TRUNC(SYSDATE-365)+ROWNUM/10000 MAIL_DATE
FROM
DUAL
CONNECT BY
LEVEL<=1000000;
<br>
COMMIT;
<br>
EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE)
<br>
SELECT /*+ ORDERED */
MI.MAIL_ID,
TO_CHAR(M.MAIL_DATE,'DD MON YYYY HH:MI:SS AM') AS MAIL_DATE1,
M.MAIL_DATE AS MAIL_DATE,
M.FOLDER_ID,
M.MAIL_ID,
M.USER_ID
FROM
(SELECT
MAIL_ID
FROM
(SELECT
MAIL_ID,
ROW_NUMBER() OVER (ORDER BY MAIL_DATE DESC) RN
FROM
CUSTAPP.T1
WHERE
USER_ID=6
AND FOLDER_ID=1)
WHERE
RN BETWEEN 900 AND 909) MI,
CUSTAPP.T1 M
WHERE
MI.MAIL_ID=M.MAIL_ID;
<br>
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
|* 1 | HASH JOIN | | 1 | 8801 | 10 |00:00:15.62 | 13610 | 1010K| 1010K| 930K (0)|
|* 2 | VIEW | | 1 | 8801 | 10 |00:00:00.34 | 6805 | | | |
|* 3 | WINDOW SORT PUSHED RANK| | 1 | 8801 | 910 |00:00:00.34 | 6805 | 74752 | 74752 |65536 (0)|
|* 4 | TABLE ACCESS FULL | T1 | 1 | 8801 | 8630 |00:00:00.29 | 6805 | | | |
| 5 | TABLE ACCESS FULL | T1 | 1 | 2000K| 2000K|00:00:04.00 | 6805 | | | |
<br>
Predicate Information (identified by operation id):
1 - access("MAIL_ID"="M"."MAIL_ID")
2 - filter(("RN">=900 AND "RN"<=909))
3 - filter(ROW_NUMBER() OVER ( ORDER BY INTERNAL_FUNCTION("MAIL_DATE") DESC )<=909)
4 - filter(("USER_ID"=6 AND "FOLDER_ID"=1))The above performed two tablescans of the T1 table and required 15.6 seconds to complete, which was not the desired result. Now, to create an index that will be helpful for the query, and provide Oracle an additional hint:
(http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html "Pagination in Getting Rows N Through M" shows a similar approach)
DROP INDEX T1_USER_FOLDER_MAIL;
<br>
CREATE INDEX T1_USER_FOLDER_MAIL ON T1(USER_ID,FOLDER_ID,MAIL_DATE DESC,MAIL_ID);
<br>
EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE)
<br>
SELECT /*+ ORDERED */
MI.MAIL_ID,
TO_CHAR(M.MAIL_DATE,'DD MON YYYY HH:MI:SS AM') AS MAIL_DATE1,
M.MAIL_DATE AS MAIL_DATE,
M.FOLDER_ID,
M.MAIL_ID,
M.USER_ID
FROM
(SELECT /*+ FIRST_ROWS(10) */
MAIL_ID
FROM
(SELECT
MAIL_ID,
ROW_NUMBER() OVER (ORDER BY MAIL_DATE DESC) RN
FROM
CUSTAPP.T1
WHERE
USER_ID=6
AND FOLDER_ID=1)
WHERE
RN BETWEEN 900 AND 909) MI,
CUSTAPP.T1 M
WHERE
MI.MAIL_ID=M.MAIL_ID;
<br>
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
| 1 | NESTED LOOPS | | 1 | 11 | 10 |00:00:00.01 | 47 | | | |
|* 2 | VIEW | | 1 | 11 | 10 |00:00:00.01 | 7 | | | |
|* 3 | WINDOW NOSORT STOPKEY | | 1 | 8711 | 909 |00:00:00.01 | 7 | 267K| 267K| |
|* 4 | INDEX RANGE SCAN | T1_USER_FOLDER_MAIL | 1 | 8711 | 910 |00:00:00.01 | 7 | | | |
| 5 | TABLE ACCESS BY INDEX ROWID| T1 | 10 | 1 | 10 |00:00:00.01 | 40 | | | |
|* 6 | INDEX UNIQUE SCAN | SYS_C0023476 | 10 | 1 | 10 |00:00:00.01 | 30 | | | |
<br>
Predicate Information (identified by operation id):
2 - filter(("RN">=900 AND "RN"<=909))
3 - filter(ROW_NUMBER() OVER ( ORDER BY "T1"."SYS_NC00005$")<=909)
4 - access("USER_ID"=6 AND "FOLDER_ID"=1)
6 - access("MAIL_ID"="M"."MAIL_ID")The above made use of both indexes, did and completed in 0.01 seconds.
SELECT /*+ ORDERED */
MI.MAIL_ID,
TO_CHAR(M.MAIL_DATE,'DD MON YYYY HH:MI:SS AM') AS MAIL_DATE1,
M.MAIL_DATE AS MAIL_DATE,
M.FOLDER_ID,
M.MAIL_ID,
M.USER_ID
FROM
(SELECT /*+ FIRST_ROWS(10) */
MAIL_ID
FROM
(SELECT
MAIL_ID,
ROW_NUMBER() OVER (ORDER BY MAIL_DATE DESC) RN
FROM
CUSTAPP.T1
WHERE
USER_ID=6
AND FOLDER_ID=1)
WHERE
RN BETWEEN 8600 AND 8609) MI,
CUSTAPP.T1 M
WHERE
MI.MAIL_ID=M.MAIL_ID;
<br>
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
| 1 | NESTED LOOPS | | 1 | 11 | 10 |00:00:00.11 | 81 | | | |
|* 2 | VIEW | | 1 | 11 | 10 |00:00:00.11 | 41 | | | |
|* 3 | WINDOW NOSORT STOPKEY | | 1 | 8711 | 8609 |00:00:00.09 | 41 | 267K| 267K| |
|* 4 | INDEX RANGE SCAN | T1_USER_FOLDER_MAIL | 1 | 8711 | 8610 |00:00:00.05 | 41 | | | |
| 5 | TABLE ACCESS BY INDEX ROWID| T1 | 10 | 1 | 10 |00:00:00.01 | 40 | | | |
|* 6 | INDEX UNIQUE SCAN | SYS_C0023476 | 10 | 1 | 10 |00:00:00.01 | 30 | | | |
<br>
Predicate Information (identified by operation id):
2 - filter(("RN">=8600 AND "RN"<=8609))
3 - filter(ROW_NUMBER() OVER ( ORDER BY "T1"."SYS_NC00005$")<=8609)
4 - access("USER_ID"=6 AND "FOLDER_ID"=1)
6 - access("MAIL_ID"="M"."MAIL_ID")The above made use of both indexes, did and completed in 0.11 seconds.
As the above shows, it is possible to efficiently retrieve the desired records very rapidly without having to leave the cursor open.
If this SQL statement will be used in a web browser, it probably does not make sense to leave the cursor open. If the SQL statement will be used in an application that maintains state, and the user is expected to always page from the first row toward the last, then leaving the cursor open and reading rows as needed makes sense.
Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
I am trying to deploy a JSF application and the following is the error
Can't parse configuration file: jar:file:/C:/Sun/SDK/lib/jsf-impl.jar!/com/sun/faces/jsf-ri-runtime.xml: Error at line 3 column 14: jar:file:/C:/Sun/SDK/lib/jsf-impl.jar!/com/sun/faces/jsf-ri-runtime.xml<Line 3, Column 14>: XML-20149: (Error) Element 'faces-config' used but not declared.
at com.sun.faces.config.ConfigureListener.parse(ConfigureListener.java:1587)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:413)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4236)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
at com.sun.enterprise.web.WebModule.start(WebModule.java:292)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1095)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:924)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1095)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520)
at org.apache.catalina.startup.Embedded.start(Embedded.java:920)
at com.sun.enterprise.web.WebContainer.start(WebContainer.java:794)
at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:722)
at com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:72)
at com.sun.enterprise.server.ondemand.ServiceGroup.startLifecycleServices(ServiceGroup.java:266)
at com.sun.enterprise.server.ondemand.WebServiceGroup.startLifecycleServices(WebServiceGroup.java:210)
at com.sun.enterprise.server.ondemand.WebServiceGroup.start(WebServiceGroup.java:60)
at com.sun.enterprise.server.ondemand.ServiceGroup$1.run(ServiceGroup.java:180)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.server.ondemand.ServiceGroup.startChildren(ServiceGroup.java:177)
at com.sun.enterprise.server.ondemand.MainServiceGroup.start(MainServiceGroup.java:45)
at com.sun.enterprise.server.ondemand.ServerEntryListenerImpl.notifyEntry(ServerEntryListenerImpl.java:72)
at com.sun.enterprise.server.ondemand.entry.ServerEntryHelper.sendEvent(ServerEntryHelper.java:62)
at com.sun.enterprise.server.ondemand.entry.ServerEntryHelper.generateAppLoaderEntryContext(ServerEntryHelper.java:47)
at com.sun.enterprise.server.AbstractLoader.generateEntryContext(AbstractLoader.java:831)
at com.sun.enterprise.server.AbstractLoader.notifyAppEvent(AbstractLoader.java:837)
at com.sun.enterprise.server.DummyWebModuleLoader.load(DummyWebModuleLoader.java:62)
at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:206)
at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:201)
at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:326)
at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
Any ideas? Thanks in advanceI've got the same problem.
I had NetBeans 5.5 bundled with Tomcat and then installed Sun Java App. Server 9.
What I can think of is updating nebeans or downgrading application server, however I'm not sure if it's a good idea.
It might be lame, but: how to update JSF library that is used by NetBeans? -
Performance Tuning Issues: UNION and Stored Outlines
Hi,
I have two questions,
Firstly I have read this:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_1016.htm#i35699
What I can understand is using UNION ALL is better than UNION.
The ALL in UNION ALL is logically valid because of this exclusivity. It allows the plan to be carried out without an expensive sort to rule out duplicate rows for the two halves of the query.
Can someone explain me the following sentences.
Secondly my Oracle Database 10g is on FIRST_ROWS_1, how can stored outlines help in reducing I/O cost and response time in general?Please explain.
Thank you,
AdithUnion ALL and Union
SQL> select 1, 2 from dual
union
select 1, 2 from dual;
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 6 (67)| 00:00:01 |
| 1 | SORT UNIQUE | | 2 | 6 (67)| 00:00:01 |
| 2 | UNION-ALL | | | | |
| 3 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
| 4 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
11 rows selected.
SQL>select 1, 2 from dual
union all
select 1, 2 from dual;
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 4 (50)| 00:00:01 |
| 1 | UNION-ALL | | | | |
| 2 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
| 3 | FAST DUAL | | 1 | 2 (0)| 00:00:01 |
10 rows selected.
Adith -
App Server performance monitoring
Hi
Does anyone know a good J2EE performance monitoring tool for Sun ONE AppServer 7 ???
I have found a few, but most of them support Weblogic, Websphere and they leave Sun ONE in the "others".
I want to know if there's a tool made specially for Sun ONE.
thank you very muchHere are two pointers from the article at http://developers.sun.com/prodtech/appserver/reference/techart/monitoring.html --
http://www.openview.hp.com/products/spi/spi_sunapp/index.html
http://www.halcyoninc.com/products/SunAS/index.php -
IIS and Oracle Apps server plug-in issue
Hi,
I am getting following error with oracle IIS plug in.
Thanks you for your help. Let me know if further information is required.
Here is my proxy config file:
oproxy.serverlist=v3appec2
oproxy.v3appec2.hostname=vsgnyweblogic1.vitech.com
oproxy.v3appec2.port=80
oproxy.v3appec2.urlrule=/*
Error below
11/05/08 15:51:35: [op_uri_map.c (348)]: Into op_uri_map_t::map_uri_to_host
11/05/08 15:51:35: [op_uri_map.c (414)]: op_uri_map_t::map_uri_to_host, Found a match host=vsgnyweblogic1.vitech.com
11/05/08 15:51:35: [op_isapi_plugin.c (515)]: HttpFilterProc [em] is a proxy url - should redirect to host 0
11/05/08 15:51:35: [op_isapi_plugin.c (535)]: No Authorization header found
11/05/08 15:51:35: [op_isapi_plugin.c (457)]: Start of HttpFilterProc
11/05/08 15:51:35: [op_uri_map.c (348)]: Into op_uri_map_t::map_uri_to_host
11/05/08 15:51:35: [op_uri_map.c (414)]: op_uri_map_t::map_uri_to_host, Found a match host=vsgnyweblogic1.vitech.com
11/05/08 15:51:35: [op_isapi_plugin.c (515)]: HttpFilterProc [oproxy/oracle_proxy.dll] is a proxy url - should redirect to host 0
11/05/08 15:51:35: [op_isapi_plugin.c (535)]: No Authorization header found
11/05/08 15:51:35: [op_isapi_plugin.c (634)]: HttpExtensionProc started
11/05/08 15:51:35: [op_isapi_plugin.c (859)]: In init_ws_service
11/05/08 15:51:35: [op_isapi_plugin.c (905)]: init_ws_service: uri=/oproxy/oracle_proxy.dll
11/05/08 15:51:35: [op_proxy.c (34)]: op_send_proxy_request, hostname=vsgnyweblogic1.vitech.com port=80
11/05/08 15:51:35: [op_proxy.c (63)]: op_send_proxy_request, assembled URI is /oproxy/oracle_proxy.dll
11/05/08 15:51:35: [op_http.c (192)]: op_set_http_url: host=vsgnyweblogic1.vitech.com port=80 uri=/oproxy/oracle_proxy.dll
11/05/08 15:51:35: [op_isapi_plugin.c (1073)]: Skipping header connection=keep-alive
11/05/08 15:51:35: [op_isapi_plugin.c (1069)]: Sending header keep-alive=300
11/05/08 15:51:35: [op_isapi_plugin.c (1069)]: Sending header accept=text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
11/05/08 15:51:35: [op_isapi_plugin.c (1069)]: Sending header accept-charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7
11/05/08 15:51:35: [op_isapi_plugin.c (1069)]: Sending header accept-encoding=gzip,deflate
11/05/08 15:51:35: [op_isapi_plugin.c (1069)]: Sending header accept-language=en-us,en;q=0.5
11/05/08 15:51:35: [op_isapi_plugin.c (1073)]: Skipping header host=vsgnyweblogic1.vitech.com
11/05/08 15:51:35: [op_isapi_plugin.c (1069)]: Sending header user-agent=Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
11/05/08 15:51:35: [op_isapi_plugin.c (1073)]: Skipping header oproxysuri=/oproxy/oracle_proxy.dll
11/05/08 15:51:35: [op_isapi_plugin.c (1073)]: Skipping header oproxyshost=0
11/05/08 15:51:35: [op_http.c (257)]: Into op_get_connection
11/05/08 15:51:35: [op_http.c (372)]: op_open_new_socket, try to connect socket = 540
11/05/08 15:51:35: [op_http.c (381)]: op_open_new_socket, after connect ret = 0
11/05/08 15:51:35: [op_http.c (393)]: op_open_new_socket, set TCP_NODELAY to on
11/05/08 15:51:35: [op_http.c (397)]: op_open_new_socket, return, sd = 540
11/05/08 15:51:35: [op_http.c (717)]: op_send_http_request, exiting with rc = 1
11/05/08 15:51:35: [op_isapi_plugin.c (457)]: Start of HttpFilterProcAre you trying to access some Forms application using Proxy Plug-in? If yes, you might want to refer Note:294418.1 on MetaLink.
Thanks
Shail -
Performance tuning issue of 8.1.7's PL/SQL
My trouble sample code is list below,I know I can fix this proble easily at 9i,but,you know.
My procedure is called by receive a parameter,data_segmentseqno,its value maybe is 'segment1' or 'segment1,segment2,segment3'.In first case,procedure is work,it can find what I need,but,it will faile in case 2.
After I check it in DBAStudio's session,I found it was be parse to 'SELECT .. FROM .. WHERE E.SEGMENTSEQNO IN ( :1 )',oracle engine just think it has only one parameter,not three ones.SO,how should I do when I get a parameter include multi segment.
Somebody can help me,or the only way to solve this problem is use cursor instead use BULK COLLECTION.IN ORACLE 8.1.7.
create or replace package body RoundRobin is
procedure dispatchRoundRobin(
data_segmentseqno in varchar2
) is
type Cust_type is table of varchar2(18);
Cust_data Cust_type;
begin
/********** HERE IS MY TROUBLE *********
HOW SHOULD I DO FOR MULTI SEGMENTSEQNO
SELECT rowid BULK COLLECT INTO Cust_data
FROM dispatchedrecord e
where e.segmentseqno in ( data_segmentseqno ) ;
exception
when others then
dbms_output.put_line('Error'||sqlerrm);
end dispatchRoundRobin;Hello
You are using a single bind variable to represent multiple values. In this case you are asking oracle to see if e.segmentseqno is equal to 'segment1,segment2,segment3', which it isn't. What you need to do is either use separate bind variables for each value you want to test i.e.
WHERE e.segmentseqno IN (data_segmentseqno, data_segmentseqno2, data_segmentseqno3)Which isn't going to be very usefull unless you have a fixed number of values that are always used.
Another alternative would be to use dynamic SQL to form the where clause and put the values into the where clause directly
EXECUTE IMMEDIATE 'SELECT rowid FROM dispatchedrecord e
where e.segmentseqno in ('|| data_segmentseqno||')' BULK COLLECT INTO CustData ;But this isn't ideal either as you really should use bind variables for these values rather than litterals.
I'm not sure whether using a collection here for the list of segment values would help or not. I haven't used collections much in SQL statements, maybe someone else will have a better idea...
HTH
David -
Performance Tuning Issues ( How to Optimize this Code)
_How to Optimize this Code_
FORM MATL_CODE_DESC.
SELECT * FROM VBAK WHERE VKORG EQ SAL_ORG AND
VBELN IN VBELN AND
VTWEG IN DIS_CHN AND
SPART IN DIVISION AND
VKBUR IN SAL_OFF AND
VBTYP EQ 'C' AND
KUNNR IN KUNNR AND
ERDAT BETWEEN DAT_FROM AND DAT_TO.
SELECT * FROM VBAP WHERE VBELN EQ VBAK-VBELN AND
MATNR IN MATNR.
SELECT SINGLE * FROM MAKT WHERE MATNR EQ VBAP-MATNR.
IF SY-SUBRC EQ 0.
IF ( VBAP-NETWR EQ 0 AND VBAP-UEPOS NE 0 ).
IF ( VBAP-UEPVW NE 'B' AND VBAP-UEPVW NE 'C' ).
MOVE VBAP-VBELN TO ITAB1-SAL_ORD_NUM.
MOVE VBAP-POSNR TO ITAB1-POSNR.
MOVE VBAP-MATNR TO ITAB1-FREE_MATL.
MOVE VBAP-KWMENG TO ITAB1-FREE_QTY.
MOVE VBAP-KLMENG TO ITAB1-KLMENG.
MOVE VBAP-VRKME TO ITAB1-FREE_UNIT.
MOVE VBAP-WAVWR TO ITAB1-FREE_VALUE.
MOVE VBAK-VTWEG TO ITAB1-VTWEG.
MOVE VBAP-UEPOS TO ITAB1-UEPOS.
ENDIF.
ELSE.
MOVE VBAK-VBELN TO ITAB1-SAL_ORD_NUM.
MOVE VBAK-VTWEG TO ITAB1-VTWEG.
MOVE VBAK-ERDAT TO ITAB1-SAL_ORD_DATE.
MOVE VBAK-KUNNR TO ITAB1-CUST_NUM.
MOVE VBAK-KNUMV TO ITAB1-KNUMV.
SELECT SINGLE * FROM KONV WHERE KNUMV EQ VBAK-KNUMV AND
KSTEU = 'C' AND
KHERK EQ 'A' AND
KMPRS = 'X'.
IF SY-SUBRC EQ 0.
ITAB1-REMARKS = 'Manual Price Change'.
ENDIF.
SELECT SINGLE * FROM KONV WHERE KNUMV EQ VBAK-KNUMV AND
KSTEU = 'C' AND
KHERK IN ('C','D') AND
KMPRS = 'X' AND
KRECH IN ('A','B').
IF SY-SUBRC EQ 0.
IF KONV-KRECH EQ 'A'.
MOVE : KONV-KSCHL TO G_KSCHL.
G_KBETR = ( KONV-KBETR / 10 ).
MOVE G_KBETR TO G_KBETR1.
CONCATENATE G_KSCHL G_KBETR1 '%'
INTO ITAB1-REMARKS SEPARATED BY SPACE.
ELSEIF KONV-KRECH EQ 'B'.
MOVE : KONV-KSCHL TO G_KSCHL.
G_KBETR = KONV-KBETR.
MOVE G_KBETR TO G_KBETR1.
CONCATENATE G_KSCHL G_KBETR1
INTO ITAB1-REMARKS SEPARATED BY SPACE.
ENDIF.
ELSE.
ITAB1-REMARKS = 'Manual Price Change'.
ENDIF.
CLEAR : G_KBETR, G_KSCHL,G_KBETR1.
MOVE VBAP-KWMENG TO ITAB1-QTY.
MOVE VBAP-VRKME TO ITAB1-QTY_UNIT.
IF VBAP-UMVKN NE 0.
ITAB1-KLMENG = ( VBAP-UMVKZ / VBAP-UMVKN ) * VBAP-KWMENG.
ENDIF.
IF ITAB1-KLMENG NE 0.
VBAP-NETWR = ( VBAP-NETWR / VBAP-KWMENG ).
MOVE VBAP-NETWR TO ITAB1-INV_PRICE.
ENDIF.
MOVE VBAP-POSNR TO ITAB1-POSNR.
MOVE VBAP-MATNR TO ITAB1-MATNR.
MOVE MAKT-MAKTX TO ITAB1-MAKTX.
ENDIF.
SELECT SINGLE * FROM VBKD WHERE VBELN EQ VBAK-VBELN AND
BSARK NE 'DFUE'.
IF SY-SUBRC EQ 0.
ITAB1-INV_PRICE = ITAB1-INV_PRICE * VBKD-KURSK.
APPEND ITAB1.
CLEAR ITAB1.
ELSE.
CLEAR ITAB1.
ENDIF.
ENDIF.
ENDSELECT.
ENDSELECT.
ENDFORM. " MATL_CODE_DESCHi Vijay,
You could start by using INNER JOINS:
SELECT ......
FROM ( VBAK
INNER JOIN VBAP
ON VBAPVBELN = VBAKVBELN
INNER JOIN MAKT
ON MAKTMATNR = VBAPMATNR AND
MAKT~SPRAS = SYST-LANGU )
INTO TABLE itab
WHERE VBAK~VBELN IN VBELN
AND VBAK~VTWEG IN DIS_CHN
AND VBAK~SPART IN DIVISION
AND VBAK~VKBUR IN SAL_OFF
AND VBAK~VBTYP EQ 'C'
AND VBAK~KUNNR IN KUNNR
AND VBAK~ERDAT BETWEEN DAT_FROM AND DAT_TO
AND VBAP~NETWR EQ 0
AND VBAP~UEPOS NE 0
Regards,
John. -
Performance tuning issues........
Please guide me alternate option for below set of code:
LOOP AT ITAB1 WHERE DISC LT 0.
SELECT * FROM KONV WHERE KNUMV EQ ITAB1-KNUMV AND
KPOSN EQ ITAB1-POSNR AND
KSTEU EQ 'C'.
IF SY-SUBRC EQ 0.
ITAB1-FREE_INDI = 'Y'.
EXIT.
ENDIF.
ENDSELECT.
MODIFY ITAB1 TRANSPORTING FREE_INDI.
ENDLOOP.
*How to merge into one loop :
LOOP AT ITAB1.
IF ITAB1-FREE_MATL NE ''.
ITAB1-FREE_INDI = 'Y'.
MODIFY ITAB1.
GTEST = ITAB1-POSNR - 10.
READ TABLE ITAB1 WITH KEY SAL_ORD_NUM = ITAB1-SAL_ORD_NUM
POSNR = GTEST.
ITAB1-FREE_MATL = 'X'.
MODIFY ITAB1 TRANSPORTING FREE_MATL WHERE
SAL_ORD_NUM = ITAB1-SAL_ORD_NUM AND POSNR EQ GTEST.
CLEAR GTEST.
ENDIF.
ENDLOOP.
LOOP AT ITAB1 WHERE FREE_INDI EQ 'Y'.
IF ITAB1-UEPOS EQ G_UEPOS.
CLEAR ITAB1-FREE_INDI.
MODIFY ITAB1.
ENDIF.
MOVE ITAB1-UEPOS TO G_UEPOS.
ENDLOOP.
Thanx & Regrds.
Vijay..._How to Optimize this Code_
FORM MATL_CODE_DESC.
SELECT * FROM VBAK WHERE VKORG EQ SAL_ORG AND
VBELN IN VBELN AND
VTWEG IN DIS_CHN AND
SPART IN DIVISION AND
VKBUR IN SAL_OFF AND
VBTYP EQ 'C' AND
KUNNR IN KUNNR AND
ERDAT BETWEEN DAT_FROM AND DAT_TO.
SELECT * FROM VBAP WHERE VBELN EQ VBAK-VBELN AND
MATNR IN MATNR.
SELECT SINGLE * FROM MAKT WHERE MATNR EQ VBAP-MATNR.
IF SY-SUBRC EQ 0.
IF ( VBAP-NETWR EQ 0 AND VBAP-UEPOS NE 0 ).
IF ( VBAP-UEPVW NE 'B' AND VBAP-UEPVW NE 'C' ).
MOVE VBAP-VBELN TO ITAB1-SAL_ORD_NUM.
MOVE VBAP-POSNR TO ITAB1-POSNR.
MOVE VBAP-MATNR TO ITAB1-FREE_MATL.
MOVE VBAP-KWMENG TO ITAB1-FREE_QTY.
MOVE VBAP-KLMENG TO ITAB1-KLMENG.
MOVE VBAP-VRKME TO ITAB1-FREE_UNIT.
MOVE VBAP-WAVWR TO ITAB1-FREE_VALUE.
MOVE VBAK-VTWEG TO ITAB1-VTWEG.
MOVE VBAP-UEPOS TO ITAB1-UEPOS.
ENDIF.
ELSE.
MOVE VBAK-VBELN TO ITAB1-SAL_ORD_NUM.
MOVE VBAK-VTWEG TO ITAB1-VTWEG.
MOVE VBAK-ERDAT TO ITAB1-SAL_ORD_DATE.
MOVE VBAK-KUNNR TO ITAB1-CUST_NUM.
MOVE VBAK-KNUMV TO ITAB1-KNUMV.
SELECT SINGLE * FROM KONV WHERE KNUMV EQ VBAK-KNUMV AND
KSTEU = 'C' AND
KHERK EQ 'A' AND
KMPRS = 'X'.
IF SY-SUBRC EQ 0.
ITAB1-REMARKS = 'Manual Price Change'.
ENDIF.
SELECT SINGLE * FROM KONV WHERE KNUMV EQ VBAK-KNUMV AND
KSTEU = 'C' AND
KHERK IN ('C','D') AND
KMPRS = 'X' AND
KRECH IN ('A','B').
IF SY-SUBRC EQ 0.
IF KONV-KRECH EQ 'A'.
MOVE : KONV-KSCHL TO G_KSCHL.
G_KBETR = ( KONV-KBETR / 10 ).
MOVE G_KBETR TO G_KBETR1.
CONCATENATE G_KSCHL G_KBETR1 '%'
INTO ITAB1-REMARKS SEPARATED BY SPACE.
ELSEIF KONV-KRECH EQ 'B'.
MOVE : KONV-KSCHL TO G_KSCHL.
G_KBETR = KONV-KBETR.
MOVE G_KBETR TO G_KBETR1.
CONCATENATE G_KSCHL G_KBETR1
INTO ITAB1-REMARKS SEPARATED BY SPACE.
ENDIF.
ELSE.
ITAB1-REMARKS = 'Manual Price Change'.
ENDIF.
CLEAR : G_KBETR, G_KSCHL,G_KBETR1.
MOVE VBAP-KWMENG TO ITAB1-QTY.
MOVE VBAP-VRKME TO ITAB1-QTY_UNIT.
IF VBAP-UMVKN NE 0.
ITAB1-KLMENG = ( VBAP-UMVKZ / VBAP-UMVKN ) * VBAP-KWMENG.
ENDIF.
IF ITAB1-KLMENG NE 0.
VBAP-NETWR = ( VBAP-NETWR / VBAP-KWMENG ).
MOVE VBAP-NETWR TO ITAB1-INV_PRICE.
ENDIF.
MOVE VBAP-POSNR TO ITAB1-POSNR.
MOVE VBAP-MATNR TO ITAB1-MATNR.
MOVE MAKT-MAKTX TO ITAB1-MAKTX.
ENDIF.
SELECT SINGLE * FROM VBKD WHERE VBELN EQ VBAK-VBELN AND
BSARK NE 'DFUE'.
IF SY-SUBRC EQ 0.
ITAB1-INV_PRICE = ITAB1-INV_PRICE * VBKD-KURSK.
APPEND ITAB1.
CLEAR ITAB1.
ELSE.
CLEAR ITAB1.
ENDIF.
ENDIF.
ENDSELECT.
ENDSELECT.
ENDFORM. " MATL_CODE_DESC
Edited by: Vijay kumar on Jan 8, 2008 6:50 PM
Maybe you are looking for
-
Creative and Marketing - we need to publici
Why do we not see adds for the Creative players? I see itunes and ipod ads. There are no blogs adversiting gadgets and gizmos to add to our player. What do we do? I don't want to beat ipod, I want to atleast compete. I think I'll start a blog, and ga
-
Problem uploading pictures from my computer to internet
I just got my new imac. I have since uploaded two "events" in iPhoto and wanted to upload some of these pictures from my computer to some online programs (flikr etc..). But when I go to choose the photos to upload, I go to user - pictures - and then
-
No key guard lock option in my new BB
Last week I bought 8520, later I realised that the phone doean't have "Keyboard lock" option. Advise me How I can fix it.
-
Cant "edit in audition" any more.
I have just updated to 2014 CC versions inc Premiere pro 2014 and now the edit in Audition is greyed out when right clicking in timeline. If I go to project window right click Premiere goes through the prep audio file and opens Audition but no actual
-
I had to reload Adobe Digital Editions to my computer. Now my nook is not recognizing it when I try to load books. Any suggestions?