[20241012]ORA-01792 maximum number of columns in a table or view is 1000.txt --//12c数据库查询遇到的问题,几个大型视图,字段很多连接时出现问题。 ORA-01792: maximum number of columns in a table or view is 1000 --//上网查询以后发现设置alter session set "_fix_control"='17376322:OFF';可以解决。 SCOTT@book01p> column SESSION_ID format 9999999999 SCOTT@book01p> column event format 999999999 SCOTT@book01p> @ fix "1000 columns" SCOTT@book01p> @ pr ============================== SESSION_ID : 18 BUGNO : 17376322 VALUE : 0 SQL_FEATURE : QKSFM_CBO_17376322 DESCRIPTION : raise error if view(s) have more than 1000 columns OPTIMIZER_FEATURE_ENABLE : EVENT : 0 IS_DEFAULT : 1 CON_ID : 3 PL/SQL procedure successfully completed. --//21c IS_DEFAULT=1 对应是off。 --//简单演示: 1.环境: SCOTT@book01p> @ver2 ============================== PORT_STRING : x86_64/Linux 2.4.xx VERSION : 21.0.0.0.0 BANNER : Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production BANNER_FULL : Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production Version 21.3.0.0.0 BANNER_LEGACY : Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production CON_ID : 0 PL/SQL procedure successfully completed. $ cat ct.txt set head off feedback off spool a.txt select 'create table t1 (' from dual union all select 'col'||lpad(rownum-1,3,'0')||' number(1),' from dual connect by level<=400 union all select 'constraint t1_pk primary key (col000));' from dual ; spool off set head on feedback 6 --//适当改名,建立3个表t1,t2,t3,每个表400字段,过程略,分析表略。 2.测试: SCOTT@book01p> alter session set "_fix_control"='17376322:ON'; Session altered. SCOTT@book01p> @ fix "1000 columns" SCOTT@book01p> @ pr ============================== SESSION_ID : 18 BUGNO : 17376322 VALUE : 0 SQL_FEATURE : QKSFM_CBO_17376322 DESCRIPTION : raise error if view(s) have more than 1000 columns OPTIMIZER_FEATURE_ENABLE : EVENT : 0 IS_DEFAULT : 0 CON_ID : 3 PL/SQL procedure successfully completed. SCOTT@book01p> select t3.* from t1 join t2 on (t1.col000 = t2.col000) join t3 on (t2.col000 = t3.col000); select t3.* from t1 join t2 on (t1.col000 = t2.col000) join t3 on (t2.col000 = t3.col000) * ERROR at line 1: ORA-01792: maximum number of columns in a table or view is 1000 --//这样情况即使输出1个表t3也报错,如果使用非ansi连接写法不报错。 SCOTT@book01p> select t3.* from t1 ,t2,t3 where t1.col000 = t2.col000 and t2.col000 = t3.col000; no rows selected SCOTT@book01p> select * from t1 ,t2,t3 where t1.col000 = t2.col000 and t2.col000 = t3.col000; no rows selected SCOTT@book01p> alter session set "_fix_control"='17376322:OFF'; Session altered. SCOTT@book01p> @ fix "1000 columns" SCOTT@book01p> @ pr ============================== SESSION_ID : 18 BUGNO : 17376322 VALUE : 0 SQL_FEATURE : QKSFM_CBO_17376322 DESCRIPTION : raise error if view(s) have more than 1000 columns OPTIMIZER_FEATURE_ENABLE : EVENT : 0 IS_DEFAULT : 1 CON_ID : 3 PL/SQL procedure successfully completed. --//IS_DEFAULT=1 SCOTT@book01p> select t3.* from t1 join t2 on (t1.col000 = t2.col000) join t3 on (t2.col000 = t3.col000); no rows selected SCOTT@book01p> select * from t1 join t2 on (t1.col000 = t2.col000) join t3 on (t2.col000 = t3.col000); no rows selected --//3个表一起输出也没有问题。 SCOTT@book01p> select * from t1 ,t2,t3 where t1.col000 = t2.col000 and t2.col000 = t3.col000; no rows selected
[20241012]ORA-01792 maximum number of columns in a table or view is 1000.txt
来源:这里教程网
时间:2026-03-03 20:40:41
作者:
编辑推荐:
- [20241012]ORA-01792 maximum number of columns in a table or view is 1000.txt03-03
- 数据库管理-第244期 一次无法switchover的故障处理(20240928)03-03
- [20241012]ora-12526.txt03-03
- 史上最详细的,Oracle数据库AI落地理论及实践03-03
- [20240927]学习SQL MASCROS.txt03-03
- 数据库管理-第247期 23ai:全球分布式数据库-Schema对象(20241004)03-03
- [20240928]10,16进制转10,16进制的sql脚本.txt03-03
- [20240928]vim设置set paste问题.txt03-03
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- 数据库管理-第244期 一次无法switchover的故障处理(20240928)
- 史上最详细的,Oracle数据库AI落地理论及实践
史上最详细的,Oracle数据库AI落地理论及实践
26-03-03 - 数据库管理-第247期 23ai:全球分布式数据库-Schema对象(20241004)
- Oracle 数据库架构
Oracle 数据库架构
26-03-03 - Oracle + JSON = 王炸!!!
Oracle + JSON = 王炸!!!
26-03-03 - 大事件! Oracle CloudWorld 是"真高光"还是"挤牙膏"?
- 掌握CMD命令:轻松切换IP地址
掌握CMD命令:轻松切换IP地址
26-03-03 - 5大公有云厂商增强很猛~作为DBA的,有点焦虑!
5大公有云厂商增强很猛~作为DBA的,有点焦虑!
26-03-03 - ORA-01558: out of transaction ID's in rollback segment SYSTEM---惜分飞
- 一个很小的系统为什么负载那么高?
一个很小的系统为什么负载那么高?
26-03-03
