Home  >  Article  >  Database  >  ORA-12986错误解决

ORA-12986错误解决

WBOY
WBOYOriginal
2016-06-07 17:33:562268browse

今天在删除一个大表的列,意外被DBA重启DB后,再执行查询时,就报了ORA-12986这个错误,先来一起了解下这个错误:ORA-12986: col

今天在删除一个大表的列,意外被DBA重启DB后,再执行查询时,就报了ORA-12986这个错误,先来一起了解下这个错误:

ORA-12986: columns in partially dropped state. Submit ALTER TABLE DROP COLUMNS CONTINUE

Cause: An attempt was made to access a table with columns in partially dropped state (i.e., drop column operation was interrupted).

Action: Submit ALTER TABLE DROP COLUMNS CONTINUE to complete the drop column operation before accessing the table.

可以看到导致这个错误的原因是因为你正在删除列,但是删除到一半时,,进程被意外终止了,导致表处在部分删除状态,所以报了咋么个错误,你要做的就是继续删除,看下下面的例子:

1.将列置为unused

ALTER TABLE test1 SET UNUSED COLUMN Tablespace_name;

2.删除unused列

ALTER TABLE test1 DROP UNUSED COLUMN CHECKPOINT 5;

在未执行完毕前,用 shutdown abort强制关闭数据库(如果用shutdown immediate就看不到效果,它会等到执行完毕才会关闭数据库)

3.重新启动数据库,查看test1表,报错

ORA-12986错误解决

4.继续删除未删完的列

ALTER TABLE test1 DROP COLUMNS continue

5.执行完毕后再次查询test1表,就OK了

相关阅读:

ORA-01172、ORA-01151错误处理

ORA-00600 [2662]错误解决

ORA-01078 和 LRM-00109 报错解决方法

ORA-00471 处理方法笔记

ORA-00314,redolog 损坏,或丢失处理方法

ORA-00257 归档日志过大导致无法存储的解决办法

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn