I have java web app which use Oracle db. Web app use hibernate. I have 2 oracle instance - first one in server, second one in local virtual linux machine.
When I connect to local oracle instance at some point I get
ORA-01792: maximum number of columns in a table or view is 1000
exception. But when I connected to oracle (which is in server) don't get that exception. I am doing exactly same action and dump is same. So I think problem in oracle. maybe some configuration are different.
Can anybody tell me what can be differences between oracle servers which leads to this situation?
UPDATE. some parts from stacktrace
Caused by: org.hibernate.exception.SQLGrammarException: could not initialize a collection:
Caused by: java.sql.SQLSyntaxErrorException: ORA-01792: maximum number of columns in a table or view is 1000
2 Answers. Show activity on this post. According to the MySQL 5.7 reference manual, there is a maximum of 4096 columns per table.
There's a hard limit of 1,000 columns per table in Oracle Database. So you have to split it into many tables. But if you split it into many tables each with <= 255 columns, you'll have more joins.
You are using a MyISAM table and the space required for the table exceeds what is permitted by the internal pointer size. MyISAM permits data and index files to grow up to 256TB by default, but this limit can be changed up to the maximum permissible size of 65,536TB (2567 − 1 bytes).
ORA-01792: maximum number of columns in a table or view is 1000
This limit is not only applicable to tables and views, but also on the temporary inline view and the temporary internal memory tables which Oracle creates while executing a subquery.
For example,
Oracle creates a temporary inline view based on the merge select, thus the same restriction is implemented on this temporary inline view. So, you need to make sure that the number of columns in a sub-select or subquery also doesn't exceed this limit of 1000
.
Caused by: org.hibernate.exception.SQLGrammarException: could not initialize a collection:
The above error indicates that you are trying to create a collection which exceeds the limit of number of columns allowed, i.e. the total number of columns exceeds 1000
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With