惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
H
Heimdal Security Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
月光博客
月光博客
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
T
Troy Hunt's Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
D
DataBreaches.Net
O
OpenAI News
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
小众软件
小众软件
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
美团技术团队
P
Privacy International News Feed

博客园 - 知道得越多知道的越少

window10上登录Oracle时提示ORA-12546:Permission denied 大表的主键创建优化技术(转一篇有深度的文章) Oracle并行执行特性应用初探 解决Rhel5上安装VMWare tools的问题 Oracle 性能诊断艺术 第四章 笔记 Oracle国外站点汇集 在客户端通过外部表访问Trace文件的内容 查出全表扫描的相关SQL语句 SQL条件的顺序对性能的影响 用SQL语句求排除断号的号码串 易用性规范 64位Oracle数据库环境下安装使用32位的PLSQL-Developer 使用Pivot进行行列转换不能合并为一行的问题 删除Oracle程序,重装后遇到的两个小问题 闪回查询,9i,10G到11G的不断增强 归档日志充满的问题解决 ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务 问题解决 生成SQL记录集的一些数据 如何取出某一用户的密码,再原封不动的改回去?
导入的数据,删除约束后没有自动删除对应索引,重建约束出错
知道得越多知道的越少 · 2007-06-14 · via 博客园 - 知道得越多知道的越少

查了资料,有两种情况,一种Oracle 10G的一个BUG:3894962,但一直没有发布补丁。

Note:292096.1,Note:370633.1这两篇文章有介绍,当导出导入表的时候,如果有主键约束及索引,索引导入的时候没有和主键约束建立依赖,所以删除约束时,索引没有被删除。

另一种情况是Oracle 10G的一项改变,Note:309821.1

提供的解决办法就是加上删除索引的语法:alter table < table > drop constraint < constraint > drop index;
注意:
Drop index的语法是9i才支持的。

Subject: Oracle 10G Does not Drop User Index Associated With Unique/Primary Key Constraints
  Doc ID: Note:309821.1 Type: PROBLEM
  Last Revision Date: 31-MAY-2005 Status: MODERATED

<script language="JavaScript"></script>

The information in this document applies to:

Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 10.2.0.0
This problem can occur on any platform.

Symptoms

Drop constraint does not drop a associated index in 10G

Cause


In 10g, a change was made to an internal function "atbdui" to not to drop the user index when the constraint using the index is dropped.

In 9i, this behavior is different the user index
gets dropped when the constraint is dropped.

Select index_name,generated from dba_indexes where index_name='< ;index_name >';

Generated column would show 'Y' If the index is system generated.If 'N' ,it is user generated.

Solution


This behaviour is because of the code changes made in 10G.

Use the workaround:

alter table < table > drop constraint < constraint > drop index;

Note

If the index is non unique, we can still use them for enforcing primary key constraints or unique constraints.

But dropping the constraint does not drop the non-unique index.
This behaviour is seen from 8174 to 10.2.0.0.

Sample Output

SQL> create table test( a number );

Table created.

SQL> create index ind on test ( a );

Index created.

SQL> alter table test add constraint c1_pk primary key(a) using index;

Table altered.

SQL> select index_name from user_indexes where table_name='TEST';

INDEX_NAME
------------------------------
IND

SQL> alter table test drop constraint c1_pk;

Table altered.

SQL> select index_name from user_indexes where table_name='TEST';

INDEX_NAME
------------------------------
IND

References

Note 292096.1 - Encountering ora-00955 when trying to create primary key on an imported table in 10g

Keywords

'USING~INDEX'