首先查看需要修改的表的主键名 select *from user_cons_columns where table_name = '表名'; (表名要大写否则查不出来) 删除主键约束 alter table 表名 drop constraint 主键名;(通过上一步查找出来的) 添加主键约束 alter table 表名 add constraint 主键名 primary key(字段名) ; 主键名命名规则建议为pk_表名