博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
rebuild online索引遇到ora-1450
阅读量:2446 次
发布时间:2019-05-10

本文共 2875 字,大约阅读时间需要 9 分钟。

测试一下
SQL> create table justin(name varchar2(4000));
 
Table created
 
SQL> create index idx_justin_name on justin(name);
 
Index created
 
SQL> alter index idx_justin_name rebuild online;
 
alter index idx_justin_name rebuild online
 
ORA-00604: error occurred at recursive SQL level 1
ORA-01450: maximum key length (3215) exceeded
 
SQL> alter index idx_justin_name rebuild;
 
Index altered
去除online即可重建成功;
系统默认块为8k,现在创建一个16k的表空间;
SQL> show parameter db_block

NAME                                 TYPE                             VALUE

------------------------------------ -------------------------------- ------------------------------
db_block_buffers                     integer                          0
db_block_checking                    string                           FALSE
db_block_checksum                    string                           TRUE
db_block_size                        integer                          8192
SQL> show parameter db_16k_cache_size;

NAME                                 TYPE                             VALUE

------------------------------------ -------------------------------- ------------------------------
db_16k_cache_size                    big integer                      0
SQL> alter system set db_16k_cache_size=1m;

System altered.

SQL> create tablespace justin datafile '/data/oracle/oradata/justin/justin.dbf' size 10m blocksize 16k;

Tablespace created.

重新rebuild online一下

SQL> alter index idx_justin_name rebuild online tablespace justin;
 
alter index idx_justin_name rebuild online tablespace justin
 
ORA-00604: error occurred at recursive SQL level 1
ORA-01450: maximum key length (3800) exceeded
依旧不行,但是错误信息的max key length从3215上升到3800;
SQL> drop tablespace justin; 

Tablespace dropped.

SQL> alter system set db_32k_cache_size=32k;

System altered.

SQL> create tablespace justin datafile '/data/oracle/oradata/justin/justin.dbf' size 10m blocksize 32k;

Tablespace created.

SQL> alter index idx_justin_name rebuild online tablespace justin;

 
alter index idx_justin_name rebuild online tablespace justin
 
ORA-00604: error occurred at recursive SQL level 1
ORA-01450: maximum key length (3800) exceeded
使用块大小为32k和16k的表空间,均是报告3800为上限,依据提示将索引列的长度调小为3780,这次在32k表空间里可以创建成功,但是在其他8k表空间依旧不行
SQL> alter table justin modify name varchar2(3780);
 
Table altered
 
SQL>  alter index idx_justin_name rebuild online tablespace justin;
 
Index altered
 
SQL>  alter index idx_justin_name rebuild online;
 
Index altered
 
SQL>  alter index idx_justin_name rebuild online tablespace justin;
 
alter index idx_justin_name rebuild online tablespace purchase
 
ORA-00604: error occurred at recursive SQL level 1
ORA-01450: maximum key length (3215) exceeded

查看metalink ID 236329.1,

Rebuild the index without ONLINE clause. There is no way to rebuild this index
ONLINE without the change of the initialization parameter db_block_size.
OR
Rebuild the database with greater value of the initialization parameter
db_block_size according to Note:136158.1:
ORA-01450 and Maximum Key Length - How it is Calculated.

以后遇到此类错误,

要么去掉online选项,要么创建blocksize更大的表空间;但是后者并不能保证一定可以rebulid online通过

 

 

 

 

 

 

 

 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15480802/viewspace-705231/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15480802/viewspace-705231/

你可能感兴趣的文章
android 更改软键盘_如何在Android上更改Google键盘的主题
查看>>
kodi 缓存文件夹_如何将Kodi图稿与视频存储在同一文件夹中
查看>>
windows隐藏磁盘_如何在Windows的磁盘清理工具中启用隐藏选项
查看>>
如何在Linux或macOS终端中使用Bash历史记录
查看>>
photos设置成中文_如何在OS X的Photos中设置和使用扩展程序
查看>>
大剧院自助签证_如果您的项目是《剧院》,请使用演员
查看>>
windows终端终端_Windows终端介绍
查看>>
小额免密_如何在您的应用中进行小额付款
查看>>
用开源代码如何建立网站_建立全球开源法律网络
查看>>
c&c++语言参考手册_C ++值类别快速参考:第2部分
查看>>
javascript优化_优化性能的十大JavaScript技巧
查看>>
ruby on rails_Ruby on Rails在市场开发中的重要地位
查看>>
react 编程式路由_如何做React式编程。 第2部分:副作用
查看>>
传统网络面临问题_我们每天都面临的最流行的计算机问题
查看>>
aws cmake .._如何将Hyperledger Fabric 1.4部署到AWS
查看>>
机器人学数学理论_基于格理论的机器学习数学
查看>>
unity 场景优化_Unity优化:您的场景层次正在抢劫您
查看>>
如何制作电子邮件而不是一团糟:实用技巧
查看>>
px em rem区别_px,em,rem,%之间有什么区别? 答案在这里
查看>>
pvs-stdio ue4_云中的PVS-Studio:Azure DevOps
查看>>