回覆列表
  • 1 # 資料和雲智慧

    以下這個測試展示了這個過程:

    SQL> select * from v$version;BANNER CON_ID-------------------------------------------------------------------------------- ----------Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0PL/SQL Release 12.2.0.1.0 - Production 0CORE 12.2.0.1.0 Production 0TNS for Linux: Version 12.2.0.1.0 - Production 0NLSRTL Version 12.2.0.1.0 - Production 0SQL> CREATE TABLE enmotech (2 PartID integer not null,3 CretTm date not null,4 PartCD varchar2(2) not null5 ) partition by list (partcd) automatic (6 partition pBJ values ("BJ"),7 partition pCD values ("CD"),8 partition pGZ values ("GZ"),9 partition pSH values ("SH")10 );Table created.SQL> insert into enmotech values (1, sysdate, "KM");1 row created.SQL> select partition_name from user_tab_partitions2 where table_name = "ENMOTECH";PARTITION_NAME--------------------------------------------------------------------PBJPCDPGZPSHSYS_P281SQL> alter table enmotech drop partition SYS_P281 purge;alter table enmotech drop partition SYS_P281 purge*ERROR at line 1:ORA-14048: a partition maintenance operation may not be combined with other operationsSQL> alter table enmotech drop partition PSH;Table altered.SQL> select * from user_recyclebin;no rows selectedSQL> drop table enmotech;Table dropped.SQL> select object_name,original_name,type from user_recyclebin;OBJECT_NAME ORIGINAL_NAME TYPE---------------------------------------- -------------------- -------------------------BIN$TflQLiTmWX7gUwo4qMBX+A==$0 ENMOTECH TABLEBIN$TflQLiTmWX7gUwo4qMBX+A==$0 ENMOTECH Table PartitionBIN$TflQLiTmWX7gUwo4qMBX+A==$0 ENMOTECH Table PartitionBIN$TflQLiTmWX7gUwo4qMBX+A==$0 ENMOTECH Table PartitionBIN$TflQLiTmWX7gUwo4qMBX+A==$0 ENMOTECH Table Partition

    很多時候,想當然的結果可能並不可信,實踐操作方能出真知,多動手,是技術人的王道。

    參考:

    http://www.eygle.com/archives/2017/04/drop_partition_

  • 中秋節和大豐收的關聯?
  • 為什麼一些40歲的人不太好找工作?企業都是怎麼看的?