Updating a table using cursor is taking long time in oracle
Hi,
I am working on the oracle database 11gR2. I am trying update a table column which is newly added through cursor. below is the cursor.
BEGIN
FOR lcur_tab IN (select l.LOGIN_ID as login_id, lt.ERROR_CODE as error_code from LOGIN l INNER JOIN LOGIN_TASK lt ON (l.LAST_LOGIN_TASK_ID = lt.LOGIN_TASK_ID) )
LOOP
UPDATE ACCOUNT SET LOGIN_ERROR_CODE = lcur_tab.error_code where ACCOUNT_ID IN (SELECT ACCOUNT_ID FROM LOGIN_ACCOUNT where LOGIN_ID = lcur_tab.login_id ) ;
end LOOP;
commit;
END;
In the cursor we are trying to copy the Login table error_code value to LOGIN_ERROR_CODE of ACCOUNT Table, for the accounts associated with that Login. Here newly added column is LOGIN_ERROR_CODE in account table. this account table have 11million rows in it. when i used the above cursor it took 3hours and still running. So we stopped after that. Is there any way i can change this cursor syntax to update those column values. How can we do this type of updates?
Also i am planning to run thus update in the background . I don't have much knowledge on the PL/SQL stuff. So please help on this.
Thanks in advance.
Edited by: Hari on Mar 21, 2012 10:06 PM
Is there a reason that you don't want to do this with a single `UPDATE` statement? That should be quite a bit more efficient.
Something like
UPDATE account a
SET login_error_code = (
select lt.error_code
from login_task lt
join login l on (l.last_login_task_id = lt.login_task_id)
join login_account la on (la.login_id = l.login_id)
where la.account_id = a.account_id )
WHERE EXISTS (
select 1
from login_task lt
join login l on (l.last_login_task_id = lt.login_task_id)
join login_account la on (la.login_id = l.login_id)
where la.account_id = a.account_id );Justin
Similar Messages
-
Using functions in select statement(joining 5 tables) taking long time in Oracle
Hi,
I have created a query in oracle which joins 5 tables and uses two functions(function names are 'ca_concat' and 'ca_concat_noseq').
Query takes approximately 40 secs to execute around 12000 records. If I remove the functions from query it excutes within a second..
Note : I have used the oracle SQL Developer for testing the query.
It would be appriciated if anybody helps me to improve the perfomance of the query.
Below are the querie with and without functions:
1. Query with functions:
select
imsAuditEvent12.id as ID,
imsAuditEvent12.audit_time as AUDIT_TIME,
imsAuditEvent12.admin_dn as ADMIN_DN,
imsAuditEvent12.admin_name as ADMIN_NAME,
imsAuditEvent12.event_name as EVENT_NAME,
imsAuditEvent12.event_description as EVENT_DESCRIPTION,
imsAuditEvent12.event_state as EVENT_STATE,
imsAuditEvent12.envname as ENVNAME,
imsAuditTaskSession12.task_name as TASK_NAME,
imsAuditTaskSession12.id as TASK_ID,
imsAuditTaskSession12.task_description as TASK_DESCRIPTION,
imsAuditTaskSession12.task_priority as TASK_PRIORITY,
S1.OBJECT_ID,
S1.OBJECT_NAME as OBJECT_NAME,
S1.OBJECT_TYPE as OBJECT_TYPE,
S2.ATTRIBUTE_NAME as ATTRIBUTE_NAME,
S2.ATTRIBUTE_OLDVALUES as ATTRIBUTE_OLDVALUES,
S2.ATTRIBUTE_NEWVALUES as ATTRIBUTE_NEWVALUES,
S3.OBJECT_DN as OBJECT_DN,
S3.OBJECT_TYPE as IMSOBJECT_TYPE,
S3.CONTAINER_NAME as CONTAINER_NAME,
S3.CONTAINER_DN as CONTAINER_DN,
S3.CONTAINER_TYPE as CONTAINER_TYPE
from
imsAuditEvent12 LEFT JOIN imsAuditTaskSession12 ON imsAuditTaskSession12.id=imsAuditEvent12.tasksession_id LEFT JOIN
(select parent_event_id,
ca_concat('imsAuditEventObject12.parent_event_id',parent_event_id,'imsAuditEventObject12.object_name','imsAuditEventObject12') as OBJECT_NAME,
ca_concat('imsAuditEventObject12.parent_event_id',parent_event_id,'imsAuditEventObject12.object_type','imsAuditEventObject12') as OBJECT_TYPE,
ca_concat_noseq('imsAuditEventObject12.parent_event_id',parent_event_id,'imsAuditEventObject12.ID','imsAuditEventObject12') as OBJECT_ID
from
imsAuditEventObject12 group by parent_event_id) S1
ON imsAuditEvent12.id = S1.parent_event_id LEFT JOIN
(select
parent_object_id,
ca_concat('parent_object_id',parent_object_id,'attribute_name','imsauditobjectattributes12') as ATTRIBUTE_NAME,
ca_concat('parent_object_id',parent_object_id,'attribute_oldvalue','imsauditobjectattributes12') as ATTRIBUTE_OLDVALUES ,
ca_concat('parent_object_id',parent_object_id,'attribute_newvalue','imsauditobjectattributes12') as ATTRIBUTE_NEWVALUES
from
imsauditobjectattributes12 group by parent_object_id) S2
ON S1.OBJECT_ID = S2.parent_object_id LEFT JOIN
(select
parent_event_id,
ca_concat('parent_event_id',parent_event_id,'OBJECT_DN','imsauditobjectrelationship12') as OBJECT_DN,
ca_concat('parent_event_id',parent_event_id,'OBJECT_TYPE','imsauditobjectrelationship12') as OBJECT_TYPE ,
ca_concat('parent_event_id',parent_event_id,'CONTAINER_NAME','imsauditobjectrelationship12') as CONTAINER_NAME,
ca_concat('parent_event_id',parent_event_id,'CONTAINER_DN','imsauditobjectrelationship12') as CONTAINER_DN,
ca_concat('parent_event_id',parent_event_id,'CONTAINER_TYPE','imsauditobjectrelationship12') as CONTAINER_TYPE
from
imsauditobjectrelationship12 group by parent_event_id) S3
ON imsAuditEvent12.id =S3.parent_event_id where imsauditevent12.id > 0 and imsauditevent12.id <12000 order by imsauditevent12.id ASC;
2. Query without using functions:
select * from imsauditeventobject12 left join imsauditevent12 on imsauditeventobject12.id=imsauditevent12.id left join imsauditobjectattributes12 on imsauditeventobject12.id=imsauditobjectattributes12.parent_object_id left join imsaudittasksession12 on imsauditevent12.tasksession_id=imsaudittasksession12.id left join imsAuditObjectRelationship12 on imsAuditEvent12.id =imsAuditObjectRelationship12.parent_event_id where imsauditevent12.id >0 and imsauditevent12.id < 12000 order by imsauditevent12.id asc;
Thanks,
BadriHi,
Please find the below more information about the query.
DB version: Oracle 11g Enterprise Edition Release 11.2.0.1.0
Below are source of the functions:
create or replace function ca_concat( ca_key_name in varchar2,
ca_key_val in varchar2,
ca_other_col_name in varchar2,
ca_tname in varchar2 )
return varchar2
as
type rc is ref cursor;
l_str varchar2(32000);
l_sep varchar2(1);
l_val varchar2(32000);
l_count number(6);
l_cur rc;
begin
l_count :=1;
l_str := '';
open l_cur for 'select '|| ca_other_col_name ||'
from '|| ca_tname || '
where ' || ca_key_name || ' = '
using ca_key_val;
loop
fetch l_cur into l_val;
l_val := SUBSTR(l_val,0,102);
exit when (l_cur%notfound or l_count > 38);
l_str := l_str || l_sep || l_count || '.' || l_val;
l_sep := ',';
l_count := l_count + 1;
end loop;
close l_cur;
return l_str;
end;
create or replace function ca_concat_noseq( ca_key_name in varchar2,
ca_key_val in varchar2,
ca_other_col_name in varchar2,
ca_tname in varchar2 )
return varchar2
as
type rc is ref cursor;
l_str nvarchar2(32000);
l_sep varchar2(1);
l_val varchar2(32000);
l_count number(6);
l_cur rc;
begin
l_count :=1;
open l_cur for 'select '||ca_other_col_name||'
from '|| ca_tname || '
where ' || ca_key_name || ' = '
using ca_key_val;
loop
fetch l_cur into l_val;
exit when (l_cur%notfound or length(l_val)>3000 or l_count>1);
l_str := l_str || l_sep || l_val ;
l_sep := ',';
l_count := l_count + 1;
end loop;
close l_cur;
return l_str;
end;
Below are the tables structures:
DESC imsauditevent12;
Name Null Type
ID NOT NULL NUMBER
TASKSESSION_ID NOT NULL NUMBER
TASKSESSION_OID VARCHAR2(100)
PARENT_EVENT_OID VARCHAR2(100)
AUDIT_TIME NOT NULL TIMESTAMP(6)
EVENT_OID NOT NULL VARCHAR2(100)
ADMIN_DN NOT NULL VARCHAR2(512)
ADMIN_NAME VARCHAR2(255)
EVENT_NAME NOT NULL VARCHAR2(255)
EVENT_DESCRIPTION VARCHAR2(4000)
EVENT_STATE VARCHAR2(100)
ENVNAME NOT NULL VARCHAR2(100)
ENV_OID NOT NULL VARCHAR2(100)
DESC imsauditeventobject12;
Name Null Type
ID NOT NULL NUMBER
PARENT_EVENT_ID NOT NULL NUMBER
AUDIT_TIME NOT NULL TIMESTAMP(6)
OBJECT_TYPE NOT NULL VARCHAR2(100)
OBJECT_NAME VARCHAR2(255)
DESC imsauditobjectattributes12;
Name Null Type
ID NOT NULL NUMBER
PARENT_OBJECT_ID NOT NULL NUMBER
AUDIT_TIME NOT NULL TIMESTAMP(6)
DISPLAY_NAME VARCHAR2(255)
ATTRIBUTE_NAME NOT NULL VARCHAR2(255)
ATTRIBUTE_OLDVALUE VARCHAR2(4000)
ATTRIBUTE_NEWVALUE VARCHAR2(4000)
DESC imsaudittasksession12;
Name Null Type
ID NOT NULL NUMBER
PARENT_TS_OID VARCHAR2(100)
PARENT_EVENT_OID VARCHAR2(100)
AUDIT_TIME NOT NULL TIMESTAMP(6)
TASKSESSION_OID NOT NULL VARCHAR2(100)
ADMIN_DN NOT NULL VARCHAR2(512)
ADMIN_NAME VARCHAR2(255)
TASK_NAME VARCHAR2(255)
TASK_TAG NOT NULL VARCHAR2(255)
TASK_DESCRIPTION VARCHAR2(4000)
TASK_PRIORITY NUMBER
STATE NOT NULL VARCHAR2(100)
ENVNAME NOT NULL VARCHAR2(100)
ENV_OID NOT NULL VARCHAR2(100)
DESC imsAuditObjectRelationship12;
Name Null Type
ID NOT NULL NUMBER
PARENT_EVENT_ID NOT NULL NUMBER
AUDIT_TIME NOT NULL TIMESTAMP(6)
OBJECT_TYPE NOT NULL VARCHAR2(100)
OBJECT_DN NOT NULL VARCHAR2(512)
CONTAINER_TYPE NOT NULL VARCHAR2(100)
OBJECT_NAME NOT NULL VARCHAR2(255)
CONTAINER_NAME NOT NULL VARCHAR2(255)
CONTAINER_DN NOT NULL VARCHAR2(512)
OPERATION NOT NULL VARCHAR2(50)
Thanks,
Badri -
Query execution taking longer time in Oracle form 10g !!
Hi,
I'm generating a report through Oracle form ( forms 10g) and its taking 3-4 hours to finish. But when I run the same report query in (Oracle 11g) database, it gets executed in less than 40 mins.
The form takes only from and to date as input.
I tried hardcoring the date in the Oracle Form and then the report takes only 40 mins to generate.
I tried various approaches like changing the datatypes of form variable and correspondingly changing the query, but met with no success.
When the report in run through the form , we can see the query getting run in backend for nearly 3 hrs !!! tats really confusing !!
Please let me know, if anybody got any idea on this problem??Hi,
Even I am facing the same problem above. I am trying to fetch results from a cursor which has subquery running over the db link and placing the results set in a csv file using client_io package. When I run the cursor directly from database (11G), it takes not more than 3-4 min to get the results back. But when I run the same cursor via oracle forms 10G, the query in local database keep on waiting for hours to get results from remote database with "SQL*Net message from dblink". Session on local database remains in active status with state as "Waiting" while the session on remote database goes inactive with state as waiting for event "SQL*Net message from client"
This is confusing me since the same query when ran directly from backend fetches results soon.
Please let me know if anyone can help here
Thanks
Garima -
Query taking long time in oracle 10g
I have a query which runs in 1 minute in oracle 8 but it takes 2 hours in oracle 10. The query has couple of sub queries to select the max effective date as wee as current effective sequence. I checked the parameters and their values are as follows. I want to know whether any values can be increased to make it run faster. Also I did not find the parameter unnestsubquery, I think it should be set to FALSE but did not find the value when I did select * from v$parameter. Is it set to false value by default or should i explicitly declare it. Thanks
Statistic Name Result
processes 200
sessions 225
timed_statistics TRUE
sga_target 335544320
control_files /ora1db13/oradata/KVSU2P13/control01.ctl, /ora2db13/o
db_block_size 8192
compatible 10.2.0.1.0
db_file_multiblock_read_count 4
undo_management AUTO
undo_tablespace ADP_UNDO
db_domain
service_names KVSU2P13, KVSU2P13_VSUP
dispatchers (PROTOCOL=tcp)(DISPATCHERS=4)(CONNECTIONS=50)
shared_servers 10
max_shared_servers 20
shared_server_sessions 150
job_queue_processes 10
background_dump_dest /udb01/app/oracle/admin/KVSU2P13/bdump
user_dump_dest /udb01/app/oracle/admin/KVSU2P13/udump
core_dump_dest /udb01/app/oracle/admin/KVSU2P13/cdump
db_name KVSU2P13
open_cursors 300
optimizercost_based_transformation off
alwayssemi_join off
optimizer_index_cost_adj 10
optimizer_index_caching 50
pga_aggregate_target 25165824
workarea_size_policy autoPlease read these standard threads:
How to post a tuning request:
HOW TO: Post a SQL statement tuning request - template posting
When your query takes too long:
When your query takes too long ... -
Update ztable is taking long time
Hi All,
i have run the 5 jobs with the same program at a time but when we check the db trace
zs01 is taking long time as shown below.here zs01 is having small amount of data.
in the below dbtrace for updating zs01 is taking 2,315,485 seconds .how to reduce this?
HH:MM:SS.MS Duration Program ObjectName Op. Curs Array Rec RC Conn
2:36:15 AM 2,315,485 SAPLZS01 ZS01 FETCH 294 1 1 0 R/3
The code as shown below
you can check the code in the program SAPLZS01 include LZS01F01.
FORM UPDATE_ZS01.
IF ZS02-STATUS = '3'.
IF Z_ZS02_STATUS = '3'. "previous status is ERROR
EXIT.
ELSE.
SELECT SINGLE FOR UPDATE * FROM ZS01
WHERE PROC_NUM = ZS02-PROC_NUM.
CHECK SY-SUBRC = 0.
ADD ZS02-MF_AMT TO ZS01-ERR_AMT.
ADD 1 TO ZS01-ERR_INVOI.
UPDATE ZS01.
ENDIF.
ENDIF.
my question is when updating the ztable why it is taking such long time,
how to reduce the time or how to make faster to update the ztable .
Thanks in advance,
regards
SuniTry the code like this..
data: wa_zs01 type zs01.
FORM UPDATE_ZS01.
IF ZS02-STATUS = '3'.
IF Z_ZS02_STATUS = '3'. "previous status is ERROR
EXIT.
ELSE.
SELECT SINGLE FOR UPDATE * FROM ZS01
WHERE PROC_NUM = ZS02-PROC_NUM.
-- change
CHECK SY-SUBRC = 0.
ADD ZS02-MF_AMT TO wa_ZS01-ERR_AMT.
ADD 1 TO wa_ZS01-ERR_INVOI.
UPDATE ZS01 from wa_zs01.
ENDIF.
ENDIF.
And i think this Select query for ZS01 is inside the ZS02 SELECT statement,
This might also make slow process.
If you want to make database access always use Workarea/Internal table to fetch the data
and work with that.
Accessing database like this or with Select.... endselect is an inefficient programming. -
Deletion is taking long time using forall
Hi,
i am inserting and deleting the rows using forall. insert taking less time to inset the rows but while coming to
deletion it is taking more than 5 days long time to delete 18.5 million rows in a table using forall.
the main table having 70 million rows.
the code is..
FETCH ref_typ BULK COLLECT INTO l_id_tbl LIMIT 10000;
begin
FORALL i in 1..l_id_tbl.COUNT
INSERT INTO change_test (id,
history,
transaction,
date)
VALUES (seq.nextval,
'CHANGE_HIS',
l_id_tbl(i),
sysdate);
exception
when others then
null;
end;
begin
FoRALL i in 1..l_id_tbl.COUNT
DELETE FROM change_his
where id = l_id_tbl(i);
exception
when others then
null;
end;
end loop;
so please give me a good solution to delete the rows less than 5 days..Why are you wanting to do this using BULK COLLECT and FORALL?
Why not just "insert ... select ..." and "delete ..."?
Loading records into expensive PGA memory to insert them back on the database is bound to be slower (and use more server resources) than just doing a straight insert ... select ... statement.
Explain exactly what you are trying to do.
Re: 2. How do I ask a question on the forums? -
How to pick max value from a column of a table using cursor and iteration
Hello Everybody
I have a table loan_detail
and a column in it loan_amount
now i want to pick values from this table using cursor and then by using iteration i want to pick max value from it using that cursor
here is my table
LOAN_AMOUNT
100
200
300
400
500
5600
700i was able to do it using simple loop concepts but when i was trying to do this by using cursor i was not able to do it .
Regards
PeeyushSQL> SELECT MAX(sal) Highest_Sal,MIN(sal) Lowest_Sal FROM emp;
HIGHEST_SAL LOWEST_SAL
5000 800
SQL> set serverout on
SQL> DECLARE
2 TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
3 sal_tbl tmp_tbl;
4 CURSOR emp_sal IS
5 SELECT sal FROM emp;
6 counter INTEGER := 1;
7 BEGIN
8 FOR i IN emp_sal LOOP
9 sal_tbl(i.sal) := counter;
10 counter := counter + 1;
11 END LOOP;
12 DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
13 DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
14 END;
15 /
Lowest SAL:800
Highest SAL:5000
PL/SQL procedure successfully completed.
SQL> Even smaller
SQL> DECLARE
2 TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
3 sal_tbl tmp_tbl;
4 CURSOR emp_sal IS
5 SELECT sal FROM emp;
6 counter INTEGER := 1;
7 BEGIN
8 FOR i IN emp_sal LOOP
9 sal_tbl(i.sal) := 1;
10 END LOOP;
11 DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
12 DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
13 END;
14 /
Lowest SAL:800
Highest SAL:5000
PL/SQL procedure successfully completed.
SQL> Edited by: Saubhik on Jan 5, 2011 4:41 PM -
Table valueset taking long time to open the LOV
Hi,
We added a table valueset to a concurrent program. The table vaueset showsTransaction number from ra_interface_lines_all table. It is having long list. So we added the partial string entering message before open a long list.But still it is taking long time.
Please any help on this highly appreciated.
Thanks,
SambaHi
Try to modify the query or creating an index will speed up the process.
Thanks & regards
Rajan -
I've been using samsung for a long time and I just changed into an iPhone 5s and the most important thing I need is my calendar appointments , but in the notification center it doesn't show my events for tomorrow and it doesn't even show more than 1 event , will there be an updated or this soon? Or should I just shift back to samsung?????
Go to settings/notification centre and make sure today vie and calendar day view are both on
-
How to Update crmd_customer_h TABLE Using CRMV_EVENT Through Funtion Module
Hi
How we can update customer_h table using the CRMV_EVENT Where i implemented logic below in the Funtion Module.
data: lt_doc_flow TYPE crmt_doc_flow_wrkt,
lw_cust_h_com TYPE crmt_customer_h_com,
lw_input_field_names TYPE crmt_input_field_names,
lt_input_field_names TYPE crmt_input_field_names_tab,
lt_objects_to_save TYPE crmt_object_guid_tab,
lw_guid TYPE CRMT_OBJECT_GUID.
DATA : lv_process_type TYPE crmt_process_type.
data: wa_doc_flow type CRMT_DOC_FLOW_WRK.
data: wa_customer_h type crmd_customer_h.
* Function module for retriving the Process type.
CALL FUNCTION 'CRM_ORDERADM_H_READ_OW'
EXPORTING
iv_orderadm_h_guid = iv_header_guid
IMPORTING
ev_process_type = lv_process_type
EXCEPTIONS
admin_header_not_found = 1
OTHERS = 2.
if lv_process_type eq 'ZG01'.
CALL FUNCTION 'CRM_DOC_FLOW_READ_OB'
EXPORTING
IV_HEADER_GUID = iv_header_guid
IMPORTING
ET_DOC_FLOW_WRK = lt_doc_flow.
read table lt_doc_flow with key objtype_a = 'BUS2000116' INTO wa_doc_flow. "gc_object_type-service.
if sy-subrc eq 0. "set flag for service order
lw_cust_h_com-ref_guid = wa_doc_flow-objkey_a.
lw_cust_h_com-ZZTRAIL_FLAG = 'X'.
lw_cust_h_com-mode = 'A'.
lw_cust_h_com-ref_handle = '0000000001'.
lw_guid = wa_doc_flow-objkey_a.
INSERT lw_guid INTO TABLE lt_objects_to_save.
endif.
lw_input_field_names-fieldname = 'REF_GUID'.
lw_input_field_names-fieldname = 'ZZTRAIL_FLAG'.
lw_input_field_names-changeable = ' '.
INSERT lw_input_field_names INTO TABLE lt_input_field_names.
Maintain Customer H
CALL FUNCTION 'CRM_CUSTOMER_H_MAINTAIN_OW'
EXPORTING
is_customer_h_com = lw_cust_h_com
CHANGING
ct_input_field_names = lt_input_field_names
EXCEPTIONS
header_change_error = 1
header_create_error = 2
error_occurred = 3.
ENDIF.
*endif.
*Clearing local variables
clear: lv_process_type,
lw_cust_h_com,
lw_input_field_names.
*Free internal tables
free: lt_doc_flow,
lt_input_field_names.Hi Faisal
I think your not clear with what i am saying anyhow i will again explain you my requirement
As per my requirement
1)in the service order search report i need to add a field called "Has trail order with No Follow up" with values "Yes" & "Blank"
For above Field i added using the structure CRMST_QUERY_SRVO_BTIL and through configuration i am able to display the field in webui as per (Attachement Pic 1)
2)When i search with search criteria as "Has trail order with No Follow up" with "Yes"
Then in result list i need to show the service order those having follow up as trail orders(sales order) only.if for next document trail order having any follow up then those service orders dont want to show in result list.
For above requirement i implemented F.M using CRMV_EVENT & I configured for BUS2000115 And BEFORE_SAVE The Order
The FM Will get trigger when i save the service order and for that service order if create any follow up and try to save the trail order then This FM Will trigger and in this i am doing validations.
3)Add one AET Trail Flag field is added under CUSTOMER_H Table.
4)in the FM I am validating for if the trail order having the preceding document as service order then i need to make flag as "X" For that service order in customer_h
if suppose when i delete trail order from the service order then that flag must need to be "unset" from the CUSTOMER_H.
Why bcoz we are doing above process is do show records in result list based on Flag values
these flag checks are validating in the BADI Which we implemented for search logic.
Please refer below Login for my requirement:-
Proposal to have a custom “flag” field (background at table level,
crmd_customer_h) linked to service order which gets flagged whenever at
least one Trial order is created and saved from the Service Order.
The flag value should be cleared when all the trial orders created and
saved as follow up transactions are deleted from the system.
Similarly for Trial Orders will use the same custom “flag” field
which gets activated when at least one follow up is created and saved from Trial Order.
The flag value should be cleared when all the follow up transactions from
the Trial Order are deleted from the system.
When the above search criteria “Has Trial order with no follow up”
“is” “Yes” is applied then the logic derives all the service
orders which satisfy additional search criteria applied in the search and
for these Service orders checks if the custom flag field is checked to
derive all Service orders which have Trial order. The custom flag values
values are derived from crmd_customer_h table in CRM.
4 )Further for all the Trial Orders determined in Step 3
check if the Trial Order has a follow up by checking if the custom flag field
is checked. The custom flag values are derived from crmd_customer_h table in
CRM.
5) If step 4 is not met populate the preceding Service
Orders in the Result list -
my select query(2m records) coming within a second but while creating a table (nologging) based on the select clause it is taking long time.
can anybody give me the suggestion which part i will look to improve the performance..Plan
SELECT STATEMENT ALL_ROWS Cost: 11 Bytes: 655 Cardinality: 1
19 FILTER
18 NESTED LOOPS Cost: 11 Bytes: 655 Cardinality: 1
15 NESTED LOOPS Cost: 9 Bytes: 617 Cardinality: 1
12 NESTED LOOPS Cost: 8 Bytes: 481 Cardinality: 1
9 NESTED LOOPS Cost: 6 Bytes: 435 Cardinality: 1
6 NESTED LOOPS Cost: 4 Bytes: 209 Cardinality: 1
3 TABLE ACCESS BY INDEX ROWID TABLE OYSTER_WEB3.TRANSACTION Cost: 2 Bytes: 155 Cardinality: 1
2 BITMAP CONVERSION TO ROWIDS
1 BITMAP INDEX SINGLE VALUE INDEX (BITMAP) OYSTER_WEB3.IX_LINE_COMMODITY_ID
5 TABLE ACCESS BY INDEX ROWID TABLE OYSTERPLUS_DATA.BRIO_SUPPLIERS Cost: 2 Bytes: 54 Cardinality: 1
4 INDEX UNIQUE SCAN INDEX (UNIQUE) OYSTERPLUS_DATA.PK_BRIO_SUPPLIERS Cost: 1 Cardinality: 1
8 TABLE ACCESS BY INDEX ROWID TABLE OYSTER3.FLAT_SITE_MV Cost: 2 Bytes: 226 Cardinality: 1
7 INDEX UNIQUE SCAN INDEX (UNIQUE) OYSTER3.PK_FLAT_SITE_MV Cost: 1 Cardinality: 1
11 TABLE ACCESS BY INDEX ROWID TABLE OYSTER3.SITE_COMMODITY_CODING Cost: 2 Bytes: 46 Cardinality: 1
10 INDEX UNIQUE SCAN INDEX (UNIQUE) OYSTER3.PK_SITE_COMMODITY_CODING Cost: 1 Cardinality: 1
14 TABLE ACCESS BY INDEX ROWID TABLE OYSTERPLUS_DATA.BRIO_COMMODITIES Cost: 1 Bytes: 136 Cardinality: 1
13 INDEX UNIQUE SCAN INDEX (UNIQUE) OYSTERPLUS_DATA.PK_BRIO_COMMODITIES Cost: 0 Cardinality: 1
17 TABLE ACCESS BY INDEX ROWID TABLE OYSTER3.SUPPLIER_ALIAS Cost: 2 Bytes: 38 Cardinality: 1
16 INDEX UNIQUE SCAN INDEX (UNIQUE) OYSTER3.PK_SUPPLIER_ALIAS Cost: 1 Cardinality: 1 -
CDHDR table query taking long time
Hi all,
Select query from CDHDR table is taking long time,in where condition i am giving OBJECTCLASS = 'MAT_FULL' udate = sy-datum and langu = 'EN'.
any suggestion to improve the performance.i want to select all the article which got changed on current date
regards
shibuThis will always be slow for large data volumes, since CDHDR is designed for quick access by object ID (in this case material number), not by date.
I'm afraid you would need to introduce a secondary index on OBJECTCLAS and UDATE, if that query is crucial enough to warrant the additional disk space and processing time taken by the new index.
Greetings
Thomas -
Code to update a table using sqlldr
Hi all,
can anybody give the code to update a table using sqlldr with an example
thank youYou want add the new line and modified the existing line (based on empno) from file e:\scripts\sql\emp2_ext.dat into table emp2 :
7782,CLARK,MANAGER,7839,09/06/81,80000,,10
8000,ORACLE,DATABASE,,11/02/07,99999,,20Then :
SQL> conn system/mypwd
Connected.
SQL>
SQL> create directory my_dir as 'e:\scripts\sql';
Directory created.
SQL>
SQL> grant read,write on directory my_dir to scott;
Grant succeeded.
SQL>
SQL> conn scott/mypwd
Connected.
SQL> create table emp2_ext
2 (EMPNO NUMBER(4),
3 ENAME VARCHAR2(10),
4 JOB VARCHAR2(9),
5 MGR NUMBER(4),
6 HIREDATE DATE,
7 SAL NUMBER(7,2),
8 COMM NUMBER(7,2),
9 DEPTNO NUMBER(2)
10 )
11 ORGANIZATION EXTERNAL
12 ( TYPE ORACLE_LOADER
13 DEFAULT DIRECTORY my_dir
14 ACCESS PARAMETERS
15 ( records delimited by newline
16 badfile my_dir:'emp2_ext.bad'
17 logfile my_dir:'emp2_ext.log'
18 fields terminated by ','
19 missing field values are null
20 ( empno, ename, job, mgr, hiredate char date_format date mask "dd/mm/yy",
21 sal, comm, deptno
22 )
23 ) LOCATION ('emp2_ext.dat')
24 ) ;
Table created.
SQL>
SQL> select * from emp2_ext;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 80000 10
8000 ORACLE DATABASE 11/02/07 99999 20
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 24500 10
7839 KING PRESIDENT 17/11/81 50000 10
7934 MILLER CLERK 7782 23/01/82 13000 10
SQL> merge into emp2 a
2 using (select * from emp2_ext) b
3 on (a.empno=b.empno)
4 when matched then update set a.ename=b.ename,
5 a.job=b.job,
6 a.mgr=b.mgr,
7 a.hiredate=b.hiredate,
8 a.sal=b.sal,
9 a.comm=b.comm,
10 a.deptno=b.deptno
11 when not matched then insert (a.empno, a.ename, a.job, a.mgr, a.hiredate, a.sal, a.comm, a.deptno)
12 values (b.empno, b.ename, b.job, b.mgr, b.hiredate, b.sal, b.comm, b.deptno);
2 rows merged.
SQL>
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 80000 10 --modified line
7839 KING PRESIDENT 17/11/81 50000 10
7934 MILLER CLERK 7782 23/01/82 13000 10
8000 ORACLE DATABASE 11/02/07 99999 20 --added line
SQL> HTH,
Nicolas.
Well, Hans has already give good explanation with docs links...
Message was edited by:
N. Gasparotto -
Program SAPLSBAL_DB taking long time for BALHDR table entries
Hi Guys,
I am running a Z program in Quality and Production system both which is uploading data from Desktop.
In Quality system the Z program is successfully uploading datas but in production system its taking very long time even sometime getting time out.
As per trace analysis, Program SAPLSBAL_DB taking long time for BALHDR table entries.
Can anybody provide me any suggestion.
Regards,
Shyamal.These are QA screen shots where no issue, but we are getting very long time in CRP.
Regards,
Shyamal -
When I use update software from my mobile it take long time for checking update software and no thing happened to update my IOS software
Servers have been swamped. Keep trying and be patient. Wait a few days.
Maybe you are looking for
-
New user in solaris 11 to allow sftp only
We want to create new user and enable following 1. this user should be able to use only SFTP, SSH shall not be allowed 2. this user should not be able to go to any other directory
-
After updating ios I'm unable to connect with safari, server unavailable what do I do now?
-
Connect Oracle 10g Developer with Oracle 8i database
Is it possible to connect Oracle 10g Developer with Oracle 8i database. If possible then plz guide how i can.
-
[solved] Pacman believes nothing is installed
Hello, It's been a week or so I am not getting any update on my laptop when trying to run "pacman -Syu" So I started to check if the mirrors I used were up to date, I changed the according to some listed as up to date in https://www.archlinux.org/mir
-
Is there a way of changing the name of a schema?? I know in dba studio you can only change the password. Thanks. TP