SRM -Supplier Enablement module-a simple query
Hi Gurus,
I am MM consultant, new to SRM. Doing presales activity with client.
I have one query.
My client got an information that SRM-supplier enablement module ( Supplier Collaboration ) implementation requires following :
Any transaction happened through this portal ( client's own portal) SAP charges
2 % on it.
Is it true???
Our client has ecc6 Business suite. what is SAP's pricing strategy for this SRM module
My client's decision of procurement SRM is pending for it. Can anybody provide any information ? Points will be awarded for any useful reply
Regards,
Santosh
Hi Santosh,
for SUS there is a fee for number of supplier connected in the SAP fee model.
Quite stupid thing, as many companies have no interest with this to connect
many suppliers. But: depending on the size of your client company, the fee is
wide open for negotiations, esp. with the whole fee package a companies has.
Cheers,
Claudia
Similar Messages
-
SRM 3.0 integration with XI 3.0 for Supplier enablement scenario
Hi,
Iam trying to integrate SRM 3.0 with <b>XI 3.0</b> for Supplier Enablement Scenario. Can anyone please help me with the documentation for the same? I have downloaded documentation for SRM from service.sap.com/ibc but it contains steps only for XI 2.0.
Does anyone have the steps for XI 3.0?
Thanks and Regards,
ManishVadim
We are looking to integrate SRM 4.0 with R/3 ( ECC 5.0 ) using XI 3.0. I went to service marketplace to look for XI process content for SRM 4.0 - I could find XI content for SRM 2.0 only.
1) Do you know where SAP pre-delivered XI 3.0 process content can be downloaded from ?
2) Would you be having the cookbooks- possibly for all scenarios for SRM 4.0
If you could forward /give pointers to the above , I would appreciate your help. My yahoo id is [email protected]
Thanks for your help in advance. -
A simple query to show sales versus last year on daily basis/
Hi guys,
I want to build a simple query with day (1,2,3,4,5,6) on the rows and "sales current year" and "sales last year"
on the columns.
I have only 0CALDAY in my cube.
How can I have on the rows the day in stead of the full date?
I would like to see in the sames row sales current year and sales last year.
Thanks
ShlomiHI Shlomi
Create a virtual characteristic in your infoprovider that can calculate the day from calendar Day. In ZXRSRZZZ while adding code for this virtual characteristic use the function module DATE_COMPUTE_DAY to compute the day for every calendar day.
For calculating Sales Current year, create a restricted ky figure with Sales as the key figure. Add 0CalDay to this RKF and create a variable for this infoobject(Eg: ZCURYEAR) that will receive input from the user for the range of dates eg: 08/16/2009 - 08/22/2009.
For Sales Prior year, create another restricted key figure with Sales. Add 0CalDay to this RKF and add a customer exit variable. In the Customer exit code use the ZCURYEAR variable and offset it to prior year in both the upper and lower limits. This should work.
I hope this helps.
Thanks. -
11.2.2.4.0 - Problem with temporary space in simple query
ttVersion
TimesTen Release 11.2.2.4.0 (64 bit Linux/x86_64) (timesten:53396) 2012-09-24T08:28:05Z
Instance admin: root
Instance home directory: /opt/TimesTen/timesten
World accessible
Daemon home directory: /var/TimesTen/timesten
I get "TT0802: Database temporary space exhausted" error in simple query with small data amount; Timesten try to allocate *40000312* bytes
describe adm.peer
Table ADM.PEER:
Name Null Type
PEER_ID NOT NULL TT_SMALLINT
CLUSTER_ID NOT NULL TT_TINYINT
DIALECT NOT NULL TT_INTEGER
HOST NOT NULL TT_VARCHAR(256 BYTE)
REALM NOT NULL TT_VARCHAR(256 BYTE)
ADDRESS TT_VARCHAR(256 BYTE)
PORT NOT NULL TT_INTEGER
PROTOCOL NOT NULL TT_INTEGER
AUTO_CONNECT NOT NULL TT_TINYINT
ENABLED NOT NULL TT_TINYINT
PRIORITY NOT NULL TT_TINYINT
MANDATORY NOT NULL TT_TINYINT
TSTAMP BINARY(8)
1 rows selected
describe adm.session
Table ADM.SESSION:
Name Null Type
SESSION_ID NOT NULL TT_VARCHAR(64 BYTE) inline
OBJ_ID NOT NULL TT_BIGINT
PR_OBJ_ID NOT NULL TT_BIGINT
SUBSCRIBER_ID NOT NULL TT_VARCHAR(32 BYTE) inline
IP NOT NULL TT_VARCHAR(15 BYTE) inline
IPV6_PREFIX TT_VARCHAR(39 BYTE) inline
IPV6_PREFIX_LEN NOT NULL TT_TINYINT
CREATE_TIME NOT NULL TT_TIMESTAMP
UPDATE_TIME NOT NULL TT_TIMESTAMP
RULES_SET_ID NOT NULL TT_BIGINT
PEER_ID NOT NULL TT_SMALLINT
MY_PEER_ID NOT NULL TT_SMALLINT
PROFILE_HASHC NOT NULL TT_BIGINT
FLAGS NOT NULL TT_INTEGER
QOS_POLICY_NAME NOT NULL TT_VARCHAR(32 BYTE) inline
BSID NOT NULL TT_BIGINT
CONGESTION_FLAG NOT NULL TT_TINYINT
SERVICE_CATEGORY_ID TT_VARCHAR(32 BYTE) inline
EVENT_CAUSE NOT NULL TT_TINYINT
EVENT_TIME TT_TIMESTAMP
TSTAMP BINARY(8)
1 rows selected
select * from adm.peer;
PEER_ID CLUSTER_ID DIALECT HOST REALM ADDRESS PORT PROTOCOL AUTO_CONNECT ENABLED PRIORITY MANDATORY TSTAMP
21 2 0 ddf1.server.com diameter.realm ddf1.server.com 3868 6 1 1 0 1 (null)
22 2 0 ddf2.server.com diameter.realm ddf2.server.com 3868 6 1 1 1 1 (null)
101 233 0 peer_101 testik.com peer_101.testik.com 3886 0 0 1 101 0 (null)
102 233 0 peer_102 testik.com peer_102.testik.com 3886 0 0 1 102 0 (null)
1 1 0 vr-t500.testik.com diameter.realm vr-t500.testik.com 3868 6 1 1 0 1 (null)
5 rows selected
select * from adm.session;
SESSION_ID OBJ_ID PR_OBJ_ID SUBSCRIBER_ID IP IPV6_PREFIX IPV6_PREFIX_LEN CREATE_TIME UPDATE_TIME RULES_SET_ID PEER_ID MY_PEER_ID PROFILE_HASHC FLAGS QOS_POLICY_NAME BSID CONGESTION_FLAG SERVICE_CATEGORY_ID EVENT_CAUSE EVENT_TIME TSTAMP
TEST_SESSION 13300000000020027 0 TEST_SUBSCRIBER 94.25.209.27 0 2012-10-18 12:56:07.155381000 2012-10-18 12:56:07.155381000 1 101 1 0 0 0 0 DEFAULT 0 (null) (null)
TEST_SESSION2 13300000000020028 13300000000020027 TEST_SUBSCRIBER 94.25.209.27 0 2012-10-18 12:56:07.155687000 2012-10-18 12:56:07.155687000 1 102 1 0 4 0 0 DEFAULT 0 (null) (null)
2 rows selected
SELECT p.address, count(*) as session_count from session s, peer p where p.peer_id = s.peer_id group by p.address failed,
TT0802: Database temporary space exhausted
dssize
PERM_ALLOCATED_SIZE: 307200.0
PERM_IN_USE_SIZE: 61763.0
PERM_IN_USE_HIGH_WATER: 69393.0
TEMP_ALLOCATED_SIZE: 37888.0
TEMP_IN_USE_SIZE: 13494.0
TEMP_IN_USE_HIGH_WATER: 21307.0
This is additional error info when this code exuted inside C code:
[TimesTen][TimesTen 11.2.2.4.0 ODBC Driver][TimesTen]TT0802: Database temporary space exhausted -- file "blk.c", lineno 3477, procedure "sbBlkAlloc"
ODBC Error/Warning = S1000, Additional Error/Warning = 802
[TimesTen][TimesTen 11.2.2.4.0 ODBC Driver][TimesTen]TT6221: Temporary data partition free space insufficient to allocate *40000312* bytes of memory -- file "blk.c", lineno 3477, procedure "sbBlkAlloc"
ODBC Error/Warning = S1000, Additional Error/Warning = 6221
Edited by: Vladimir Romanov on 18.10.2012 13:13
Edited by: Vladimir Romanov on 18.10.2012 13:51This may well be
Bug 14634954 - SELECT WITH GROUP BY REQUESTS LARGE TEMP MEMORY GETS TT0802 / TT6221
The bug is fixed in 11.2.2.4.1 which is hopefully due before the end of October. Can you run your test on 11.2.1 as well? The problem should not reproduce there as it is specific to 11.2.2 -
Simple Query for BPV is required.
I am very much new in Oracle EBS. I am needed of a simple query to develop Bank Payment Voucher report with fields mainly:
Header
Bank Payment Voucher No, Bank Name, Supplier Name, Supplier Site, Voucher Created By, Voucher Posted BY etc
Detail
account Code, Title , Description, Debit, Credit
This will help me to take start and explore further.
Thanx in advance.Hi
You are using getdate() that means it is taking system date of today
Try this :
SELECT T0.DocEntry, T0.Dscription, T0.Quantity, T0.ShipDate FROM DLN1 T0 Where
DateDiff(DD,T0.ShipDate,GetDate()) <= 1
ORDER BY T0.DocEntry
I haven't tested the query but should work .
Thank you
Bishal -
Can we call a function module in ADHOC query
Hi
Can we call a function module in ADHOC query if yes how.
Also we ned to know how to call a function module in SAP query.
An early responce is appreciated.
Thanks and best regards
RajeevOkay as far as I understand your aim is:
To fill a field in the output list with a value that is based on the current line information and calculated by a function module
So go to SQ02 and create an additional field in the InfoSet.
You can refer in the coding to the technical names you can see in the left tree window like P0000-PERNR.
More information is avaiable in the Help part look for additional field in SQ02.
Regards,
Michael -
How to write a simple query.
I have a table where I have data shown below. Now, I want to write a simple query which lists me the project and the count of the distinct effective dates for which data is existant there.
Sample data:
Project Task Effective Date (xx_proj_task_data)
101 T1 01-Jan-2008
101 T1 01-Feb-2008
101 T1 01-Mar-2008
101 T2 01-Jan-2008
101 T2 01-Apr-2008
101 T3 01-Apr-2008
102 T1 01-Jan-2008
102 T1 01-Feb-2008
102 T2 01-Apr-2008
103 T1 01-Jan-2008
103 T1 01-Feb-2008
103 T1 01-Mar-2008
103 T1 01-Apr-2008
103 T2 01-May-2008
103 T3 01-Jun-2008
103 T1 01-Jan-2008
103 T1 01-Aug-2008
103 T2 01-Apr-2008
Output Reqd:
Project Count(Distinct Effective Dates)
101 4
102 3
103 7
I can write a query that says:
select project_id, count(1)
from (select distinct project_id, effective_date
from xx_proj_task_data) x
group by project_id;
But, is there a way I can achieve the same by avoiding the inner Query (x) and just by a simple query ?
Thanks!Try below query:
select project_id
, count(distinct effective_date)
from xx_proj_task_data
group by project_id;
--venkata -
Simple Query in Oracle Linked Table in MS Access causes full table scan.
I am running a very simple query in MS ACCESS to a linked Oracle table as follows:
Select *
From EXPRESS_SERVICE_EVENTS --(the linked table name refers to EXPRESS.SERVICE_EVENTS)
Where performed > MyDate()
or
Select *
From EXPRESS_SERVICE_EVENTS --(the linked table name refers to EXPRESS.SERVICE_EVENTS)
Where performed > [Forms]![MyForm]![Date1]
We have over 50 machines and this query runs fine on over half of these, using an Oracle Index on the "performed" field. Running exactly the same thing on the other machines causes a full table scan, therefore ignoring the Index (all machines access the same Access DB).
Strangely, if we write the query as follows:
Select *
From EXPRESS_SERVICE_EVENTS
Where performed > #09/04/2009 08:00#
it works fast everywhere!
Any help on this 'phenominon' would be appreciated.
Things we've done:
Checked regional settings, ODBC driver settings, MS Access settings (as in Tools->Options), we have the latest XP and Office service packs, and re-linked all Access Tables on both the slow and fast machines independantly).Primarily, thanks gdarling for your reply. This solved our problem.
Just a small note to those who may be using this thread.
Although this might not be the reason, my PC had Oracle 9iR2 installed with Administratiev Tools, where user machines had the same thing installed but using Runtime Installation. For some reason, my PC did not have 'bind date' etc. as an option in the workarounds, but user machines did have this workaround option. Strangely, although I did not have the option, my (ODBC) query was running as expected, but user queries were not.
When we set the workaround checkbox accordingly, the queries then run as expected (fast).
Once again,
Thanks -
Dear Experts,
Not able to Execute this simple query :
Select T1.JobID , T1.BudgetValue,T1.ActualValue FROM [dbo].[Enprise_JobCost_ActualBudgetView] T1 WHERE T1.TransType = '[%0]'
RegardsHello,
View - A View in simple terms is a subset of a 'virtual table. It can be used to retrieve data from the tables, Insert, Update or Delete from the tables. The Results of using View are not permanently stored in the database.
Stored Procedure - A stored procedure is a group of SQL statements which can be stored into the database and can be shared over the netwrok with different users.
http://www.geekinterview.com/question_details/65914
Better make a UDT for your requirement.
Thanks
Manvendra Singh Niranjan -
Using a function module in ABAP Query
Hi All,
I want to use a function module in ABAp query in the Record Processing Section.
In the report program we click on Pattern button to inser the function module so that all the Importing and exporting parameter automatically appears.
Similarly is there any particular method of inserting a function module in ABAp Query.
Regards
Manipal ParkalaWhen you are doing the infoset for the query (SQ02) you can add coding by clicking the coding tab. You can chose in wich event you want your coding and there is Pattern Button for you to easy use.
If you don't want to put the code in the infoset just in the query then is not posible.
Nevertheless, I higly descourage the use of coding in queryies. If you need to insert some coding make an ALV its easier, clearer and much easier to mantain.
Hope it helps. -
Simple Query working on 10G and not working on 11gR2 after upgrade
Hi Folks,
This is the first time i am posting the query in this Blog.
I have a small issue which preventing the UAT Sigoff.
Simple query working fine on 10.2.0.1 and after upgrade to 11.2.0.1 its error out
10.2.0.4:
=====
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1;
COUNT(*)
1
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=00001;
COUNT(*)
1
SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1;
ATTRIBUTE1
00001
11.2.0.1:
=====
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1
ERROR at line 1:
ORA-01722: invalid number
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=00001
ERROR at line 1:
ORA-01722: invalid number
SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='1';
no rows selected
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='00001';
COUNT(*)
1
SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='00001';
ATTRIBUTE1
00001
++++++++++++++++++++++++++++++++++++++++++++++
SQL > desc APPS.HZ_PARTIES
Name Type
======== ======
ATTRIBUTE1 VARCHAR2(150)
++++++++++++++++++++++++++++++++++++++++++++++
Changes:
Recently i upgraded the DB from 10.2.0.4 to 11.2.0.1
Query:
1.If the type of that row is VARCHAR,why it is working in 10.2.0.4 and why not working in 11.2.0.1
2.after upgrade i analyzed the table with "analyze table " query for all AP,AR,GL,HR,BEN,APPS Schemas--Is it got impact if we run analyze table.
Please provide me the answer for above two questions or refer the document is also well enough to understand.Based on the Answer client will sigoff to-day.
Thanks,
P KumarWhiteHat wrote:
the issue has already been identified: in oracle versions prior to 11, there was an implicit conversion of numbers to characters. your database has a character field which you are attempting to compare to a number.
i.e. the string '000001' is not in any way equivalent to the number 1. but Oracle 10 converts '000001' to a number because you are asking it to compare to the number you have provided.
version 11 doesn't do this anymore (and rightly so).
the issue is with the bad code design. you can either: use characters in the predicate (where field = 'parameter') or you can do a conversion of the field prior to comparing (where to_num(field) = parameter).
I would suggest that you should fix your code and don't assume that '000001' = 1I don't think that the above is completely correct, and a simple demonstration will show why. First, a simple table on Oracle Database 10.2.0.4:
CREATE TABLE T1(C1 VARCHAR2(20));
INSERT INTO T1 VALUES ('1');
INSERT INTO T1 VALUES ('0001');
COMMIT;A select from the above table, relying on implicit data type conversion:
SELECT
FROM
T1
WHERE
C1=1;
C1
1
0001Technically, the second row should not have been returned as an exact match. Why was it returned, let's take a look at the actual execution plan:
SELECT
FROM
TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
SQL_ID g6gvbpsgj1dvf, child number 0
SELECT * FROM T1 WHERE C1=1
Plan hash value: 3617692013
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
|* 1 | TABLE ACCESS FULL| T1 | 2 | 24 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(TO_NUMBER("C1")=1)
Note
- dynamic sampling used for this statementNotice that the VARCHAR2 column was converted to a NUMBER, so if there was any data in that column that could not be converted to a number (or NULL), we should receive an error (unless the bad rows are already removed due to another predicate in the WHERE clause). For example:
INSERT INTO T1 VALUES ('.0001.');
SELECT
FROM
T1
WHERE
C1=1;
SQL> SELECT
2 *
3 FROM
4 T1
5 WHERE
6 C1=1;
ERROR:
ORA-01722: invalid numberNow the same test on Oracle Database 11.1.0.7:
CREATE TABLE T1(C1 VARCHAR2(20));
INSERT INTO T1 VALUES ('1');
INSERT INTO T1 VALUES ('0001');
COMMIT;
SELECT
FROM
T1
WHERE
C1=1;
C1
1
0001
SELECT
FROM
TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
SQL_ID g6gvbpsgj1dvf, child number 0
SELECT * FROM T1 WHERE C1=1
Plan hash value: 3617692013
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
|* 1 | TABLE ACCESS FULL| T1 | 2 | 24 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(TO_NUMBER("C1")=1)
Note
- dynamic sampling used for this statement
INSERT INTO T1 VALUES ('.0001.');
SELECT
FROM
T1
WHERE
C1=1;
SQL> SELECT
2 *
3 FROM
4 T1
5 WHERE
6 C1=1;
ERROR:
ORA-01722: invalid numberAs you can see, exactly the same actual execution plan, and the same end result.
The OP needs to determine if non-numeric data now exists in the column. Was the database characterset possibly changed during/after the upgrade?
Charles Hooper
Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
http://hoopercharles.wordpress.com/
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
Trying to optimize this simple query
Hi,
I am trying to optimize this simple query but the two methods I am trying actually make things worse.
The original query is:
SELECT customer_number, customer_name
FROM bsc_pdt_account_mv
where rownum <= 100
AND Upper(customer_name) like '%SP%'
AND customer_id IN
SELECT cust_id FROM bsc_pdt_assoc_sales_force_mv
WHERE area_identifier IN (
SELECT area_identifier FROM bsc_pdt_assoc_sales_force_mv
WHERE ad_identifier = '90004918' or rm_identifier = '90004918' or tm_identifier = '90004918'
The result set of this query returns me the first 100 rows in 88 seconds and they are all distinct by default (don't know why they are distinct).
My first attempt was to try to use table joins instead of the IN conditions:
SELECT
distinct -- A: I need to use distinct now
customer_number, customer_name
FROM bsc_pdt_account_mv pdt,
bsc_pdt_assoc_sales_force_mv asf,
SELECT distinct area_identifier FROM bsc_pdt_assoc_sales_force_mv
WHERE ad_identifier = '90004918' or rm_identifier = '90004918' or tm_identifier = '90004918'
) area
where
area.area_identifier = asf.area_identifier
AND asf.cust_id = pdt.customer_id
AND Upper(customer_name) like '%SP%'
AND rownum <= 100 -- B: strange when I comment this out
order by 1
I dont understand two things with this query. First issue, I now need to put in the distinct because the result set is not distinct by default. Second issue (very strange), when I put the rownum condition (<100) I get two rows in 1.5 seconds. If I remove the condition, I get 354 rows (whole result set) in 326 seconds.
My second attempt was to use EXISTS instead of IN:
SELECT
customer_number, customer_name
FROM bsc_pdt_account_mv pdt
where Upper(customer_name) like '%SP%'
AND rownum <= 100
AND EXISTS
select 1 from
bsc_pdt_assoc_sales_force_mv asf,
SELECT distinct area_identifier FROM bsc_pdt_assoc_sales_force_mv
WHERE ad_identifier = '90004918' or rm_identifier = '90004918' or tm_identifier = '90004918'
) area
where
area.area_identifier = asf.area_identifier
AND asf.cust_id = pdt.customer_id
This query returns a similar distinct result set as teh original one but takes pretty much the same time (87 seconds).The query below hangs when run in TOAD or PL/SQL Dev. I noticed there is no rows returned from the inner table for this condition.
SELECT customer_number, customer_name
FROM
bsc_pdt_account_mv pdt_account
where rownum <= 100
AND exists (
SELECT pdt_sales_force.cust_id
FROM bsc_pdt_assoc_sales_force_mv pdt_sales_force
WHERE pdt_account.customer_id = pdt_sales_force.cust_id
AND (pdt_sales_force.rm_identifier = '90007761' or pdt_sales_force.tm_identifier = '90007761') )
ORDER BY customer_name
-- No rows returned by this query
SELECT pdt_sales_force.cust_id
FROM bsc_pdt_assoc_sales_force_mv pdt_sales_force
WHERE pdt_sales_force.rm_identifier = '90007761' or pdt_sales_force.tm_identifier = '90007761' -
a simple query
on plsql block
if i don't define the size of a variable of number type what will be the default size ?
declare
a number ;
begin
null
end;
and in a procedure if i don't mention in or out in the parameters what will oracle take it by default ?
create or replace procedure(a number,b number)
is
begin
null
end;
PLs note that both the pl/sql blocks are just for giving an idea .
regards
SHUBHYou can get such information from the documents.
[imp]The absence of precision and scale designators specifies the maximum range and precision for an Oracle number.[imp]
Cheers
Sarma. -
Following is a simple query, what i want to know, i have added upper select to get d.name which is the description of region_code. Can i get whole result with single select
SELECT t.region_code,d.name, t.emp_contr
FROM
(SELECT c.br_region_fo_code as Region_Code,
SUM(c.employer_contribution) AS emp_contr
FROM core_business.cb_contr_emp_pmt_slip c
GROUP BY c.br_region_fo_code ) t,
general_information.cb_region_fo d
WHERE t.br_region_fo_code = d.region_fo_code;Boneist wrote:
malhi wrote:
Following is a simple query, what i want to know, i have added upper select to get d.name which is the description of region_code. Can i get whole result with single select
SELECT t.region_code,d.name, t.emp_contr
FROM
(SELECT c.br_region_fo_code as Region_Code,
SUM(c.employer_contribution) AS emp_contr
FROM core_business.cb_contr_emp_pmt_slip c
GROUP BY c.br_region_fo_code ) t,
general_information.cb_region_fo d
WHERE t.br_region_fo_code = d.region_fo_code;To be honest, I wouldn't bother rewriting the above query - it looks like it's filtering early (although Oracle could choose to rewrite it so that it does the join first, I guess), so that you're reducing the number of rows that the outer query has to join to. That means less work. If it is rewriting, I'd stick a no_merge hint on the subquery, to tell Oracle to do the grouping first before joining.
You could rewrite the above query as:
SELECT c.br_region_fo_code AS region_code,
d.name,
SUM(c.employer_contribution) AS emp_contr
FROM core_business.cb_contr_emp_pmt_slip c,
general_information.cb_region_fo d
WHERE t.br_region_fo_code = d.region_fo_code
GROUP BY c.br_region_fo_code, d.name;but whether Oracle will filter early or not is another matter. You would have to test both runs.I believe that Jonathan Lewis had a demonstration of execution plans that showed Oracle transforming queries to "push" GROUP BY clause prior to a join when sufficient contraints were in place to allow that and there was a performance benefit in doing so. I'd certainly be interested in seeing whether this was being done. The optimisation was really aimed at reducing the size of the group by key columns. -
Simple query takes 18 minutes to retrieve data....
Hi,
I am facing this problem at the customer site where a simple query on a table takes 18 minutes or more. Please find below the details.
Table Structure
CREATE TABLE dsp_data
quantum_id NUMBER(11) NOT NULL,
src NUMBER(11) NOT NULL,
call_status NUMBER(11) NOT NULL,
dst NUMBER(11) NOT NULL,
measurement_id NUMBER(11) NOT NULL,
is_originating NUMBER(1) NOT NULL,
measurement_value NUMBER(15,4) NOT NULL,
data_type_id NUMBER(3) NOT NULL,
data VARCHAR2(200) NOT NULL
TABLESPACE dsp_data_tspace
STORAGE (PCTINCREASE 0 INITIAL 100K NEXT 1024K)
PARTITION BY RANGE (quantum_id)
(PARTITION dsp_data_default VALUES LESS THAN (100));
CREATE INDEX dsp_data_idx ON dsp_data
quantum_id,
src,
call_status,
dst,
measurement_id,
is_originating,
measurement_value,
data_type_id
TABLESPACE dsp_data_idx_tspace
LOCAL;
CREATE INDEX dsp_data_src_idx ON dsp_data
src
TABLESPACE dsp_data_idx_tspace
LOCAL;
CREATE INDEX dsp_data_dst_idx ON dsp_data
dst
TABLESPACE dsp_data_idx_tspace
LOCAL;
ALTER TABLE dsp_data
ADD CONSTRAINT fk_dsp_data_1
FOREIGN KEY
quantum_id
REFERENCES mds_measurement_intervals
quantum_id
ALTER TABLE dsp_data
ADD CONSTRAINT fk_dsp_data_2
FOREIGN KEY
data_type_id
REFERENCES mds_drilldown_types
type_id
ALTER TABLE dsp_data
ADD CONSTRAINT pk_dsp_data
PRIMARY KEY
quantum_id,
src,
call_status,
dst,
measurement_id,
is_originating,
measurement_value,
data_type_id,
data
USING INDEX
TABLESPACE dsp_data_idx_tspace
LOCAL;
Table Space Creation
All table space creation is done using following command
CREATE TABLESPACE [tablespaceName]
DATAFILE [tablespaceDatafile] SIZE 500M REUSE
AUTOEXTEND ON NEXT 10240K
DEFAULT STORAGE ( INITIAL 1024K
NEXT 1024K
MINEXTENTS 10
MAXEXTENTS UNLIMITED
PCTINCREASE 0
Server Configuration on CUtsomer Site
(1) 2 x Dual PA8900 Proc = 4GHz
(2) RAM = 16GB
(3) 3 x Internal HDDs
(4) 1 x External MSA-30 storage array (oracle db)
Record Information On Customer Site
select count(*) from dsp_data;
COUNT(*)
181931197
select min (quantum_id) from dsp_data where dst=2;
This takes 18 minutes or more....
SQL> SQL> SQL> explain plan for select min (quantum_id) from dsp_data where dst=2;
Explained.
SQL> @?/rdbms/admin/utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 999040277
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 14 | 1 (0)| 00:00:01 | | |
| 1 | SORT AGGREGATE | | 1 | 14 | | | | |
| 2 | FIRST ROW | | 92 | 1288 | 1 (0)| 00:00:01 | | |
| 3 | PARTITION RANGE ALL | | 92 | 1288 | 1 (0)| 00:00:01 | 1 | 29 |
|* 4 | INDEX FULL SCAN (MIN/MAX)| DSP_DATA_IDX | 92 | 1288 | 1 (0)| 00:00:01 | 1 | 29 |
As mentioned above the query takes 18 minutes or more. This is a critical issue at customer. Can you please give your suggestions how to improve and reduce the query time. Thanks in advance.Hi,
I did the following changes in the indexes of table.
drop index DSP_DATA_IDX;
create index DSP_DATA_MEASUREMENT_ID_IDX on DSP_DATA (MEASUREMENT_ID) TABLESPACE dsp_data_idx_tspace LOCAL;
After that I did explain plan,
explain plan for select min(QUANTUM_ID) from mds.DSP_DATA where SRC=11;
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost (%CPU
| 0 | SELECT STATEMENT | | 1 | 11 | 3 (0
| 1 | SORT AGGREGATE | | 1 | 11 |
| 2 | FIRST ROW | | 430K| 4626K| 3 (0
| 3 | PARTITION RANGE ALL | | 430K| 4626K| 3 (0
| 4 | INDEX FULL SCAN (MIN/MAX)| PK_DSP_DATA | 430K| 4626K| 3 (0
Note
- 'PLAN_TABLE' is old version
14 rows selected
SELECT table_name, index_name, monitoring, used FROM v$object_usage;
TABLE_NAME INDEX_NAME MONITORING USED
DSP_DATA DSP_DATA_SRC_IDX YES NO
It seems that DSP_DATA_SRC_IDX is not getting used in query. What changes do i need to make so that DSP_DATA_SRC_IDX index gets used.
Also, you have stated that to create global index on src and dst. How do i create them.
Thanks in Advance.
Edited by: 780707 on Jul 8, 2010 11:58 PM
Maybe you are looking for
-
Incorrect music library file size after upgrading to itunes 7.1.1.5
I was running itunes 7.0.2 and I have a 40gb click wheel IPOD (3rd Generation?). In itunes 7.0.2 my music library stats showed 7046 songs stored on 34.6 gb of disk space. Once I upgraded to itunes 7.1.1.5 and restarted itunes, my music library stats
-
when i try to download itunes i keep getting the error message " Service 'Apple Mobile Device' (Apple Mobile Device) Failed to start. Verify that you have sufficient privileges to start system services. Can someone help?
-
I keep getting messages like this in my OracleXE alter log: ORA-17624: Failed to delete directory C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\BACKUPSET\2008_08_04 I get these for the backupset, autobackup, and archivelog directories. These are happ
-
Migration Assistant to an Intel Mac?
Will it be possible to transfer things like current user settings from my current mac to a new intel mac? Anyone whose done this, please let me know.... Thanks, -David
-
&P_Year - is it an APEX variable?
Hello Folks I am working on a query generated by a person who no longer works with us. In this query, he was consistently using a variable '&P_Year'. Each time I try to compile the code, I get an error ORA01008 - A SQL statement containing substituti