How to find Current open Cursors in Oracle

Total cursors open, by session: select a.value, s.username, s.sid, s.serial# from v$sesstat a, v$statname b, v$session s where a.statistic# = b.statistic# and s.sid=a.sid and b.name=”opened cursors current”; Source: http://www.orafaq.com/node/758 As far as I know queries on v$ views are based on pseudo-tables (“x$” tables) that point directly to the relevant portions of the SGA, so … Read more

Why do I have ORA-00904 even when the column is present?

ORA-00904-invalid identifier errors are frequently caused by case-sensitivity issues. Normally, Oracle tables and columns are not case sensitive and cannot contain punctuation marks and spaces. But if you use double quotes to create a quoted identifier, that identifier must always be referenced with double quotes and with the correct case. For example: create table bad_design(“goodLuckSelectingThisColumn … Read more

ORA-01861: literal does not match format string

Remove the TO_DATE in the WHERE clause TO_DATE (alarm_datetime,’DD.MM.YYYY HH24:MI:SS’) and change the code to alarm_datetime The error comes from to_date conversion of a date column. Added Explanation: Oracle converts your alarm_datetime into a string using its nls depended date format. After this it calls to_date with your provided date mask. This throws the exception.