473,473 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help: Problems with ALTER TABLE

Hello,

I have two problems with the ALTER TABLE command (Warning: I'm not
exactly an Oracle expert):

First Problem:

I want to change the name of a column. I've tried the following:
ALTER TABLE <table_name> RENAME COLUMN <old_column_name> TO
<new_column_name>;
The error I get is "ORA-14155: Keyword PARTITION or SUBPARTITION is
missing." (That's translated from german, so the text probably isn't
perfectly accurate).
I have no idea what that means.

Second Problem:

I want to (re)enable a foreign key constraint. My try:
ALTER TABLE <tablename> ENABLE CONSTRAINT <constraint_name>;
Error: "ORA-00054: Tried to access an occupied resource with NOWAIT."
(same as above).
I've also tried locking the table but I get the same error then.

My Oracle Version is 8.1.7, I'm on a Win2000 client, the server is
some fat HPUX box (also running 8.1.7).

Any help is appreciated. Thanks in advance and best regards,

Max
Jul 19 '05 #1
8 41658
Hi,
the problem I am facing is a little different:

Session A is doing updates on the table.
In Session B (AUTOCOMMIT OFF) I issue the following commands:
1) lock table t in exclusive mode;
2) alter table t add (xxx number(10,0));

Result:
After (1) the updates off session A come to a halt. (Obviously fine)
After (2) I get ORA-00054.

Any explanations?

Thanks.
Steffen
Jul 19 '05 #2

"Steffen Krippner" <st*************@yahoo.com> wrote in message
news:8a**************************@posting.google.c om...
Hi,
the problem I am facing is a little different:

Session A is doing updates on the table.
In Session B (AUTOCOMMIT OFF) I issue the following commands:
1) lock table t in exclusive mode;
2) alter table t add (xxx number(10,0));

Result:
After (1) the updates off session A come to a halt. (Obviously fine)
After (2) I get ORA-00054.


Not having memorised every oracle error code. remind me what error 54 is
please.
Jul 19 '05 #3
Hi,
here we comes the Oracle description for this error code:

ORA-00054 resource busy and acquire with NOWAIT specified

Cause: The NOWAIT keyword forced a return to the command prompt
because a resource was unavailable for a LOCK TABLE or SELECT FOR
UPDATE command.

Action: Try the command after a few minutes or enter the command
without the NOWAIT keyword.

Thank you,
Steffen
Jul 19 '05 #4
Hi,
thanks for helping- but I still do not get it. I do the "lock table"
in the first session. After that the updates in the second session
stop. That is fine since the first session got the table lock. When I
do the "Alter Table" in the first session it fails with the 00054
error "resource busy". Shouldn't this succeed since I hold the table
lock already in this session?

Thanks,
Steffen
Jul 19 '05 #5
st*************@yahoo.com (Steffen Krippner) wrote in message news:<8a**************************@posting.google. com>...
Hi,
thanks for helping- but I still do not get it. I do the "lock table"
in the first session. After that the updates in the second session
stop. That is fine since the first session got the table lock. When I
do the "Alter Table" in the first session it fails with the 00054
error "resource busy". Shouldn't this succeed since I hold the table
lock already in this session?

Thanks,
Steffen


No
The situation you have is that your affected table is already in use
prior to your ALTER TABLE command. Hence the *table definition* is
locked, and you won't be capable to get another lock. You need to make
sure no one has the table in use. The V$ACCESS view shows which
sessions are using it.

Sybrand Bakker
Senior Oracle DBA
Jul 19 '05 #6
Thanks.
I am still wondering that Oracle forces everybody to stop using a
table before some "schema evolution" is possible.
Is there any other way to do the "Alter Table" perhaps by specifying
the command should wait for the lock instead of aborting with
ORA-00054???
Jul 19 '05 #7
poupe
1 New Member
Hello,

I have two problems with the ALTER TABLE command (Warning: I'm not
exactly an Oracle expert):

First Problem:

I want to change the name of a column. I've tried the following:
ALTER TABLE <table_name> RENAME COLUMN <old_column_name> TO
<new_column_name>;
The error I get is "ORA-14155: Keyword PARTITION or SUBPARTITION is
missing." (That's translated from german, so the text probably isn't
perfectly accurate).
I have no idea what that means.

Second Problem:

I want to (re)enable a foreign key constraint. My try:
ALTER TABLE <tablename> ENABLE CONSTRAINT <constraint_name>;
Error: "ORA-00054: Tried to access an occupied resource with NOWAIT."
(same as above).
I've also tried locking the table but I get the same error then.

My Oracle Version is 8.1.7, I'm on a Win2000 client, the server is
some fat HPUX box (also running 8.1.7).

Any help is appreciated. Thanks in advance and best regards,

Max
Here is your answer:
As refered to Oracle products.
You must have at least Oracle 9i Release 2
that can solve your problems.

From Lao PDR.
Sep 5 '05 #8
richasaraf
23 New Member
Hi,
thanks for helping- but I still do not get it. I do the "lock table"
in the first session. After that the updates in the second session
stop. That is fine since the first session got the table lock. When I
do the "Alter Table" in the first session it fails with the 00054
error "resource busy". Shouldn't this succeed since I hold the table
lock already in this session?

Thanks,
Steffen

------
[FONT=Palatino Linotype][COLOR=Red]hey... even i use to face this problem.....
this error occurs when from apps u are inserting or transacting with one table and while that is going on you acces that table from back end maybe from SQL Navigator or so...
the solution to this is .... which i did... i asked my DBA to unlock the table or kill the session of apps and the error goes away...... :)

and it really helped me......
and for the ALTER TABLE .... got o following link... this helped me when i was learning.....

http://www.techonthenet.com/sql/tables/alter_table.php

This site gives you the basic syntax of ALTER TABLE ... and has many more... so you can really learn a lot !


Thanks a lot ! :)
Richa[/COLOR][/FONT]
Sep 5 '05 #9

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

Similar topics

2
by: Dylan Nicholson | last post by:
Seems that Oracle 9.2 (using MS ODBC driver) requires extra parentheses when adding multiple columns to a table: ALTER TABLE MyTable ADD (MyColumn1 VARCHAR(255), MyColumn2 VARCHAR(255)) vs ...
6
by: Matt Creely | last post by:
I have a very strange database with a very strange problem. Consider 4 tables: Table1: ---------------- Table1ID INT PK Table2ID INT FK Table3ID INT FK OrderNo VARCHAR(50)
0
by: Krist | last post by:
Hi All, I have a database design question, pls give me some help.. I want to define tables for salesman's sales target commission . The commission could be given per EITHER sales amount of :...
1
by: Krist | last post by:
Hi All, There is some additional info I forget on this same topic I just posted. I have a database design question, pls give me some help.. I want to define tables for salesman's sales target...
3
by: Pir | last post by:
I have a created a table 'data' with two columns: id, name. +-------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra |...
7
by: teddysnips | last post by:
Table DDL below: The tables I have contain Timesheet information. Each row in the tblTSCollected table contains an entry for an employee into the timesheet system, specifically by scanning the...
1
by: vasilip | last post by:
I'm testing out db2 for a project I'm starting that requires proper xml support and I can't seem to get both xml and spatial data to work well in the same table. Once having created a table...
5
by: Giacomo | last post by:
Hi, I’ve the following error message: --------------- ALTER TABLE . ALTER COLUMN varchar(10) Go Server: messaggio 4929, livello 16, stato 1, riga 1
4
by: Maximilian Scherf | last post by:
Hello, I have two problems with the ALTER TABLE command (Warning: I'm not exactly an Oracle expert): First Problem: I want to change the name of a column. I've tried the following: ALTER...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.