oracle 12c 和 ORA-01792:表或视图中的最大列数为 1000

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32571270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:00:30  来源:igfitidea点击:

12c and ORA-01792: maximum number of columns in a table or view is 1000

oracleoracle12c

提问by user1351848

I've inherited databases/tables that contain over 1000 columns in a single table that need to be migrated into an Oracle 12c database. Is there anything inherent to 12c that could help us with overcoming the 1000 column limit (such as partitioning the table in a certain way)? Unfortunately normalizing the table is not an option.

我继承了单个表中包含 1000 多个列的数据库/表,这些列需要迁移到 Oracle 12c 数据库中。12c 是否有任何固有的东西可以帮助我们克服 1000 列的限制(例如以某种方式对表进行分区)?不幸的是,标准化表格不是一种选择。

回答by Husqvik

Max of 1000 columns always has been in Oracle. Only thing you can do is to split the columns to multiple tables and join them. A query can return more than 1000 column. Just tested 8160 worked, more returns ORA-00913: too many values. Unfortunately you can't create a view from the query because it has the same 1000 column limitation as a table.

最多 1000 列始终在 Oracle 中。您唯一能做的就是将列拆分为多个表并加入它们。一个查询可以返回 1000 多个列。刚刚测试 8160 工作,更多返回 ORA-00913:值太多。不幸的是,您无法从查询创建视图,因为它与表具有相同的 1000 列限制。

Also be aware that Oracle can hold only up to 255 columns in single block so there are certain consequences when a table has more columns.

另请注意,Oracle 在单个块中最多只能容纳 255 列,因此当表具有更多列时会产生某些后果。

回答by David Aldridge

There is still a limit of 1,000 in 12c

12c还有1000的限制

https://docs.oracle.com/database/121/REFRN/GUID-685230CF-63F5-4C5A-B8B0-037C566BDA76.htm#REFRN0043

https://docs.oracle.com/database/121/REFRN/GUID-685230CF-63F5-4C5A-B8B0-037C566BDA76.htm#REFRN0043

It's a long shot, but you could look at using a JSON datatype to allow you to effectively store more atomic values in a single column. https://docs.oracle.com/database/121/ADXDB/json.htm#ADXDB6246

这是一个远景,但您可以考虑使用 JSON 数据类型来允许您在单个列中有效地存储更多原子值。https://docs.oracle.com/database/121/ADXDB/json.htm#ADXDB6246