标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (102)
- 数据库 (1,670)
- DB2 (22)
- MySQL (73)
- Oracle (1,532)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (21)
- ORA-xxxxx (159)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (14)
- ORACLE 21C (3)
- Oracle 23ai (7)
- Oracle ASM (65)
- Oracle Bug (8)
- Oracle RAC (52)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (560)
- Oracle安装升级 (91)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (78)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- ORA-600 krse_arc_complete.4
- Oracle 19c 202410补丁(RUs+OJVM)
- ntfs MFT损坏(ntfs文件系统故障)导致oracle异常恢复
- .mkp扩展名oracle数据文件加密恢复
- 清空redo,导致ORA-27048: skgfifi: file header information is invalid
- A_H_README_TO_RECOVER勒索恢复
- 通过alert日志分析客户自行对一个数据库恢复的来龙去脉和点评
- ORA-12514: TNS: 监听进程不能解析在连接描述符中给出的SERVICE_NAME
- ORA-01092 ORA-00604 ORA-01558故障处理
- ORA-65088: database open should be retried
- Oracle 19c异常恢复—ORA-01209/ORA-65088
- ORA-600 16703故障再现
- 数据库启动报ORA-27102 OSD-00026 O/S-Error: (OS 1455)
- .[metro777@cock.li].Elbie勒索病毒加密数据库恢复
- 应用连接错误,初始化mysql数据库恢复
- RAC默认服务配置优先节点
- Oracle 19c RAC 替换私网操作
- 监听报TNS-12541 TNS-12560 TNS-00511错误
- drop tablespace xxx including contents恢复
- Linux 8 修改网卡名称
标签归档:ORA-00918
升级数据库到10.2.0.5遭遇ORA-00918: column ambiguously defined
一个数据库从10201升级到10205之后,出现ORA-00918错误,查询mos发现在以前版本中是bug,Oracle好像在10205中把它修复了,结果就是以前应用的sql无法正常执行.这次升级的结果就是客户晚上3点联系开发商紧急修改程序。再次提醒:再小的系统数据库升级都需要做,功能测试,SPA测试,确保升级后功能和性能都正常.
SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi PL/SQL Release 10.2.0.5.0 - Production CORE 10.2.0.5.0 Production TNS for 64-bit Windows: Version 10.2.0.5.0 - Production NLSRTL Version 10.2.0.5.0 - Production
执行报错ORA-00918
多个表JOIN连接,由于在select中的列未指定表名,而且该列在多个表中有,因此在10205中报ORA-00918错误,Oracle认为在以前的版本中是 Bug 5368296: SQL NOT GENERATING ORA-918 WHEN USING JOIN. 升级到10.2.0.5, 11.1.0.7 and 11.2.0.2版本,需要注意此类问题。修复bug没事,但是修复了之后导致系统需要修改sql才能够运行,确实让人很无语
SQL> set autot trace SQL> set lines 100 SQL> SELECT yz_id, item_code, DECODE (yzlx, 0, '长期医嘱', '临时医嘱') yzlx, 2 item_name, gg, sl || sldw sl, zyjs, yf, a.pc, zbj, zbh, 3 TO_CHAR (dcl, 'fm9999990.009') || dcldw dcl, a.bz, lb, zyh,ch,xm, 4 bq, cfh, lrysdm, lrysxm, lrrq, hdrdm, hdrxm, hdrq, sender_code, 5 sender_name, send_date, tzysdm, tzysxm, tzrq, ksrq, zxfy, 6 lb_yp_yl, zsq_code 7 FROM op.yz a LEFT OUTER JOIN op.pc b 8 ON NVL (TRIM (UPPER (a.pc)), ' ') = NVL (TRIM (UPPER (b.pc)), ' ') 9 LEFT JOIN op.zy p ON a.zyh = p.zyh 10 WHERE p.cy='在院' AND p.new_patient='1' 11 AND upper(nvl(p.bj,1))<> 'Y' 12 AND (state = '已核对') 13 AND is_in_bill IS NULL 14 ORDER BY ksrq, yz_id ; bq, cfh, lrysdm, lrysxm, lrrq, hdrdm, hdrxm, hdrq, sender_code, * ERROR at line 4: ORA-00918: column ambiguously defined SQL> select COLUMN_NAME,TABLE_NAME from DBA_tab_columns where column_name='BQ' 2 AND TABLE_NAME IN('YZ','ZY','PC'); COLUMN_NAME TABLE_NAME ------------------------------ ------------------------------ BQ ZY BQ YZ
10.2.0.1中执行正常
E:\>sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on 星期六 1月 3 14:09:51 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Data Mining options SQL> set autot trace SQL> set lines 100 SQL> SELECT yz_id, item_code, DECODE (yzlx, 0, '长期医嘱', '临时医嘱') yzlx, 2 item_name, gg, sl || sldw sl, zyjs, yf, a.pc, zbj, zbh, 3 TO_CHAR (dcl, 'fm9999990.009') || dcldw dcl, a.bz, lb, zyh,ch,xm , 4 bq, cfh, lrysdm, lrysxm, lrrq, hdrdm, hdrxm, hdrq, sender_code, 5 sender_name, send_date, tzysdm, tzysxm, tzrq, ksrq, zxfy, 6 lb_yp_yl, zsq_code 7 FROM op.yz a LEFT OUTER JOIN op.pc b 8 ON NVL (TRIM (UPPER (a.pc)), ' ') = NVL (TRIM (UPPER (b.pc)), ' ') 9 LEFT JOIN op.zy p ON a.zyh = p.zyh 10 WHERE p.cy='在院' AND p.new_patient='1' 11 AND upper(nvl(p.bj,1))<> 'Y' 12 AND (state = '已核对') 13 AND is_in_bill IS NULL 14 ORDER BY ksrq, yz_id ; 已选择19804行。 执行计划 ---------------------------------------------------------- ERROR: ORA-00604: 递归 SQL 级别 2 出现错误 ORA-16000: 打开数据库以进行只读访问 SP2-0612: 生成 AUTOTRACE EXPLAIN 报告时出错 统计信息 ---------------------------------------------------------- 1 recursive calls 0 db block gets 41945 consistent gets 0 physical reads 0 redo size 2075973 bytes sent via SQL*Net to client 14989 bytes received via SQL*Net from client 1322 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 19804 rows processed
10.2.0.5库中同名列增加表名前缀执行OK
1 SQL> set autot trace SQL> set lines 100 SQL> SELECT yz_id, item_code, DECODE (yzlx, 0, '长期医嘱', '临时医嘱') yzlx, 2 item_name, gg, sl || sldw sl, zyjs, yf, a.pc, zbj, zbh, 3 TO_CHAR (dcl, 'fm9999990.009') || dcldw dcl, a.bz, lb,zyh,ch,xm, 4 a.bq, cfh, lrysdm, lrysxm, lrrq, hdrdm, hdrxm, hdrq, sender_code, 5 sender_name, send_date, tzysdm, tzysxm, tzrq, ksrq, zxfy, 6 lb_yp_yl, zsq_code 7 FROM op.yz a LEFT OUTER JOIN op.pc b 8 ON NVL (TRIM (UPPER (a.pc)), ' ') = NVL (TRIM (UPPER (b.pc)), ' ') 9 LEFT JOIN op.zy p ON a.zyh = p.zyh 10 WHERE p.cy='在院' AND p.new_patient='1' 11 AND upper(nvl(p.bj,1))<> 'Y' 12 AND (state = '已核对') 13 AND is_in_bill IS NULL 14 ORDER BY ksrq, yz_id ; 20629 rows selected. Execution Plan ---------------------------------------------------------- Plan hash value: 3468887510 -------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 10 | 2580 | 2968 (2)| 00:00:36 | | 1 | SORT ORDER BY | | 10 | 2580 | 2968 (2)| 00:00:36 | |* 2 | HASH JOIN OUTER | | 10 | 2580 | 2967 (2)| 00:00:36 | |* 3 | TABLE ACCESS BY INDEX ROWID| YZ | 3 | 672 | 42 (0)| 00:00:01 | | 4 | NESTED LOOPS | | 10 | 2390 | 2963 (2)| 00:00:36 | |* 5 | TABLE ACCESS FULL | ZY | 3 | 45 | 2917 (2)| 00:00:36 | |* 6 | INDEX RANGE SCAN | DZBLYZ_ZYH | 118 | | 2 (0)| 00:00:01 | | 7 | TABLE ACCESS FULL | PC | 33 | 627 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access(NVL(TRIM(UPPER("A"."PC")),' ')=NVL(TRIM(UPPER("B"."PC"(+))),' ')) 3 - filter("A"."STATE"='已核对' AND "A"."IS_IN_BILL" IS NULL) 5 - filter("P"."CY"='在院' AND UPPER(NVL("P"."BJ",'1'))<>'Y' AND "P"."NEW_PATIENT"='1') 6 - access("A"."ZYH"="P"."ZYH") Statistics ---------------------------------------------------------- 0 recursive calls 0 db block gets 42121 consistent gets 0 physical reads 0 redo size 2181383 bytes sent via SQL*Net to client 15617 bytes received via SQL*Net from client 1377 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 20629 rows processed
Bug 5368296: SQL NOT GENERATING ORA-918 WHEN USING JOIN
Bug 12388159 : SQL REPORTING ORA00918 AFTER UPGRADE TO 10.2.0.5.0
再次提醒:再小的系统数据库升级都需要做,功能测试,SPA测试,确保升级后功能和性能都正常.