SQL & PL/SQL :: Why Do Stored Procedures And Functions Improve Performance

Feb 10, 2012

Why do stored procedures and functions improve performance?

A. They reduce network round trips.
B. They reduce the number of calls to the database and decrease network traffic by bundling commands.
C. They reduce the number of calls to the database and decrease network traffic by using the local PL/SQL engine.
D. They allow the application to perform high-speed processing locally.
E. They postpone PL/SQL parsing until run time.

I think the answer should be A and B but i came across answers as B and E Can u explain me what is the difference between option A and B and does it postpone parsing till run time?

View 1 Replies


ADVERTISEMENT

SQL & PL/SQL :: How To Call Stored Procedures Or Functions From A Database Trigger

Oct 14, 2011

How to call stored procedures or functions from a database trigger?

View 1 Replies View Related

Performance Tuning :: How To Improve The Performance Of Export Job (expdp)

Dec 6, 2011

I have an issue with export(expdp).

When i exporting an user using expdp utility, the load the on the server is going up-to 5. The size of the database is 180GB. Below is the command that i use for export.

expdp sys/xxxx directory=dbpdump dumpfile=expdp_trk_backup.dmp logfile=expdp_trk_backup.log exclude=statistics schemas=trk

Do i need any look into any memory parameters for this?

View 1 Replies View Related

SQL & PL/SQL :: How Many Procedures And Functions Can Be Written In Package

May 4, 2010

I think there is no limit for number of procedures and functions can be written in a package, but little much confusion.

What is the maximum number of Procedures and Functions can be written in a package? is such type of limit is there or not ?

View 4 Replies View Related

SQL & PL/SQL :: How Many Functions And Procedures Exist In Package

Apr 6, 2011

how many functions and Procedures are exist in Package. Is it possible to identify through query.

Eg: I have one Package:- ABC. This ABC package having 2 functions and 3 procedures. I want, total no.of functions and total no.of procedures through query.

View 1 Replies View Related

SQL & PL/SQL :: Call Procedures And Functions In Database Triggers?

Oct 6, 2010

Is it possible to call procedures and functions in Database Triggers?

View 1 Replies View Related

Determining What Procedures / Triggers / Functions Update A Table

Jul 2, 2010

I'm trying to determine which procedures (in or out of packages), triggers or functions insert to or update particular tables in Oracle 10.2.0.4.I've got a far as looking at user_dependencies, and have written the following sql based on that:

CODEselect o.name, decode(o.type#, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE', 7, 'PROCEDURE',
8, 'FUNCTION', 9, 'PACKAGE', 10, 'NON-EXISTENT',
11, 'PACKAGE BODY', 12, 'TRIGGER',
13, 'TYPE', 14, 'TYPE BODY', 22, 'LIBRARY',
[code]....

This isn't how I'd write the code for production, it's just research code at the moment.

This tells me most of what I need to know, but it doesn't allow me to remove those procedures etc that just select from the table I'm interested in. The vast majority of the dependencies are just selects. In a previous role I used SQL Server 2000 and I could get this information from sysdepends, filtering on the resultobj column to remove the select only dependencies - so I'll be a little surprised if Oracle doesn't have this facility.

View 1 Replies View Related

What Kind Of Index Would Improve Performance Of Queries

Jun 30, 2013

It seems certain queries search by the number of days to ship(number of days between the order and shipping dates). What kind of index would improve the performance of these queries?

View 2 Replies View Related

SQL & PL/SQL :: Triggers / Procedures / Functions Used As Prompts To Update And Modify Database

Apr 16, 2013

I have my database structured to where i have my tables, constraints, and Rows populated in each table which is 4 tables in particular. for one I want to be able to List all four tables with its content and constraints all at once. What i want to with the PL/SQL is to be able to program a prompt to where the user can just enter the individual order information and the data goes to what ever appropriate column or Table it needs to go to. Now should I be mostly be using procedures, functions or triggers to make this possible.

View 9 Replies View Related

Partitioning Table To Improve Load And Query Performance?

Nov 20, 2012

I have a big table in which we load about 37M recrods. We have informatica ETL which Loads the data in bulk Mode and creats index after completion. The data load takes about 1Hr and Index Creation takes about 1/2 hr. In total it takes about 90 to 95 Mnts.

Now I thought if Partition and Load paralley, It will improve perfromance. We did 4 partition and and each Partition about 9M records. The data load in Bulk mode is completing in 25 Mnts. Again When I am creating index over it, It is taking about 40 Mnts. and in Total Load time is 65 Mnts.

Is there way I can better performance to complete the load in 1/2 hr ?

View 2 Replies View Related

Performance Tuning :: Materialized View To Improve Search Queries?

Jan 31, 2012

In search queries generally we select 10-25 columns (more can't be displayed on the screen) from 5-10 tables

Say in case of insurance related application, the search might be on policy number, policy holder's first name, policy holder's last name, region, policy type etc.

And not to many columns we are displaying on the screen, say, 4 tables have collectively 4 * 20 = 80 columns, then we are displaying say 12-15 columns with 2-3 columns have aggregates on it.

since the search criteria (e.g. first name, last name, policy number etc.) is not known till last moment it will be a generic dynamic query

Is it possible that instead we create a Materialized view with query with only joining conditions but no filter conditions and selecting only columns to be displayed on the screen and then we will refresh the materialized view (to take care of recent business transactions) and fire refined query with filter criteria on this materialized view

Select col1,col2,col3,col4,col5
From tab1,tab2,tab3,tab4
Where tab1.col1=tab2.col1
And tab2.col2=tab3.col2
And tab2.col2=tab4.col2;

Will it improve performance of the search functionality

View 2 Replies View Related

Server Utilities :: Will Schema Export All Roles / Procedures / Packages / Synonyms / Functions And Triggers

Sep 21, 2010

i want to do a schema export from Database A. There are hundreds of users under this schema.I have to import this schema into other database say B. My question's are:

1) Do i need to pre-create only schema user or all the users under it.

2) Will the schema export all the roles,procedures,packages,synonyms,funsctions and triggers?

View 1 Replies View Related

SQL & PL/SQL :: IF ELSE ENDIF On Stored Procedures?

Apr 8, 2011

I come from a Microsoft SQL background and am having trouble adjusting to the PL/SQL syntax. I'd like to build this up to pass back a certain value back into a web form.

IF (SELECT COUNT(*) FROM EXCURSION WHERE EXCURSION_ID = 75)= 1 THEN
DBMS_OUTPUT.PUT_LINE 'True';
ELSE
DBMS_OUTPUT.PUT_LINE 'False';
END IF;

I'm having trouble writing values out at the moment

View 7 Replies View Related

Where Server Side Procedures Are Stored

Jun 2, 2009

Where are the server side procedures are stored? Where are the server side procedures are visible??

View 5 Replies View Related

Stored Procedures Using Oracle Tables

Jul 22, 2010

Let us say there is an oracle table A. How do i find out what stored procedures/packages/views are using this table A.

Reason to know: When some DDL changes happen on table A, how do i know what are the impacted sp/pkg/views which should also be modified. Is there any query with which i can find this?

View 5 Replies View Related

PL/SQL :: Trapping Errors In Stored Procedures?

Feb 27, 2013

I have to run queries on a gov't computer. There are errors in some of the stored procedures that will NEVER go away. Fact of life, and I have to live with it (I'm just a data analyst--not the developer of the procedures)So I do this, in the hope of trapping the error

BEGIN
run_stored_proc (my_cursor, my_id, param3);
EXCEPTION
WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE ('ERROR IN ID (' || my_id || '). The error was ' || SQLCODE || ' -ERROR- ' ||SQLERRM);
END;Well, it can still crash.
SQL> @c:mysql
un_test
ERROR IN ID (2692). The error was -20100 -ERROR- ORA-20100: Exception occurred in some_other_stored_procedure

ORA-01422: exact fetch returns more than requested number of rowsSo it looks like run_stored_proc calls some_other_stored_procedure which is having issues. I was hoping that by trying to capture the error in the top level procedure, it would also capture the error in a lower-level "sub-procedure". This is the way a TRY-CATCH in java works. If an error happens anywhere along the way inside the TRY-CATCH, it is caught. Sure, PL/SQL ins't java, but is there a way for me to catch a lower level error and not have this code crash?

Fortunately for me, it actually doesn't crash that often. But I have to put this code in a loop, and run it for many different my_id's. And when it does crash, it isn't significant from a data analysis standpoint. I can't do without a small percentage of the data. But I'd love to be able to just run my script and not have to watch it for unexpected crashes.

View 11 Replies View Related

PL/SQL :: Java Stored Procedures And Triggers

Oct 31, 2012

I want to to use Java stored procedures and triggers within the Oracle 11g XE ?

View 3 Replies View Related

SQL & PL/SQL :: Bind Variables / Developing Stored Procedures In Developer

May 16, 2010

Am using Oracle 9i and developing stored procedures in SQL Developer. Have a situation where one stored procedure A is calling another B. Stored proc B builds the SQL based on parameters passed in. For one of the parameters i would like to use a bind variable in the SQL that proc B builds. The bind var is passed back to proc A as a part of the SQL string. In proc A, i then try to bind that variable to a parameter(value), however, the bind does not seeem to work.

The SQL string contained in v_SQLStatement defined as VARCHAR(4000) that is passed back to proc A looks like:

SELECT em.event_title AS event_name,
e.start_date AS start_date,
e.end_date AS end_date
FROM d_event_ml em
inner join d_event e
ON em.event_id = e.event_id
WHERE em.language_id = 46
AND e.end_date >= SYSDATE
AND e.stream_id IN ( :v_x1 )
AND e.event_id IN (SELECT event_id
FROM d_events_seas
[code]....

and o_EventList is defined as REF CURSOR. i'm experiencing is that :v_x1 stays as :v_x1 and does not change.This is my first attempt at using bind vars. URL....

View 7 Replies View Related

Client Tools :: How To Convert SQL Server Stored Procedures

Sep 3, 2013

In SQL server 30 stored procedures are there how to convert all the stored procedure from SQL server to Oracle 11g..

View 5 Replies View Related

SQL & PL/SQL :: Pass Table As Input Parameter In Stored Procedures?

Feb 22, 2011

i need to pass table as input parameter in stored procedures. during the run time, i am getting error

CREATE OR replace TYPE emp_type IS OBJECT (
id NUMBER(4),
ename VARCHAR2(10));
CREATE OR replace TYPE emp_type_tab
IS TABLE OF EMP_TYPE;
CREATE OR replace PROCEDURE Test_proc (in_emp_type IN EMP_TYPE_TAB)
AS
BEGIN
FOR i IN 1.. in_emp_type.COUNT LOOP
dbms_output.Put_line(in_emp_type.Id(i));
END LOOP;
END;
/

View 10 Replies View Related

Advantages / Differences Of Methods Defined Types Over Stored Procedures

Aug 31, 2011

We are trying to use the methods/constructors in the object types and find it more similar to the procedures and functions in the packages. I am wondering how they are different from stored procs and functions and what are the advantages?

View 2 Replies View Related

.NET Stored Procedures :: How To Send Execute String To Oracle Database

Oct 31, 2013

I would like to send a raw command to the Oracle server. from .NET (System.Data.OracleClien), but I got invalid statement (ORA-00900) exception

.Excecute string:string SQL = "EXECUTE SP_THREADFILE_INSERT('" + Guid.NewGuid() + "','" + filename + "',utl_raw.cast_to_raw('" + content + "'))";

View 0 Replies View Related

SQL & PL/SQL :: Stored Procedure With Multiple Table Join With Aggregate Functions

Jun 15, 2013

I have 2 tables order_items and items.

Order_items Items
Item_id Item_id
Quantity Price

In normal sql statement: select sum(order_items.quantity*items.price) sales_price
from order_items,items
where order.item_id=items.item_id;

I have to put this logic in either a stored procedure or Function just to calculate sum(order_items.quantity*items.price) and store the aggregated value as Sales_price in DB. Then we have to call this from Informatica Stored procedure Transformation where we will have only one output port as Sales_price,this is to load into summary table. All the aggregate calculations and joining of 2 tables should be done on DB side and only one output should be populated when we execute this procedure.

View 2 Replies View Related

Reports & Discoverer :: Calling Reports From Stored Procedures?

Feb 23, 2011

Is there a way to call an oracle report (version 9i) from a stored procedure?

View 2 Replies View Related

Performance Tuning :: Calling Stored Procedure In Jsp Page

Feb 16, 2011

We are calling a stored procedure in jsp page. The sql where bottleneck was assumed is giving better performance in sql plus (0.093 seconds) but when called from jsp its taking too much time.

Here is the plan for the sql

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 219 |
| 1 | SORT GROUP BY | | 1 | 219 |
| 2 | NESTED LOOPS | | 1 | 219 |
| 3 | NESTED LOOPS | | 1 | 197 |
| 4 | NESTED LOOPS | | 1 | 162 |
| 5 | MERGE JOIN | | 1 | 127 |
| 6 | TABLE ACCESS BY INDEX ROWID | policy_tbl | 1 | 78 |
| 7 | INDEX FULL SCAN | pk_pol_id | 1 | |
| 8 | SORT JOIN | | 1585 | 77665 |
| 9 | TABLE ACCESS BY INDEX ROWID| policy_p_tbl | 1585 | 77665 |
| 10 | INDEX RANGE SCAN | pp_param_1 | 1679 | |
| 11 | TABLE ACCESS BY INDEX ROWID | policy_group_tbl | 1 | 35 |
| 12 | INDEX RANGE SCAN | pg_indx_2 | 1 | |
| 13 | TABLE ACCESS BY INDEX ROWID | policy_group_tbl | 1 | 35 |
| 14 | INDEX RANGE SCAN | pg_indx_2 | 1 | |
| 15 | TABLE ACCESS BY INDEX ROWID | policy_dtl_tbl | 1 | 22 |

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
| 16 | INDEX UNIQUE SCAN | pk_pg | 1 | |
--------------------------------------------------------------------------------

View 2 Replies View Related

SQL & PL/SQL :: Improve Query So That UNION Can Be Removed

Mar 6, 2012

select
a.empno,a.ename,a.job,
B.DNAME
from scott.emp a,scott.dept b
where ( a.ename like 'S%' and a.deptno=b.deptno)
union
select
a.empno,a.ename,a.job,
'aaa' AS DNAME
from scott.emp a,scott.dept b
where ( a.ename like 'S%' and a.job not like 'SALES%');

Output:

7369SMITHCLERKRESEARCH
7369SMITHCLERKaaa
7788SCOTTANALYSTRESEARCH
7788SCOTTANALYSTaaa

Quote:There is other way to improve the query so that UNION can be removed.

View 3 Replies View Related

SQL & PL/SQL :: Improve Procedure Which Is Looping Through Query To Make Inserts

Oct 10, 2013

I am trying to improve a procedure which is looping through a query to make inserts.

FOR P IN (
SELECT O.TYPEID
,o.KEY
,O.ID
,O.NAME
,O.LGNUM
,O.LGNAME
[code]....

View 12 Replies View Related

PL/SQL :: How To Improve DELETE Statement That Remove Millions Of Rows

Jun 18, 2012

The following query take lot of time when exectued, even after I drop the indexes, is there a better way to write the following query?

DELETE from pwr_part
where ft_src_ref_id in (select ft_src_ref_id
from pwr_purge_ft);

--Table:pwr_part
--UIP10371 foreign key (FT_SRC_REF_ID, FT_DTL_SEQ)

[Code]...

Explain Plan:

Description Object owner Object name Cost Cardinality Bytes
SELECT STATEMENT, GOAL = ALL_ROWS 224993 5492829 395483688
HASH JOIN RIGHT SEMI 224993 5492829 395483688
INDEX FAST FULL SCAN PWR_OWNER PWR_PURGE_FT_PK 43102 23803770 142822620
PARTITION HASH ALL 60942 27156200 1792309200
TABLE ACCESS FULL PWR_OWNER PWR_PART 60942 27156200 1792309200

View 6 Replies View Related

How To Use Member Procedures

Dec 13, 2009

create type employee is object(
name varchar2(30),
member procedure change_name(new_name varchar2)
)

[Code]....

Now how to use the change_name procedure to change the name of the employees in the table?

View 1 Replies View Related

PL/SQL :: Drop All Procedures At One Go?

Aug 29, 2012

I have a schema sys_eg .I dont have any DBA privileges .How can i delete all the procedure with one sql or pl/sql.

ORACLE 11G
I am using sql developer 3.2 version tool

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved