ORA-29857 ORA-23515 ORA-02449

本文介绍了在Oracle数据库中删除包含各种依赖项(如域索引、物化视图及外键约束)的表空间example的详细步骤。首先解决域索引问题,然后处理物化视图,并最终通过级联删除约束条件来成功移除表空间。
SYS@ PROD1>drop tablespace example including contents and datafiles;
drop tablespace example including contents and datafiles
*
ERROR at line 1:
ORA-29857: domain indexes and/or secondary objects exist in the tablespace

SYS@ PROD1>select index_name, table_owner, table_name, tablespace_name from dba_indexes where index_type='DOMAIN';

INDEX_NAME                     TABLE_OWNE TABLE_NAME                     TABLESPACE_NAME
------------------------------ ---------- ------------------------------ ------------------------------
SUP_TEXT_IDX                   SH         SUPPLEMENTARY_DEMOGRAPHICS

SYS@ PROD1>drop index sh.SUP_TEXT_IDX ;
Index dropped.

################################################
SYS@ PROD1>drop tablespace example including contents and datafiles;
drop tablespace example including contents and datafiles
*
ERROR at line 1:
ORA-23515: materialized views and/or their indices exist in the tablespace
SYS@ PROD1>select 'drop materialized view '||owner||'.'||name||' PRESERVE TABLE;'
  2    from dba_registered_snapshots
  3  where name in (select table_name from dba_tables where tablespace_name ='EXAMPLE');
'DROPMATERIALIZEDVIEW'||OWNER||'.'||NAME||'PRESERVETABLE;'
--------------------------------------------------------------------------------
drop materialized view SH.CAL_MONTH_SALES_MV PRESERVE TABLE;
drop materialized view SH.FWEEK_PSCAT_SALES_MV PRESERVE TABLE;
SYS@ PROD1>drop materialized view SH.CAL_MONTH_SALES_MV PRESERVE TABLE;
Materialized view dropped.
SYS@ PROD1>drop materialized view SH.FWEEK_PSCAT_SALES_MV PRESERVE TABLE;
Materialized view dropped.

################################################
SYS@ PROD1>drop tablespace example including contents and datafiles;
drop tablespace example including contents and datafiles
*
ERROR at line 1:
ORA-02449: unique/primary keys in table referenced by foreign keys

SYS@ PROD1>drop tablespace example including contents and datafiles cascade constraints;
Tablespace dropped.




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29653765/viewspace-1764083/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29653765/viewspace-1764083/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值