数据表优化
2024/9/5原创小于 1 分钟约 147 字
1. 分析数据表
相关信息
数据数据库表读写速度慢,可以对表进行优化或者分析,提高读写速度。
analyze table tmp_name compute statistics;
begin
dbms_stats.gather_table_stats('user','table_name');
end;
2. 优化数据表
alter table tmp_name move tablespace TBS_BHGCRM_DATA;
3. 优化索引
alter index idx_name rebuild tablespace TBS_BHGCRM_DATA;
4. 优化分区表
alter table tmp_name move partition p202401 tablespace TBS_BHGCRM_DATA;
5. 优化分区索引
alter index idx_name rebuild partition p202401 tablespace TBS_BHGCRM_DATA;