Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: DDL & long-running query
tim.kearsley_at_milton-keynes.gov.uk wrote:
> I don't believe this is correct. The OP mentioned a long-running
> QUERY. Surely a query holds no locks and the ALTER TABLE command would
> therefore complete without any problem?
>
> Tim Kearsley
> HBS Milton Keynes
>
> DA Morgan wrote:
>
>>John wrote: >> >> >>>Hi all, >>> >>>I am not sure how to answer this question: >>>"What happens if you run a DDL, say alter table, on a table
>>>being accessed by a long-running query?" >>> >>>Would the query fail? >>> >>> >>>John >> >>The ALTER TABLE hangs until it can obtain the required lock. >>-- >>Daniel A. Morgan >>University of Washington >>damorgan_at_x.washington.edu >>(replace 'x' with 'u' to respond)
Please do not top post
Consider the following:
CREATE TABLE t (
colone VARCHAR2(10),
coltwo VARCHAR2(10));
INSERT 100,000,000 rows.
In session 1:
SELECT *
FROM t;
In session 2:
ALTER TABLE t
DROP COLUMN coltwo;
Do you think the column will be dropped before the SELECT completes?
Check this out too:
http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10743/consist.htm#sthref2106
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Wed May 11 2005 - 10:05:55 CDT