473,383 Members | 1,837 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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_contentprovider( v_userid IN varchar,
v_contentproviderid IN varchar,
v_account_number 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):=null;
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_contentproviderid, 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_contentproviderid
and account_number = v_account_number;

/* 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,biller_login_id,account_number,email,
first_name,last_name,phone,address_line_1,
address_line_2,city,zip_code,country, status,
customer_biller_login_id, activation_date,
request_date, confirm_date, CREATOR, MODIFIER,
PASSPHRASE)
values(v_userid,v_contentproviderid,v_account_numb er,
v_email,v_firstname,v_lastname,v_phonenumber,
v_address_line1,v_address_line2,v_city,v_postalcod e,v_country,
'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 5842
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_updatestatus := null)

"Noddy" <ro**@bbs.no> wrote in message
news:a6**************************@posting.google.c om...
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_contentprovider( v_userid IN varchar,
v_contentproviderid IN varchar,
v_account_number 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):=null;
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_contentproviderid, 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_contentproviderid
and account_number = v_account_number;

/* 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,biller_login_id,account_number,email,
first_name,last_name,phone,address_line_1,
address_line_2,city,zip_code,country, status,
customer_biller_login_id, activation_date,
request_date, confirm_date, CREATOR, MODIFIER,
PASSPHRASE)
values(v_userid,v_contentproviderid,v_account_numb er,
v_email,v_firstname,v_lastname,v_phonenumber,
v_address_line1,v_address_line2,v_city,v_postalcod e,v_country,
'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.google. 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_contentprovider( v_userid IN varchar,
v_contentproviderid IN varchar,
v_account_number 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):=null;
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_contentproviderid, 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_contentproviderid
and account_number = v_account_number;

/* 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,biller_login_id,account_number,email,
first_name,last_name,phone,address_line_1,
address_line_2,city,zip_code,country, status,
customer_biller_login_id, activation_date,
request_date, confirm_date, CREATOR, MODIFIER,
PASSPHRASE)
values(v_userid,v_contentproviderid,v_account_numb er,
v_email,v_firstname,v_lastname,v_phonenumber,
v_address_line1,v_address_line2,v_city,v_postalcod e,v_country,
'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.google. 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.com 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
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...
1
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...
125
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...
133
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...
1
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...
4
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
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...
1
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...
3
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.