Posts

Showing posts from August 30, 2009

ORA-00939: too many arguments -when case arguments exceed 255

Problem Description In all Oracle 10.1g and oracle 10.2.0.1, 10.2.0.2, 10.2.0.3 whenever there is more than 255 arguments inside CASE statements then following error is returned. ORA-00939: too many arguments for function But surprisingly on Oracle 9.2 database the same code does not return any error. Cause of the Problem As we see the same code return error in 10g but it is well on 9.2. In fact this is problem of oracle 9.2 that it does not return any error. It should return error if there is more than 255 arguments inside CASE statements. In oracle 9.2 this is bug number 2909927 and this bug is fixed in oracle 10.1 and 10.2. That's why in 10.2 and 10.1 error returns if arguments exceed 255. Up to Oracle 10.2.0.3 and earlier version, the arguments of CASE statement is limit to 255 and it does not support exceed over 255 and hence error return if it exceed. However in Oracle 10.2.0.4 and later the arguments limit of CASE statement has increased to 32767. Solution of the Problem Opt

How to determine the name of the trace file to be generated

In many cases we need to find out the name of the latest trace file generated in the USER_DUMP_DEST directory. What we usually do is go to physically to the USER_DUMP_DEST with the operating system browser and sort all the files by date and look for latest files. We can remove this hassle easily if we know what would be the trace file name in advance. For example issuing, D:\>sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jun 10 21:58:15 2009 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> alter database backup controlfile to trace; Database altered. SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE; will generated a trace file inside USER_DUMP_DEST. Let's see the location of USER_DUMP_DEST. If you use Sql*plus then issue, SQL> show parameter user_dump_dest NAME TYPE

ORA-27100: shared memory realm already exists

However if you merely see ORA-27100 error upon startup then proceed with this post. Problem Description When you try to startup your database instance even you issue startup nomount ORA-27100 is reported. SQL> startup nomount ORA-27100: shared memory realm already exists Similarly, if you try to shutdown your oracle instance then ORA-27100 is reported. SQL> shutdown immediate ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Restarting the service also does not help any. And even in some cases, rebooting the server does not help as well. Current Changes in the Server We had sga_max_size to 600M and then we change it to 1G. After that whenever we restart oracle database above message rises. Cause of the Problem Some changes are made in sga_max_size or sga parameters. After that database is abnormally shut down whenever you issue startup, ORA-27100 is received as a result of changes made to parameters affecting the SGA size. Solution of the Problem In mo