Performance issue in executing a procedure
Hi all,
I am trying to insert some data into an empty column of a table that already contains 2Lakh data using a procedure in oracle.The procedure is executing without error but it is taking more time(i cancelled the execution and checked the table.it inserted only 50000 data in half-an-hour of time).
Here is the procedure :
create or replace procedure PROC_INSERT
as
i number;
b number;
rc number;
cursor c1 is select count(1) from copy_tm;
begin
open c1;
fetch c1 into rc;
b:=50;
i:=1;
if c1%found then
for i in 1..rc LOOP
update copy_tm set mainoffer =b where series =i;
commit;
b:=b+1;
if b =100 then
b:=50;
end if;
end loop;
end if;
close c1;
end;
Can u tell me whats wrong with the procedure?
Thanks,
Dpa
First, its not the right forum to ask this question.
Secondly, what is the version of database you are using. Have you tried parallel DML?
regards
Similar Messages
-
Performance issue: stmt.execute() takes a long time when using Oracle objs
Folks,
I have a PL/SQL API that returns a REF CURSOR over an Oracle object that contains other objects. In the JDBC layer, when I do a stmt.execute(), it takes about 1.2s for this statement to run while the execution of the PL/SQL API in the database takes only about 100ms or so. When I connect to a database that is physically located really far away, the delta here increases (perhaps due to the network latency).
I believe it is not as efficient to use Oracle ADTs in conjunction with JDBC. However, not using an Oracle object and replacing that with a bunch of linear arrays is not really an option for me considering the amount of change involved and what a maintenance nightware that would be. At the same time, I need to get this to perform better. Any thoughts?
I suspect that there are a number of network round trips with Oracle objects are involved. If that is infact true, what are my options?
I use Oracle 10g, and the Oracle JDBC thin driver. Thanks.I have an Oracle object that has say 3 fields - number, number and number_table (indexed table of numbers). Right now, I return a REF CURSOR and do a getObject() in the java layer. But, I want to try and change this so that I return linear arrays (meaning, all these fields are not embedded in an Oracle object). Dont know if that would make things quicker but wanted to check to see if there were other alternatives.
Also, can I define a procedure that returns an OUT parameter which is an indexed table, and then do a registerOutParameter(<index>, OracleTypes.ARRAY)? I tried that but it gives me a PLS-00306 error (wrong number of types of arguments). -
Weird issues while executing a procedure through php
Here is my issue. I have a procedure and i am trying to execute my sql line from php and it wont work. However if I execute my sql line from oracle SQLDeveloper it works. So im not sure what could be going on.
here is my error...
[12-Aug-2008 16:53:48] PHP Warning: oci_execute() [<a href='function.oci-execute'>function.oci-execute</a>]: ORA-06550: line 1, column 8:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor
The symbol "" was ignored.
ORA-06550: line 2, column 26:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current in /shared/htdocs/voting/vote.php on line 133and here is my sql from php...
DECLARE
U VARCHAR2(200);
V VARCHAR2(200);
E NUMBER;
I VARCHAR2(200);
BEGIN
U := '{$currentuser}';
V := '{$votedfor}';
E := {$electionid};
I := '{$address}';
VT_PLACE_VOTE(
U => U,
V => V,
E => E,
I => I
END;any help would be greate
Message was edited by:
amTZUse bind variables. This is a non-negotiable. In PHP this will look something like this:
$dbHost = $dbh->prepare( "begin MyFooProc( empID=>?, deptName=>?, empName=>? ); end;" );
$dbHost->bind_param( 1, $employeeID );
$dbHost->bind_param_inout( 2, $deptName, 100 );
$dbHost->bind_param_inout( 3, $Surname, 100 );
$dbHost->execute();
Suggest that you use a PHP forum - this has very little to do with PL/SQL itself. -
Performance issue on Java Stored Procedure
I have converted the Stored Procedures into JSP with SQLJ. I
loaded the classes (not the source) onto Oracle 8i Database and
published within tbe stored packages. What I found out was the
performance is about 12 times on average slower than the PL/SQL
stored packages when I made calls to JSP. I am not surprise JSP
is slower than PL/SQL but can we improve by tunning the Java
codings or VM within the 8i database?
nullJames Chan (guest) wrote:
: I have converted the Stored Procedures into JSP with SQLJ. I
: loaded the classes (not the source) onto Oracle 8i Database and
: published within tbe stored packages. What I found out was the
: performance is about 12 times on average slower than the PL/SQL
: stored packages when I made calls to JSP. I am not surprise JSP
: is slower than PL/SQL but can we improve by tunning the Java
: codings or VM within the 8i database?
all user written java code in the 8i rdbms is currently running
as bytecode in the jvm.
a future release will provide a component called "Native Compiler
[NCOMP]" so it should run considerably faster then.
see the following link for details :
http://technet.oracle.com/files/search/search.htm?ncomp
null -
Performance problem with java stored procedure
hi,
i developped a java class, then I stored it in Oracle 8.1.7.
This class contains several import of other classes stored in the database.
It works, but the execution perfomances are disappointing. It's very long. I guess, that's because of the great number of classes to load that are necessary for my class execution.
I tried to increase the size of the java pool (I parameter 70 Mo in the java_pool_size parameter of the init.ora), but the performance is not much better.
Has anyone an idea to increase the performance of this execution of my class ?
In particular, is there a way to keep permanently in memory the java objects used by my class ?
Thanks in advance
bye
[email protected]
nullbefore running Java, the database session needs to be Java enabled; this might be the reason why it is taking so long. If this is the case, you should see an improvement in subsequent calls, once a database session is Java enabled, other users can benefit from it.
Kuassi
I have some performance issue with java stored procedure. Hope some one will be able to help me out. I'm using java stored procedures in my application and basically these procedures are used to do some validation and form the XML message of the database tables. I have noticed that when I call the PL/SQL wrapper function, it is taking time to load the java class and once the class is loaded the execution is faster. Most of the time is spent for loading the class rather than executing the function. if I reduce the class load time, I can improve the performance drastically. Do any one of you know how to reduce the class load time. The following are the platform and oracle version.
O/S: IBM AIX
Oracle: 8.1.7 -
Oracle BPEL 11G performance issue
Hi
We are facing performance issues in executing our composite process in Oracle SOA 11g .
We have installed an admin server and 2 managed servers in cluster in same box. The machine utilization reached almost 95% when i started the admin server and 2 managed server (min n max size of heap given as 1GB each in start up). So i shut down one managed server and increased the JVM size of other to 2 GB and found that the heap size reaches 1.5 GB on start up (observed the heap size using Jconsole)
The machine capacity is windows server with 4 GB RAM.
Our process requries multiple records to be processed which are retrieved using Database query.
We have created 2 composites
the first composite has 2 BPEL process. the First BPEL 1 executes the DB query and retrieves the result and based on result retrieved we invoke the second BPEL2
which does around 4 DB calls and passed the result to the next composite. The final BPEL process 3 has multiple select and update query involving DB intensive process.
When we retrieve 500 records from the BPEL 1 and process , half way through we face out of memory exception. So we are using throttling but even then while executing the process of BPEL3 we are facing out of memory excetion.
Can you let me know how to find the memory space taken from heap by each BPEL process during it execution. Where in console can i get the memory used details so that i can find which BPEL sis consuming more memory and we can work on optimising.
Actually we are expecting around 1Lakh and above messages per day and need to check on how this process can handle and also how to increase or determine the capacity of the windows box.
any immediate help is highly appreciated
thanksAlways raise a case with Oracle Support for such issues.
Regards,
Anuj -
Performance issues STWB_2 for some users
A small amount of users have performance issues when executing transaction STWB_2 -> selecting a test plan and go to the message overview.
This action acts different for users with the same roles and parameters in their user master record. Executing STWB_2, selecting the same test plan and go to message overview takes 30 minutes for user 1 and 2 minutes for user 2.
Different behavior for individual users with the same access doing the same selection.
The only "solution" that works is re-creating the user master of the user with performance problems, and giving it a different name. This is not really an option and best practices.
Has anybody experienced the same issue and can give me tips and or tricks how to solve this?Hi,
a colleague told me that it seems that user 2 has set a user customizing that causes the data to be read newly (maybe remotely) instead of using the buffer. To check this go to the status analysis and select a status icon. Switch to the message tab and click on the icon user settings. Uncheck the flag "Use current message data".
Regards
Andreas -
Execute immediate issue while calling a procedure from plsql block
Hi all,
I have the following simple code ,my execute immediate is not working(I am pasting the error below as well)
CREATE OR REPLACE PROCEDURE CALL_RAHUL_PROCEDURES
AS
strng varchar2(1000);
BEGIN
for i in (select proc_name,flag,id from rahul_procedures order by id)
loop
if (i.flag = 'Y')
then
strng := 'exec '||i.proc_name||'(''rahul'')';
dbms_output.put_line(strng);
execute immediate strng;
end if;
end loop;
END CALL_RAHUL_PROCEDURES;
Error:
Connecting to the database INQDWD.
ORA-00900: invalid SQL statement
ORA-06512: at "ETLADMIN.CALL_RAHUL_PROCEDURES", line 17
ORA-06512: at line 2
exec RAHUL_HELLO_WORLD2('rahul');
Process exited.
Disconnecting from the database INQDWD.
data in rahul_procedures table :
Proc_name flag Id
RAHUL_HELLO_WORLD N 1
RAHUL_HELLO_WORLD2 Y 2
RAHUL_HELLO_WORLD N 3
RAHUL_HELLO_WORLD3 N 4
please help.
Regards
RahulMac_Freak_Rahul wrote:
Well I have to call 26 procedures one by one and the names of the procedures would be in a table'rahul_procedures' Which is 100% wrong.
Data is stored in tables, program code is stored in procedures or view defintions.
http://en.wikipedia.org/wiki/Data_%28computing%29
>
Data vs programs
Typically, different files are used to store programs vs data. Executable files contain programs; all other files are data files.
>
So you have just violated the primary distinction between data and program code.
I dont find anything strange in my question,Only because you do not appear to know what you are doing or the difference between data and program code.
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1943344500346351703
>
ugh, what an ugly "design". I can see your life will be full of performance issues, strange 'bugs', and other unpleasant side effects. I mean, it all looks "so cool", but it'll be a nightmare to maintain and enhance.
but then you have the issue of binds, which will be intractable. You'd have to know the binds at compile time, but you have hidden all of your sql in a magic generic table - so you cannot possibly know your binds at compile time.
I would suggest you discard all of this code (I am DEAD SERIOUS) and start over. This is a bad idea from the get go. Or at least do me a favor and do not use plsql (you make it look like a good database implementation, but it isn't)
The objective here is to store SQL Statements in a Table(a sql repository) and just call the required SQL from the application using the sqlid using the sql_execute procedure. ...
CHANGE YOUR OBJECTIVE.
How about this for a good objective:
the objective here is to store sql statement in a plsql routine (a sql repository, you call a procedure and we run sql) and just call the required sql form the applicatoin using the STORED PROCEDURE
sorry, can I think of hacks to get you going? yes, application contexts come to mind - a fixed number of binds comes to mind. Am I going to work them out? No - it is the wrong way to approach a database application. -
Performance issue in procedure
Hi All
i have a performance issue with below procedure it is taking 10-15 hrs .custom table has 2 lacks record .
PROCEDURE update_summary_dollar_amounts( p_errbuf OUT VARCHAR2
,p_retcode OUT NUMBER) IS
v_customer_id NUMBER := NULL;
pymt_count NUMBER := 0;
rec_count NUMBER := 0;
v_number_late NUMBER;
v_number_on_time NUMBER;
v_days_late NUMBER;
v_avg_elapsed NUMBER;
v_avg_elapsed_US NUMBER;
v_percent_prompt NUMBER;
v_percent_late NUMBER;
v_number_open NUMBER;
v_last_payment_amount NUMBER;
v_last_payment_date DATE;
v_prev_payment_amount NUMBER;
v_prev_payment_date DATE;
v_last_sale_amount NUMBER;
v_last_sale_date DATE;
v_mtd_sales NUMBER;
v_ytd_sales NUMBER;
v_prev_year_sales NUMBER;
v_prev_receipt_num VARCHAR2(30);
v_last_sale VARCHAR2(50);
c_current_year VARCHAR2(4);
c_previous_year VARCHAR2(4);
c_current_month VARCHAR2(8);
/* ====================================================================== */
/* CURSOR Customer Cursor (Main Customer) LOOP */
/* ====================================================================== */
CURSOR customer_cursor IS
SELECT cst.customer_id customer_id
,cst.customer_number customer_number
,cst.org_id org_id
FROM zz_ar_customer_summary_all cst
ORDER by cst.customer_id;
/* ====================================================================== */
/* CURSOR Payments Cursor LOOP */
/* Note: This logic is taken from the Customer Credit Snapshot */
/* Report - ARXCCS */
/* ====================================================================== */
CURSOR payments_cursor IS
SELECT cr.receipt_number receipt_num
,NVL(cr.amount,0) amount
,crh.gl_date gl_date
FROM ar_lookups
,ar_cash_receipts_all cr
,ar_cash_receipt_history_all crh
,ar_receivable_applications_all ra
,ra_customer_trx_all ct
WHERE NVL(cr.type,'CASH') = ar_lookups.lookup_code
AND ar_lookups.lookup_type = 'PAYMENT_CATEGORY_TYPE'
AND cr.pay_from_customer = v_customer_id
AND cr.cash_receipt_id = ra.cash_receipt_id
AND cr.cash_receipt_id = crh.cash_receipt_id
AND crh.first_posted_record_flag = 'Y'
AND ra.applied_customer_trx_id = ct.customer_trx_id(+)
ORDER BY cr.creation_date DESC
,cr.cash_receipt_id DESC
,ra.creation_date DESC;
customer_record customer_cursor%rowtype;
payments_record payments_cursor%rowtype;
BEGIN
p_errbuf := NULL;
p_retcode := 0;
c_current_year := TO_CHAR(SYSDATE,'YYYY');
c_current_month := TO_CHAR(SYSDATE,'YYYYMM');
c_previous_year := TO_CHAR(TO_NUMBER(c_current_year) - 1);
FOR customer_record IN customer_cursor LOOP
/* Get Days Late and Average Elapsed Days */
/* Note: This logic is taken from the Customer Credit Snapshot */
/* Report - ARXCCS */
BEGIN
v_customer_id := customer_record.customer_id;
BEGIN
SELECT DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.trx_date) / COUNT(cr.deposit_date))) avgdays
,DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.due_date) / COUNT(cr.deposit_date))) avgdayslate
,NVL(SUM(DECODE(SIGN(cr.deposit_date - ps.due_date),1, 1, 0)), 0) newlate
,NVL(SUM( DECODE(SIGN(cr.deposit_date - ps.due_date),1, 0, 1)), 0) newontime
INTO v_avg_elapsed
,v_days_late
,v_number_late
,v_number_on_time
FROM ar_receivable_applications_all ra
,ar_cash_receipts_all cr
,ar_payment_schedules_all ps
WHERE ra.cash_receipt_id = cr.cash_receipt_id
AND ra.applied_payment_schedule_id = ps.payment_schedule_id
AND ps.customer_id = v_customer_id
AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -12) AND SYSDATE
AND ra.status = 'APP'
AND ra.display = 'Y'
AND NVL(ps.receipt_confirmed_flag,'Y') = 'Y';
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_days_late := NULL;
v_number_late := NULL;
v_avg_elapsed := NULL;
v_number_on_time := NULL;
END;
IF (v_number_on_time + v_number_late) > 0
THEN
v_percent_prompt := ROUND(v_number_on_time/(v_number_on_time + v_number_late),2) * 100;
v_percent_late := ROUND(v_number_late/(v_number_on_time + v_number_late),2) * 100;
ELSE
v_percent_prompt := 0;
v_percent_late := 0;
END IF;
/* C2# 49827 */
/* Get new average elapsed days for US use only */
v_avg_elapsed_us := NULL;
IF NVL(customer_record.org_id,-999) = 114
THEN
v_avg_elapsed_us := 0;
BEGIN
SELECT ROUND(SUM(NVL(ra.amount_applied,0) * (cr.deposit_date - ps.trx_date)) / DECODE(SUM(NVL(ra.amount_applied,0)),0,1,SUM(NVL(ra.amount_applied,0)))) avg_elapsed_us
INTO v_avg_elapsed_us
FROM ar_receivable_applications_all ra
,ar_cash_receipts_all cr
,ar_payment_schedules_all ps
WHERE ra.cash_receipt_id = cr.cash_receipt_id
AND ra.applied_payment_schedule_id = ps.payment_schedule_id
AND ps.customer_id = v_customer_id
AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -06) AND SYSDATE
AND ps.status = 'CL'
AND ra.status = 'APP'
AND ra.display = 'Y'
AND nvl(ps.receipt_confirmed_flag,'Y') = 'Y'
AND ra.amount_applied <> 0;
v_avg_elapsed_us := NVL(v_avg_elapsed_us,0);
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_avg_elapsed_us := NULL;
END;
END IF;
END;
/* Get MTD, YTD, Prev Year Sales */
/* Note: This logic is taken from the Customer Credit Snapshot */
/* Report - ARXCCS */
BEGIN
SELECT NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYYMM'),c_current_month,amount_due_original,0)),0) mtd_sales
,NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYY'),c_current_year,amount_due_original,0)),0) ytd_sales
,NVL(SUM(DECODE(TO_CHAR(ps.trx_date,'YYYY'),c_previous_year,amount_due_original,0)),0) prev_sales
,SUM(DECODE(ps.status,'OP',(DECODE(SIGN(amount_due_original),1,1,0)),0)) number_open
INTO v_mtd_sales
,v_ytd_sales
,v_prev_year_sales
,v_number_open
FROM ar_payment_schedules_all ps
WHERE ps.customer_id = v_customer_id
AND ps.class != 'PMT';
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_mtd_sales := NULL;
v_ytd_sales := NULL;
v_prev_year_sales := NULL;
END;
/* Get Last and Previous Payments */
pymt_count := 0;
v_last_payment_date := NULL;
v_prev_payment_date := NULL;
v_last_payment_amount := NULL;
v_prev_payment_amount := NULL;
v_prev_receipt_num := NULL;
FOR payments_record IN payments_cursor LOOP
BEGIN
IF payments_record.receipt_num = v_prev_receipt_num
THEN
NULL;
ELSIF pymt_count = 0
THEN
v_last_payment_date := payments_record.gl_date;
v_last_payment_amount := payments_record.amount;
pymt_count := pymt_count +1;
v_prev_receipt_num := payments_record.receipt_num;
ELSIF pymt_count = 1
THEN
v_prev_payment_date := payments_record.gl_date;
v_prev_payment_amount := payments_record.amount;
EXIT;
ELSE
EXIT;
END IF;
END;
END LOOP;
/* Get Last Sale Date and Amount */
/* Note: This logic is taken from the Customer Credit Snapshot */
/* Report - ARXCCS */
BEGIN
SELECT MAX(TO_CHAR(ct.trx_date,'YYYYDDD')||ps.amount_due_original)
INTO v_last_sale
FROM ra_cust_trx_types_all ctt
,ar_payment_schedules_all ps
,ra_customer_trx_all ct
WHERE ps.customer_trx_id = ct.customer_trx_id
AND ct.cust_trx_type_id = ctt.cust_trx_type_id
AND ct.bill_to_customer_id = v_customer_id
AND ps.class || '' = 'INV'
ORDER BY ct.trx_date DESC
,ct.customer_trx_id DESC;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
v_last_sale := NULL;
END;
IF v_last_sale IS NOT NULL
THEN
v_last_sale_date := TO_DATE(SUBSTR(v_last_sale,1,7),'YYYYDDD');
v_last_sale_amount := SUBSTR(v_last_sale,8,15);
ELSE
v_last_sale_date := NULL;
v_last_sale_amount := NULL;
END IF;
/* Update Values into ZZ_AR_CUSTOMER_SUMMARY_ALL */
BEGIN
UPDATE zz_ar_customer_summary_all
SET sales_last_year = v_prev_year_sales
,sales_ytd = v_ytd_sales
,sales_mtd = v_mtd_sales
,last_sale_date = v_last_sale_date
,last_sale_amount = v_last_sale_amount
,last_payment_date = v_last_payment_date
,last_payment_amount = v_last_payment_amount
,previous_payment_date = v_prev_payment_date
,previous_payment_amount = v_prev_payment_amount
,prompt = v_percent_prompt
,late = v_percent_late
,avg_elapsed_days = v_avg_elapsed
,avg_elapsed_days_us = v_avg_elapsed_us -- C2# 49827
,days_late = v_days_late
,number_open = v_number_open
WHERE customer_id = customer_record.customer_id;
EXCEPTION
WHEN PROGRAM_ERROR THEN NULL;
WHEN DUP_VAL_ON_INDEX THEN NULL;
WHEN STORAGE_ERROR THEN NULL;
WHEN OTHERS THEN NULL;
END;
rec_count := rec_count + 1;
IF rec_count = 10000
THEN
COMMIT;
rec_count := 0;
fnd_file.put_line(fnd_file.output,'Commit at customer_id = ' || TO_CHAR(customer_record.customer_id) || ' ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'));
fnd_file.new_line(fnd_file.output,1);
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHEN others THEN
ROLLBACK;
p_retcode := 2;
p_errbuf := SQLERRM;
END update_summary_dollar_amounts;
Thanks,
AnuBased on my initial assessment of the code, it looks like you are utilizing the "slow by slow" method. It is often termed "slow by slow" because it is one of the most INefficient ways of doing data processing. The "slow by slow" method uses CURSOR FOR LOOPs to loop through entire record sets and process them one at a time. In your case it looks like you are using NESTED FOR LOOPs which could exacerbate the problem.
I recommend you re-think your approach and try and do everything in a single, or a few SQL statements if possible and avoid the procedural logic.
If you can post your business requirements, and sample data we may be able to help you achieve your goal.
HTH! -
Performance Issue Executing a BEx Query in Crystal Report E 4.0
Dear Forum
I'm working for a customer with big performance issue Executing a BEx Query in Crystal via transient universe.
When query is executed directly against BW via RSRT query returns results in under 2 seconds.
When executed in crystal, without the use of subreports multiple executions (calls to BICS_GET_RESULTS) are seen. Runtimes are as long as 60 seconds.
The Bex query is based on a multiprovider without ODS.
The RFC trace shows BICS connection problems, CS as BICS_PROV_GET_INITIAL_STATE takes a lot of time.
I checked the note 1399816 - Task name - prefix - RSDRP_EXECUTE_AT_QUERY_DISP, and itu2019s not applicable because the customer has the BI 7.01 SP 8 and it has already
domain RSDR0_TASKNAME_LONG in package RSDRC with the
description: 'BW Data Manager: Task name - 32 characters', data
type: CHAR; No. Characters: 32, decimal digits: 0
data element RSDR0_TASKNAME_LONG in package RSDRC with the
description 'BW Data Manager: Task name - 32 characters' and the
previously created domain.
as described on the message
Could you suggest me something to check, please?
Thanks en advance
Regards
RosaHi,
It would be great if you would quote the ADAPT and tell the audience when it is targetted for a fix.
Generally speaking, CR for Enteprise isn't as performant as WebI, because uptake was rather slow .. so i'm of the opinion that there is improvements to be gained. So please work with Support via OSS.
My onlt recommendations can be :
- Patch up to P2.12 in bi 4.0
- Define more default values on the Bex query variables.
- Implement this note in the BW 1593802 Performance optimization when loading query views
Regards,
H -
Hi,
I have read somewhere that EXECUTE ANY PROCEDURE is one of the most dangerous privilege. Could you please help me understanding it? I mean how exactly is this privilege dangerous and if it at all it is then what is the purpose of providing this privilege as an in-built privilege?
Thanks in advance.
Onkaronkar.nath wrote:
I do agree that when we assign any privilege with ANY , it has security risk as it allows the user to perform activity in any of the existing schemas in the the system but my concern here is:
1. Why at all this gets created when it is a security threat?Because there is always a DBA, who needs to perform system wide things.
2. I was also told that having this privilege , any user can execute one specific procedure attaining DBA privilege. Is that correct? If so then how?check the second response of this thread.
>
Thanksregards -
Performance issues executing process flows after upgrading db to 10G
We have installed OWF 2.6.2, and initially our database was at 9.2. Last week we updated our database to 10g, and process flow executions are taking a lot longer, from 1 minute to 15 minutes.
Any ideas anyone what could be the cause of this performance issue?
Thanks,
YanetHi,
Oracle10g database behaves differently on the statistics of tables and indexes. So check these and check wether the mappings are updating these statistics at the right moments with respect to the ETL-proces and with the right interval.
Also, check your generated sources on how statistics are gathered (dmbs_stats.gather....). Does the index that might play a vital role in Oracle9i get new statistics, or only the table? Or only the table where doubled in amount of rows by this mapping?
You can always take matter into your own hands, by letting OWB NOT generate the source for gathering statistics, and call your own procedure in a post-mapping.
Regards,
André -
Issue with Executing OS commands from Stored Procedure
I am trying to execute the scripts provided at :
http://github.com/xtender/XT_SHELL
provided by xtender user.
As required, I have asked my DBAs to grant privileges by executing the following scripts:
Begin
--change to needed permissions and execute
dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/factiva/ODS/bin/CVIM_Rpt_ExportCSVFile’, 'read,write,execute' );
end;
/where CVIM_Rpt_ExportCSVFile is my script residing in the Unix server where my Oracle is installed.
The error I am facing when I try to execute the following command is:
select * from table(xt_shell.shell_exec('/var/scripts/CVIM_Rpt_ExportCSVFile',100))
Exception:the Permission (java.io.FilePermission /var/scripts/CVIM_Rpt_ExportCSVFile execute) has not been granted to ODS. The PL/SQL to grant this is dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )I have asked my DBA to also execute the following scripts: - But I still see the same error as above. I am not able to figure out whats going on. Can anyone pls help me out??
EXEC Dbms_Java.Grant_Permission('ODS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
EXEC Dbms_Java.Grant_Permission(ODS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )DUPLICATE
===============================================================
Issue with Executing OS commands from Stored Procedure
============================================================== -
Can someone help me diagnose a strange stored procedure performance issue please?
I have a stored procedure (posted below) that returns message recommendations based upon the Yammer Networks you have selected. If I choose one network this query takes less than one second. If I choose another this query takes 9 - 12 seconds.
/****** Object: StoredProcedure [dbo].[MessageView_GetOutOfContextRecommendations_LargeSet] Script Date: 2/18/2015 3:10:35 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[MessageView_GetOutOfContextRecommendations_LargeSet]
-- Parameters
@UserID int,
@SourceMessageID int = 0
AS
BEGIN
-- variable for @HomeNeworkUserID
Declare @HomeNeworkUserID int
-- Set the HomeNetworkID
Set @HomeNeworkUserID = (Select HomeNetworkUserID From NetworkUser Where UserID = @UserID)
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON
-- Begin Select Statement
Select Top 40 [CreatedDate],[FileDownloadUrl],[HasLinkOrAttachment],[ImagePreviewUrl],[LikesCount],[LinkFileName],[LinkType],[MessageID],[MessageSource],[MessageText],[MessageWebUrl],[NetworkID],[NetworkName],[PosterEmailAddress],[PosterFirstName],[PosterImageUrl],[PosterName],[PosterUserName],[PosterWebUrl],[RepliesCount],[Score],[SmallIconUrl],[Subjects],[SubjectsCount],[UserID]
-- From View
From [MessageView]
-- Do Not Return Any Messages That Have Been Recommended To This User Already
Where [MessageID] Not In (Select MessageID From MessageRecommendationHistory Where UserID = @UserID)
-- Do Not Return Any Messages Created By This User
And [UserID] != @UserID
-- Do Not Return The MessageID
And [MessageID] != @SourceMessageID
-- Only return messages for the Networks the user has selected
And [NetworkID] In (Select NetworkID From NetworkUser Where [HomeNetworkUserID] = @HomeNeworkUserID And [AllowRecommendations] = 1)
-- Order By [MessageScore] and [MessageCreatedDate] in reverse order
Order By [Score] desc, [CreatedDate] desc
ENDThe Actual Execution Plan Shows up the same; there are more messages on the Network that is slow, 2800 versus 1,500 but the difference is ten times longer on the slow network.Is the fact I am doing a Top 40 what makes it slow? My first guess was to take the Order By Off and that didn't seem to make any difference.The execution plan is below, it takes 62% of the query to look up theIX_Message.Score which is the clustered index, so I thought this would be fast. Also the Clustered Index Seek for the User.UserID take 26%which seems high for what it is doing.
I have indexes on every field that is queried on so I am kind of at a loss as to where to go next.
It just seems strange because it is the same view being queried in both cases.
I tried to run the SQL Server Tuning Wizard but it doesn't run on Azure SQL, and my problem doesn't occur on the data in my local database.
Thanks for any guidance, I know a lot of the slowness is due to the lower tier Azure SQL we are using, many of the performance issues weren't noticed when were on the full SQL Server, but the other networks work extremely fast so it has to be something to
with having more rows.
In case you need the SQL for the View that I am querying it is:
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[MessageView]
AS
SELECT M.UserID, M.MessageID, M.NetworkID, N.Name AS NetworkName, M.Subjects, M.SubjectsCount, M.RepliesCount, M.LikesCount, M.CreatedDate, M.MessageText, M.HasLinkOrAttachment, M.Score, M.WebUrl AS MessageWebUrl, U.UserName AS PosterUserName,
U.Name AS PosterName, U.FirstName AS PosterFirstName, U.ImageUrl AS PosterImageUrl, U.EmailAddress AS PosterEmailAddress, U.WebUrl AS PosterWebUrl, M.MessageSource, M.ImagePreviewUrl, M.LinkFileName, M.FileDownloadUrl, M.LinkType, M.SmallIconUrl
FROM dbo.Message AS M INNER JOIN
dbo.Network AS N ON M.NetworkID = N.NetworkID INNER JOIN
dbo.[User] AS U ON M.UserID = U.UserID
GO
The Network Table has an Index on Network ID, but it non clustered but I don't think that is the culprit.
CorbyI marked your response as answer because you gave me information I didn't have about the sort. I ended up rewriting the query to be a join instead of the In's and it improved dramatically, about one second on a very minimal Azure SQL database, and before
it was 12 seconds on one network. We didn't notice the problem at all before we moved to Azure SQL, it was about one - three seconds at most.
Here is the updated way that was much more efficient:
CREATE PROCEDURE [dbo].[Procedure Name]
-- Parameters
@UserID int,
@SourceMessageID int = 0
AS
BEGIN
-- variable for @HomeNeworkUserID
Declare @HomeNeworkUserID int
-- Set the HomeNetworkID
Set @HomeNeworkUserID = (Select HomeNetworkUserID From NetworkUser Where UserID = @UserID)
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON
;With cteMessages As
-- Begin Select Statement
Select (Fields List)
-- Join to Network Table
From MessageView mv Inner Join NetworkUser nu on MV.NetworkID = nu.NetworKID -- Only Return Networks This User Has Selected
Where nu.HomeNetworkUserID = @HomeNeworkUserID And AllowRecommendations = 1
-- Do Not Return Any Messages Created By This User
And mv.[UserID] != @UserID
-- Do Not Return The MessageID
And mv.[MessageID] != @SourceMessageID
), cteHistoryForThisUser As
Select MessageID From MessageRecommendationHistory Where UserID = @UserID
-- Begin Select Statement
Select Top 40 (Fields List)
-- Join to Network Table
From cteMessages m Left Outer Join cteHistoryForThisUser h on m.MessageID = h.MessageID
-- Do Not Return Any Items Where User Has Already been shown this Message
Where h.MessageID Is Null
-- An Order By Is Needed To Get The Best Content First
Order By Score Desc
END
GO
The Left Outer Join to test for null was the biggest improvement, but it also helped to join to the NetworkUser table instead of do the In sub query. -
A STORED PROCEDURE PERFORMES SLOWER WHEN EXECUTED IN HMTLDB THE IN SQLPLUS
We executed a stored procedure in HTMLDB.
At the beginning and the end of this stored procedure a timestamp inserted in a
logtable. First we executed the procedure in HTMLDB's SQL workshop (version 2.0.0.00.49
for MacOSX) under the owners schema .
Execution time 17.61 seconds.
When we query the table the logtable we see that this is the real execution time :
Start: 29-01-07 10:12:17,000000
Einde: 29-01-07 10:12:33,000000
When executing the same procedure in SQLplus (as the schemeowner) the real execution
time is less then a second :
Start: 29-01-07 10:13:13,000000
Einde: 29-01-07 10:13:13,000000
Is there a difference in executing a stored procedure in HTMLDB and Sqlplus ?????Does it show the same timings if you execute the procedure first in Sql*Plus and then in APEX?
Keep in mind that with your first run all your queries are parsed (create execution plans, ...) and that the data read is maybe stored in the SGA. So the second run can participate from that.
Patrick
Check out my APEX-blog: http://inside-apex.blogspot.com
Maybe you are looking for
-
Cross platform CS on PC to CS3 on Mac does not work like video says
Your video on cross platform workflow states that you can import older Premier CS files on a PC into CS3 on a Mac. I tried this and get the message, "this project was saved in a aversion prior to Adobe Premiere Pro CS3 and cannot be opened on a Mac.
-
I wanted to install windows for Mac and I had vista so I put I the disk and installed followed the steps it then it closed my computer wen I turned it on it went straight to windows and it asked me to install it and put in the windows box code I f
-
Will HANA node supports cluster (Initiator node and Eexecutor node)
Hi Gurus, In vertica DB supports below cluster concepts, Will HANA supports Initiator node and Eexecutor node 1. client submits query to vertica cluster the node to which the client is connected is called the initiator node 2. Initiator node analyse
-
Macbook Pro will not load OS and will not boot from Install Disk
When I try to turn on my macbook pro it goes to the gray logo screen with the spinning gear however it does not progress from there and then after several minutes it proceeds to restart itself and the same process repeats itself. I have tried to boot
-
XVR-1000 performance questions
Hi there, I recently upgraded my SB1K from Elite3D m6 to XVR-1000 and I am a little disapointed by the performance... Quite often, when using an OGL application, and doing some dynamic viewing (rotation, ...), the graphics stop as if the card was pla