create table p_key(sr_no int,name varchar2(50),primary key(sr_no));
select * from p_key;
insert into p_key values(1,'A');
insert into p_key values(2,'B');
alter table p_key add city varchar(22);
alter table p_key drop column city;
Error starting at line : 272 in command -
alter table p_key drop column city
Error report -
ORA-12988: cannot drop column from table owned by SYS
12988. 00000 - "cannot drop column from table owned by SYS"
*Cause: An attempt was made to drop a column from a system table.
*Action: This action is not allowed
它在MySQL中工作,但我想在Oracle SQL中尝试。
1条答案
按热度按时间ppcbkaq51#
切勿在
SYS
或SYSTEM
用户中创建表。如果您修改系统表,则可能会导致数据库无法使用。始终创建新用户并在其模式中工作。
错误消息告诉你问题所在:
如果您不是以系统用户的身份工作,则查询有效,因此不要使用系统用户。
fiddle