There's Always Another Bug Hiding Just Around the Corner

We were using a 10.2.0.3 database, and it had been running without any issues for several years. What could possibly go wrong? Anything! Suddenly, we started getting "
ORA-07445: exception encountered: core dump [qercoStart()+156] [SIGSEGV] [Address not mapped to object] " a few times a minute in the alert log. A closer investigation revealed that one of the popular SQLs in the application couldn't complete anymore. It looked like a bug, since only the SQL was failing.
We found a few references for various releases with the same conditions: ORA-07445 + qercoStart(). This list summarizes the possible causes for the error I found on My Oracle Support:
- Using ROWNUM < x condition in the where clause
- Using ROWNUM condition and FULL OUTER joins
- Using ROWNUM condition with UNION ALL set operation
- Flushed the shared pool
- setting "_complex_view_merging"=false
- bouncing the database
- from bug 7704557 on 10.2.0.4 [sourcecode language="sql" highlight="3"] select jsp1.name name , jsp1.value value from "SYSJCS".jcs_scheduler_parameters jsp1 where jsp1.name in ('database_name', 'global_names', 'scheduler_hostname', 'remote_start_port', 'scheduler_connect_string', 'oracle_sid', 'listener_port', 'remote_http_output','remote_http_port') and rownum <= 9 and scheduler_name = nvl (:scheduler, scheduler_name); [/sourcecode]
- from bug 7528596 on 10.2.0.3 [sourcecode language="sql" highlight="10,19"] SELECT /*+ FIRST_ROWS(200) */ rv.STATUS_NAME H_STATUS_ID ,rv.DESCRIPTION H_DESCRIPTION ,rv.PRIORITY_MEANING H_PRIORITY_CODE ,rv.CREATED_BY_NAME H_CREATED_BY , rv.CREATED_BY_EMAIL H_CREATED_BY_E , H_CREATED_BY_N , rv.CREATION_DATE H_CREATION_DATE ,rv.ASSIGNED_TO_NAME H_ASSIGNED_TO_USER_ID , rv.ASSIGNED_TO_EMAIL H_ASSIGNED_TO_USER_ID_E , rv.ASSIGNED_TO_USERNAME H_ASSIGNED_TO_USER_ID_N ,rv.REQUEST_ID H_REQUEST_ID FROM itgadm.kcrt_requests_v rv, itgadm.kcrt_req_header_details rh WHERE (1=1 AND (rv.batch_number =1 OR rv.batch_number is null) AND rv.REQUEST_TYPE_ID in (30593) AND rv.REQUEST_TYPE_ID in (30593) AND ( rv.STATUS_CODE NOT LIKE 'CLOSED%' AND rv.STATUS_CODE NOT LIKE 'CANCEL%' ) AND exists(SELECT /*+ NO_UNNEST */ pcv.REQUEST_ID FROM itgadm.KCRT_PARTICIPANT_CHECK_V pcv WHERE pcv.request_id = rv.request_id and pcv.user_id = 30481) AND rh.request_id = rv.request_id ) AND ( rh.PARAMETER22 = 30481 OR rv.ASSIGNED_TO_USER_ID = 30481 ) AND ROWNUM <= 200 ORDER BY rv.REQUEST_ID DESC;[/sourcecode]
- from bug 7416171 on 10.2.0.3 [sourcecode language="sql" highlight="7"] SELECT COUNT(*) FROM ( SELECT ( SELECT DECODE(COUNT(*),0,0,1) isStemData FROM ccd2.vw_policy_admins q WHERE q.system_id = a.system_id AND q.policy_no = a.policy_no AND ((q.policy_admin_id in (440502405,440502499))) AND rownum < 2)isStemData FROM ccd2.vw_ordf_partners_cnt a WHERE a.PARTNER_ID = 36977489 /*AND a.PARTNER_ID2 = a.PARTNER_ID */ AND a.ORDF_ID = 2 AND 1=1) b WHERE isStemData=1 AND rownum < 300[/sourcecode]
- from bug 3211315 on 9.2.0.4 [sourcecode language="sql" highlight="2"] select dummy from (SELECT dummy from dual where rownum < 2) FULL OUTER JOIN (SELECT dummy from dual where rownum < 2) using (dummy)[/sourcecode]
- Oracle introduced native FULL OUTER JOIN operation in 10.2.0.5. Before that, it was implemented using the UNION ALL operation. (Cristian Antognini explains it here and gives some examples.)
- "OR" and "IN" predicates can sometimes be optimized by applying the "OR Expansion" transformation, which acquires the result set of each disjunction condition separately and then combines them using the set operations, i.e. UNION ALL. (Maria Colgan explains it here better than anyone else could.)