如何将一个普通的非分区表进行分区1 Export/import方式 ## 参考文档: 如何将一个普通的非分区表进行分区 (Doc ID 1985005.1) 第一种方式: 通过 Export/import 方法进行转换 这种方法的实现是先 export/exp 一个非分区表,创建一个新的分区表,然后 import/imp 数据到新创建的分区表中。 1) Exp你的非分区表: [oracle@zc ~]$ exp partion/partion tables=PAR_TABLE file=PAR_TABLE.dmp Export: Release 19.0.0.0.0 - Production on Mon Jan 20 17:41:52 2025 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 Export done in US7ASCII character set and AL16UTF16 NCHAR character set server uses AL32UTF8 character set (possible charset conversion) About to export specified tables via Conventional Path ... . . exporting table PAR_TABLE 1002111 rows exported EXP-00091: Exporting questionable statistics. EXP-00091: Exporting questionable statistics. Export terminated successfully with warnings. 2) Drop 掉该非分区表: SQL> drop table PAR_TABLE; Table dropped. 3) 重新创建该表成为一个分区表: CREATE TABLE par_table ( a NUMBER, y number, name VARCHAR2(100),date_used DATE) PARTITION BY RANGE (date_used) (PARTITION unpar_table_12 VALUES LESS THAN (TO_DATE('10/05/2015', 'DD/MM/YYYY')), PARTITION unpar_table_15 VALUES LESS THAN (TO_DATE('15/05/2015', 'DD/MM/YYYY')), PARTITION unpar_table_MX VALUES LESS THAN (MAXVALUE)); 4) 通过 import 的 ignore=y 方式来还原备份的数据: [oracle@zc ~]$ imp partion/partion file=PAR_TABLE.dmp TABLES=PAR_TABLE ignore=y Import: Release 19.0.0.0.0 - Production on Mon Jan 20 17:54:27 2025 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 Export file created by EXPORT:V19.00.00 via conventional path import done in US7ASCII character set and AL16UTF16 NCHAR character set import server uses AL32UTF8 character set (possible charset conversion) IMP-00403: Warning: This import generated a separate SQL file "import_sys" which contains DDL that failed due to a privilege issue. . importing PARTION's objects into PARTION . importing PARTION's objects into PARTION . . importing table "PAR_TABLE" 1002111 rows imported Import terminated successfully with warnings. ignore=y 语句会让 import 忽略掉表的创建,直接加载所有数据。 5) 查询分区信息: SELECT partitioned FROM user_tables WHERE table_name = 'PAR_TABLE';
如何将一个普通的非分区表进行分区1 Export/import方式
来源:这里教程网
时间:2026-03-03 21:30:46
作者:
编辑推荐:
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- 关闭hyper-v,关闭hyper-v的实操步骤,hyper-v批量管理工具的使用指南
- 新房装修必看!湖南家具省钱攻略,本地人都爱逛
新房装修必看!湖南家具省钱攻略,本地人都爱逛
26-03-03 - 干了15年Oracle,今天重新认识了这个问题
干了15年Oracle,今天重新认识了这个问题
26-03-03 - 虚拟机 hyper-v,虚拟机 hyper-v的实操步骤,hyper-v批量管理工具的使用指南
- gc buffer busy acquire导致的重大数据库性能故障
gc buffer busy acquire导致的重大数据库性能故障
26-03-03 - hyper -v管理,hyper -v管理的实操步骤,hyper-v批量管理工具的使用指南
- 第27期 Oracle在线重定义介绍
第27期 Oracle在线重定义介绍
26-03-03 - hyper-v虚拟化,hyper-v虚拟化的实操步骤,hyper-v批量管理工具的使用指南
- win10 hyper v,win10 hyper v的实操指南,hyper-v批量管理工具的使用指南
- 数据库管理-第293期 奇怪的sys.user$授权+(20250210)
