473,722 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Oracle locking up..?

We have an application that updates a row in a table. Sometimes Oracle
does not respond for over 10 seconds. This is after an insert. It
seems that there is a lock somewhere. This is a multi user system.
Records can be added 3+ pr. second.

We have a procedure stored that does the actuall insert. Documented
below. As you can see the insert is pretty straight forward. (look at
the last section in the procedure).

What can cause this situation in Oracle;

* Table lock... ? How does Oracle lock tables when updating.
* ..

Do Oralce log whether or not a table has been locked and for how long
?

Thanx. Noddy

---------------
procedure add_user_conten tprovider( v_userid IN varchar,
v_contentprovid erid IN varchar,
v_account_numbe r IN varchar, v_email IN
varchar, v_firstname IN varchar, v_lastname IN
archar,
v_address_line1 IN varchar,
v_address_line2 IN varchar, v_city IN varchar,
v_postalcode IN varchar, v_country IN varchar,
v_phonenumber IN varchar, v_modifier
IN varchar, v_updatestatus OUT varchar)
is
t_status varchar(10):=nu ll;
t_login varchar(255) := null;
begin
/* is the user deleted */
deleted_user(v_ userid,t_status );
if t_status is not null then
v_updatestatus := t_status;
return;
end if;

provider_exists (v_contentprovi derid, t_status);
if t_status is not null then
v_updatestatus := t_status;
return;
end if;

select login_id into t_login
from customer_biller
where biller_login_id = v_contentprovid erid
and account_number = v_account_numbe r;

/* if t_login is not null the agreement exists */
if t_login is not null then
v_updatestatus := '23005';
return;
end if;

/* if not data found the agreement doesn't exist */
exception when no_data_found then
v_updatestatus := null;

/* everything is ok, insert the agreement */
insert into customer_biller
(login_id,bille r_login_id,acco unt_number,emai l,
first_name,last _name,phone,add ress_line_1,
address_line_2, city,zip_code,c ountry, status,
customer_biller _login_id, activation_date ,
request_date, confirm_date, CREATOR, MODIFIER,
PASSPHRASE)
values(v_userid ,v_contentprovi derid,v_account _number,
v_email,v_first name,v_lastname ,v_phonenumber,
v_address_line1 ,v_address_line 2,v_city,v_post alcode,v_countr y,
'PENDING', v_userid, DATE '1900-01-01',
DATE '1900-01-01', DATE '1900-01-01', v_modifier, v_modifier,
'PASSPHRASE');

end;

end;
Jul 19 '05 #1
3 5865
Oracle Locking up is somewhat vague. I assume you mean someone is issuing
sql and it takes forever to return.

You or your DBA should check the data dictionary for locks in tables like
DBA_LOCKS, DBA_BLOCKERS, DBA_WAITERS, DBA_DML_LOCKS. If you search the web
you could probably find some scripts to run in cron to use this information
to identify problems. Also you can use statspack or oracle OEM if you have
it installed to see the problems. But that is a whole new area of
discussion.

Also, it looks like your Code has hard coded literal values in it, which can
slow execution. Oracle likes bind variables to speed parsing. I think
these may give a problem, not sure about the exception though
(v_updatestatus := '23005')(v_upda testatus := null)

"Noddy" <ro**@bbs.no> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
We have an application that updates a row in a table. Sometimes Oracle
does not respond for over 10 seconds. This is after an insert. It
seems that there is a lock somewhere. This is a multi user system.
Records can be added 3+ pr. second.

We have a procedure stored that does the actuall insert. Documented
below. As you can see the insert is pretty straight forward. (look at
the last section in the procedure).

What can cause this situation in Oracle;

* Table lock... ? How does Oracle lock tables when updating.
* ..

Do Oralce log whether or not a table has been locked and for how long
?

Thanx. Noddy

---------------
procedure add_user_conten tprovider( v_userid IN varchar,
v_contentprovid erid IN varchar,
v_account_numbe r IN varchar, v_email IN
varchar, v_firstname IN varchar, v_lastname IN
archar,
v_address_line1 IN varchar,
v_address_line2 IN varchar, v_city IN varchar,
v_postalcode IN varchar, v_country IN varchar,
v_phonenumber IN varchar, v_modifier
IN varchar, v_updatestatus OUT varchar)
is
t_status varchar(10):=nu ll;
t_login varchar(255) := null;
begin
/* is the user deleted */
deleted_user(v_ userid,t_status );
if t_status is not null then
v_updatestatus := t_status;
return;
end if;

provider_exists (v_contentprovi derid, t_status);
if t_status is not null then
v_updatestatus := t_status;
return;
end if;

select login_id into t_login
from customer_biller
where biller_login_id = v_contentprovid erid
and account_number = v_account_numbe r;

/* if t_login is not null the agreement exists */
if t_login is not null then
v_updatestatus := '23005';
return;
end if;

/* if not data found the agreement doesn't exist */
exception when no_data_found then
v_updatestatus := null;

/* everything is ok, insert the agreement */
insert into customer_biller
(login_id,bille r_login_id,acco unt_number,emai l,
first_name,last _name,phone,add ress_line_1,
address_line_2, city,zip_code,c ountry, status,
customer_biller _login_id, activation_date ,
request_date, confirm_date, CREATOR, MODIFIER,
PASSPHRASE)
values(v_userid ,v_contentprovi derid,v_account _number,
v_email,v_first name,v_lastname ,v_phonenumber,
v_address_line1 ,v_address_line 2,v_city,v_post alcode,v_countr y,
'PENDING', v_userid, DATE '1900-01-01',
DATE '1900-01-01', DATE '1900-01-01', v_modifier, v_modifier,
'PASSPHRASE');

end;

end;

Jul 19 '05 #2
ro**@bbs.no (Noddy) wrote in message news:<a6******* *************** ****@posting.go ogle.com>...
We have an application that updates a row in a table. Sometimes Oracle
does not respond for over 10 seconds. This is after an insert. It
seems that there is a lock somewhere. This is a multi user system.
Records can be added 3+ pr. second.

We have a procedure stored that does the actuall insert. Documented
below. As you can see the insert is pretty straight forward. (look at
the last section in the procedure).

What can cause this situation in Oracle;

* Table lock... ? How does Oracle lock tables when updating.
* ..

Do Oralce log whether or not a table has been locked and for how long
?

Thanx. Noddy

---------------
procedure add_user_conten tprovider( v_userid IN varchar,
v_contentprovid erid IN varchar,
v_account_numbe r IN varchar, v_email IN
varchar, v_firstname IN varchar, v_lastname IN
archar,
v_address_line1 IN varchar,
v_address_line2 IN varchar, v_city IN varchar,
v_postalcode IN varchar, v_country IN varchar,
v_phonenumber IN varchar, v_modifier
IN varchar, v_updatestatus OUT varchar)
is
t_status varchar(10):=nu ll;
t_login varchar(255) := null;
begin
/* is the user deleted */
deleted_user(v_ userid,t_status );
if t_status is not null then
v_updatestatus := t_status;
return;
end if;

provider_exists (v_contentprovi derid, t_status);
if t_status is not null then
v_updatestatus := t_status;
return;
end if;

select login_id into t_login
from customer_biller
where biller_login_id = v_contentprovid erid
and account_number = v_account_numbe r;

/* if t_login is not null the agreement exists */
if t_login is not null then
v_updatestatus := '23005';
return;
end if;

/* if not data found the agreement doesn't exist */
exception when no_data_found then
v_updatestatus := null;

/* everything is ok, insert the agreement */
insert into customer_biller
(login_id,bille r_login_id,acco unt_number,emai l,
first_name,last _name,phone,add ress_line_1,
address_line_2, city,zip_code,c ountry, status,
customer_biller _login_id, activation_date ,
request_date, confirm_date, CREATOR, MODIFIER,
PASSPHRASE)
values(v_userid ,v_contentprovi derid,v_account _number,
v_email,v_first name,v_lastname ,v_phonenumber,
v_address_line1 ,v_address_line 2,v_city,v_post alcode,v_countr y,
'PENDING', v_userid, DATE '1900-01-01',
DATE '1900-01-01', DATE '1900-01-01', v_modifier, v_modifier,
'PASSPHRASE');

end;

end;


I suggest you run an SQL trace on the task and look to see how the one
select is being done and what Oracle says about the insert
performance. The problem could be in the deleted_user or
provider_exists procedures.

For the select I would expect that the account_number is the PK. But
if it is not and both it and biller_login_id are separately indexed
then Oracle could be choosing the wrong index. A trace would identify
this.

Good luck -- Mark D Powell --
Jul 19 '05 #3
ro**@bbs.no (Noddy) wrote in message news:<a6******* *************** ****@posting.go ogle.com>...
We have an application that updates a row in a table. Sometimes Oracle
does not respond for over 10 seconds. This is after an insert. It
seems that there is a lock somewhere. This is a multi user system.
Records can be added 3+ pr. second.

We have a procedure stored that does the actuall insert. Documented
below. As you can see the insert is pretty straight forward. (look at
the last section in the procedure).

What can cause this situation in Oracle;

* Table lock... ? How does Oracle lock tables when updating.


There is a document in your doc set or you can find at
tahiti.oracle.c om called the Applications Developers Guide
Fundamentals. Free registration required at otn.oracle.com.

http://download-west.oracle.com/docs...08sql.htm#2477

This is a decremented group, see
http://members.cox.net/oracleunix/readme-cdos.htm

jg
--
@home.com is bogus.
http://www.firstgov.gov/fgsearch/res...p/everhart.pdf
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
40262
by: francis70 | last post by:
Hi, I have these 2 problem? Is there a way in Oracle to read UNCOMMITED data. i.e. in Oracle the normal behaviour is that a user's updates to a table are visible to other users ONLY when the user commits. But in Informix there is this thing called ISOLATION LEVELS. For example by setting the ISOLATION LEVEL to DIRTY READ, a user will read dirty data, i.e. the last uncommited updated value of a field by some other user. Is
1
4037
by: Ton | last post by:
I have a question about connectivity between different databases. Oracle, DB2400 and SQL_server. It is easy to integrate application products that are running on different DB platforms? What products can be used to achieve this? Our consultant is mentioning .NET but then we have to run everything on SQL server. Currently we are running on Oracle but our third party generic applications are first developed for SQL server and later...
125
15473
by: Rhino | last post by:
One of my friends, Scott, is a consultant who doesn't currently have newsgroup access so I am asking these questions for him. I'll be telling him how to monitor the answers via Google Newsgroup searches. Scott has heard a lot of hype about DB2 and Oracle and is trying to understand the pros and cons of each product. I'm quite familiar with DB2 but have never used Oracle so I can't make any meaningful comparisons for him. He does not have...
133
9076
by: jonathan | last post by:
hey all, I realize that this question might pop up from time to time, but I haven't seen it a while and things might of changed, so - Right now (July 2004) how does mysql stand up in comparison to oracle? We are seriously considering migrating our multi-processor oracle system to mysql to save on licensing costs, and would need several features that mysql may or may not have:
1
5969
by: Jeff Roughgarden | last post by:
I was at a conference and had it asserted to me by an Oracle afficiando that Oracle and DB2 handled low-level locks "better" than SQL Server, and that this was likely the cause of SQL Server's relatively slower and more deadlock-prone performance when running the same application. (SQL does seem to perform more poorly for this app, a PeopleSoft customer service and billing app.) Is there any significant difference in lock escalation...
4
2006
by: golu | last post by:
Has any body done the porting from oracle to sql server, what were the issues in porting the data bases? Also suggest some resources which can be helpful in the porting project TIA Golu
11
10752
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept should be the same that the stored procedures execute in the database server with better performance? Please advise good references for Oracle stored procedures also. thanks!!
1
7159
by: Jawahar | last post by:
All, I have a C# application with an Oracle backend. There is a fair amount of locking being used to prevent two users from update the same records. So we use the Oracle FOR UPDATE NOWAIT in our SQL calls. This works fine and the second user is not allowed to access the same record as the first user. Currently we are using a try catch block to catch the Oracle exception ORA-0054. Then we exit the subroutine. I am trying to look for a...
3
198
by: Noddy | last post by:
We have an application that updates a row in a table. Sometimes Oracle does not respond for over 10 seconds. This is after an insert. It seems that there is a lock somewhere. This is a multi user system. Records can be added 3+ pr. second. We have a procedure stored that does the actuall insert. Documented below. As you can see the insert is pretty straight forward. (look at the last section in the procedure). What can cause this...
0
9386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9158
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8059
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5996
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4764
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3208
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.