批量导入某大张表数据的时候的最佳实践
发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,批量导入某大张表数据的时候的最佳实践:1、把表上所有的索引都设置为unusable: alter index unusable;2、做批量导入3、rebuild索引:alter index reb
千家信息网最后更新 2025年11月07日批量导入某大张表数据的时候的最佳实践批量导入某大张表数据的时候的最佳实践:
1、把表上所有的索引都设置为unusable: alter index unusable;
2、做批量导入
3、rebuild索引:alter index rebuild parallel nologging;
演示如下
SQL> create table emp as select * from employees;
Table created.
SQL> create index idx_emp_job on emp(job_id);
Index created.
SQL> select bytes from user_segments where segment_name='IDX_EMP_JOB';
BYTES
----------
65536
SQL> alter index idx_emp_job unusable;
Index altered.
SQL> insert into emp select * from emp;
107 rows created.
SQL> /
214 rows created.
SQL> /
428 rows created.
SQL> /
856 rows created.
SQL> /
1712 rows created.
SQL> /
3424 rows created.
SQL> /
6848 rows created.
SQL> /
13696 rows created.
SQL> /
27392 rows created.
SQL> /
54784 rows created.
SQL>
SQL>
SQL>
SQL> /
109568 rows created.
SQL> commit;
Commit complete.
SQL> select bytes from user_segments where segment_name='IDX_EMP_JOB';
no rows selected
SQL> select status from user_objects where object_name='IDX_EMP_JOB';
STATUS
-------
VALID
SQL> alter index IDX_EMP_JOB rebuild parallel 4 nologging;
Index altered.
SQL> select bytes from user_segments where segment_name='IDX_EMP_JOB';
BYTES
----------
5373952
1、把表上所有的索引都设置为unusable: alter index
2、做批量导入
3、rebuild索引:alter index
演示如下
SQL> create table emp as select * from employees;
Table created.
SQL> create index idx_emp_job on emp(job_id);
Index created.
SQL> select bytes from user_segments where segment_name='IDX_EMP_JOB';
BYTES
----------
65536
SQL> alter index idx_emp_job unusable;
Index altered.
SQL> insert into emp select * from emp;
107 rows created.
SQL> /
214 rows created.
SQL> /
428 rows created.
SQL> /
856 rows created.
SQL> /
1712 rows created.
SQL> /
3424 rows created.
SQL> /
6848 rows created.
SQL> /
13696 rows created.
SQL> /
27392 rows created.
SQL> /
54784 rows created.
SQL>
SQL>
SQL>
SQL> /
109568 rows created.
SQL> commit;
Commit complete.
SQL> select bytes from user_segments where segment_name='IDX_EMP_JOB';
no rows selected
SQL> select status from user_objects where object_name='IDX_EMP_JOB';
STATUS
-------
VALID
SQL> alter index IDX_EMP_JOB rebuild parallel 4 nologging;
Index altered.
SQL> select bytes from user_segments where segment_name='IDX_EMP_JOB';
BYTES
----------
5373952
索引
数据
时候
大张
实践
演示
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
软件开发项目报价模板
dell服务器闪黄灯
川科互联网科技股份有限公司
2021年网络安全知识竞赛
维护网络安全 要抓住
重庆璧山生鲜配送软件开发
高斯数据库查看执行计划
东川区品牌软件开发报价表
网络技术与生活的论文
地方数据库行业政策
互联网科技创新之城
提高网络安全防范
电子科技包含互联网科技吗
足球数据库技术
数据库录入
中国旅游垃圾数据库
6t服务器硬盘
如何根据时间查询数据库
网络安全存储服务器机箱怎么用
数据库技术成果
软件开发检测软件心得 体会
数据库中男女的创建
泉州市公安网络安全员工资
蛋白核酸对接数据库
安卓远程启动服务器下载
软通动力网络技术有限公司
蜀山区整机销售软件开发公司
重庆市开税安全服务器接入
boss服务器出了问题吗
jdbc连接数据库原理