Partition-方案一. 通过 Export/import 方法

本文介绍了如何通过Export/import方法将非分区表转换为分区表,详细阐述了从Export导出非分区表、Drop并重新创建分区表、Import数据到新分区表的过程,以及相关的时间和操作细节。
摘要由CSDN通过智能技术生成

方案一. 通过 Export/import 方法
可以任选如下四种方法的一种来对非分区表进行分区(维护时间由大到小):
A) 通过 Export/import 方法
B) 通过 Insert with a subquery 方法
C) 通过 Partition Exchange 方法
D) 通过 DBMS_REDEFINITION 方法

以上四种方法都会从一个已经存在的非分区表创建出一个分区表。尽管官方已经对这四种方法的维护时间预期做了倒序排列,但实际维护时间针对不同情况有所不同。

SQL> select count(*) from WZ_REAL_DATA;

  COUNT(*)
----------
  45506888
SQL> select sum(bytes)/1024/1024/1024 G from dba_segments where segment_name='WZ_REAL_DATA';

     G
----------
1.62988281

SQL> desc WZ_REAL_DATA
 Name                       Null?    Type
 ----------------------------------------- -------- ----------------------------
 STIME                       NOT NULL DATE
 PI_AI_POINT                   NOT NULL VARCHAR2(30)
 FVALUE                         NUMBER(16,4)
SQL> select min(stime) from WZ_REAL_DATA;

MIN(STIME
---------
01-MAR-12

SQL> select max(stime) from WZ_REAL_DATA;

MAX(STIME
---------
18-MAY-15

查看表WZ_REAL_DATA是否为分区表:

SQL> select table_name,tablespace_name from user_tables where table_name='WZ_REAL_DATA';

TABLE_NAME               TABLESPACE_NAME
------------------------------ ------------------------------
WZ_REAL_DATA               XDWZJS

SQL> select table_name,partition_name,partition_position from user_tab_partitions where table_name='WZ_REAL_DATA';

no rows selected

SQL> 

发现4500万数据的大表竟然不是分区表,并且此表大小快超过2G了,oracle建议对大于2G的表进行分区;
下面开始进行分区实验:

方案一. 通过

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
/home/fujiayu/esp/esp-idf/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources Executing action: flash Running ninja in directory /home/fujiayu/esp/hello_world/build Executing "ninja flash"... [1/5] cd /home/fujiayu/esp/hello_world.../esp/hello_world/build/hello_world.bin hello_world.bin binary size 0x31ee0 bytes. Smallest app partition is 0x100000 bytes. 0xce120 bytes (80%) free. [1/1] cd /home/fujiayu/esp/hello_world..._world/build/bootloader/bootloader.bin Bootloader binary size 0x5290 bytes. 0x2d70 bytes (35%) free. [2/3] cd /home/fujiayu/esp/esp-idf/com...nents/esptool_py/run_serial_tool.cmake esptool esp32s3 -p /dev/ttyACM0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 2MB 0x0 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin esptool.py v4.6.2 Serial port /dev/ttyACM0 A fatal error occurred: Could not open /dev/ttyACM0, the port doesn't exist CMake Error at run_serial_tool.cmake:66 (message): /home/fujiayu/.espressif/python_env/idf5.2_py3.8_env/bin/python;;/home/fujiayu/esp/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s3 failed. FAILED: CMakeFiles/flash cd /home/fujiayu/esp/esp-idf/components/esptool_py && /usr/bin/cmake -D IDF_PATH=/home/fujiayu/esp/esp-idf -D "SERIAL_TOOL=/home/fujiayu/.espressif/python_env/idf5.2_py3.8_env/bin/python;;/home/fujiayu/esp/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s3" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/home/fujiayu/esp/hello_world/build -P /home/fujiayu/esp/esp-idf/components/esptool_py/run_serial_tool.cmake ninja: build stopped: subcommand failed. ninja failed with exit code 1, output of the command is in the /home/fujiayu/esp/hello_world/build/log/idf_py_stderr_output_21690 and /home/fujiayu/esp/hello_world/build/log/idf_py_stdout_output_21690
最新发布
07-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值