zoukankan      html  css  js  c++  java
  • ORA-14404

    OS:

    Oracle Linux Server release 5.7

    DB:

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

    在测试环境中删除表空间释放磁盘空间时报错,如下:

    SQL> drop tablespace TBS_MYPAYMENT including contents and datafiles;
    drop tablespace TBS_MYPAYMENT including contents and datafiles
    *
    ERROR at line 1:
    ORA-14404: partitioned table contains partitions in a different tablespace

    解决方法:

    select 'alter table '||owner||'.'||segment_name||' drop partition '||partition_name||' ;'
    from dba_segments
    where segment_name in (select distinct segment_name
    from dba_segments
    where tablespace_name = 'TBS_MYPAYMENT'
    and segment_type like '%PART%')
    and tablespace_name <> 'TBS_MYPAYMENT';

    得出:

    alter table CP.IDX_CP_HANDLE_BATCH_NO drop partition SYS_P200 ;
    alter table CP.IDX_CP_HANDLE_REQUEST_ID drop partition SYS_P200 ;
    alter table CP.IDX_CP_PAYMENT_REQUEST_ID drop partition SYS_P201 ;
    alter table CP.IDX_CP_PAYMENT_TRAN_NO drop partition SYS_P201 ;
    alter table CP.IDX_CP_REQUEST_ID drop partition SYS_P199 ;
    alter table CP.IDX_CP_REQUEST_TRAN_NO drop partition SYS_P199 ;
    alter table CP.TBL_CP_HANDLE drop partition SYS_P200 ;
    alter table CP.TBL_CP_PAYMENT drop partition SYS_P201 ;
    alter table CP.TBL_CP_REQUEST drop partition SYS_P199 ;

    执行上面得出的DDL语句即可删除表空间(切记:在上面的DDL语句没用的条件下,不可乱删哦).

    无法删除的原因是因为分区表不在一个表空间下.

  • 相关阅读:
    hdu 1402 大数A*B模板(FFT)
    ccpc 哈尔滨L题 LRU Algorithm
    今年得慢慢学的
    Codeforces Round #629 (Div. 3) E. Tree Queries(LCA)
    Codeforces Global Round 7 D2. Prefix-Suffix Palindrome (Hard version) -- manacher
    hdu 3068 (manacher算法)
    用Socket API建立简易tcp服务端和客户端
    Win下建立Socket时注意事项
    线段树(Segment Tree)
    Codeforces Round #643 (Div. 2)
  • 原文地址:https://www.cnblogs.com/hankyoon/p/5174460.html
Copyright © 2011-2022 走看看