Friday, September 26, 2014

ERROR :: ORA-04030: out of process memory when trying to allocate 16328 bytes

Issue: ORA-04030: out of process memory when trying to allocate 16328 bytes (koh-kghu call ,pl/sql vc2)

Following ORA-04030 error is encountered every time when the PGA allocation reaches 15GB:


The incident trace shows 15G used by pl/sql:
=======================================
TOP 10 MEMORY USES FOR THIS PROCESS
---------------------------------------
100%   15 GB, 1008569 chunks: "pl/sql vc2                "  PL/SQL
        koh-kghu call   ds=fffffc7ffc6f51f8  dsprt=c715710
0%   15 MB, 15763 chunks: "free memory               "
        pga heap        ds=c715710  dsprt=0


This is due to bug 14119856 when real free allocator is used even though pga_aggregate_target is set more than 16GB.
Use below query to check if real free allocator is used:

SQL> col name format a30
col cur_val format a20
select i.ksppinm name , v.ksppstvl cur_val, v.ksppstdf default_val,v.ksppstvf
from x$ksppi i, x$ksppcv v where i.indx = v.indx and i.ksppinm in
('_realfree_heap_pagesize_hint', '_use_realfree_heap');SQL> SQL>   2    3

NAME                           CUR_VAL              DEFAULT_V   KSPPSTVF
------------------------------ -------------------- --------- ----------
_realfree_heap_pagesize_hint   65536                TRUE               0
_use_realfree_heap             TRUE                 TRUE               0


Technique 1:


 Step 1:
Restart the database and  server in order to fix the issue
Or
Change the upper limit at either the OS or at the database level:


Change the page count at the OS level:

by root user,
$ more /proc/sys/vm/max_map_count
$ sysctl -w vm.max_map_count=200000 (for example)

OR at database level,
Adjust the realfree heap pagesize within the database by setting the following parameters in the init/spfile and restart the database.

_use_realfree_heap=TRUE
_realfree_heap_pagesize_hint = 262144
- OR -
Use Workaround:

 Set "_use_realfree_heap=false" and restart database instance.

Or

 Apply patch <="" a="">14119856> if available for your platform and Oracle version or request for a one-off patch.

 Reference  MI note :: Doc ID 1506315.1 and Thanks for the giving time and reading the post .

Thursday, September 25, 2014

ORA-00119: invalid specification for system parameter LOCAL_LISTENER


ERROR  ::   ORA-00119: invalid specification for system parameter LOCAL_LISTENER

Issue: ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_DATABASE NAME'

Couse: 1) You have not made the entry of local listener in TNSNAMES.ora file and parameter is added in spfile or pfile . In order to avoid the above error we have two options as per my understanding (if you have plz comment and share your solution.)

Technique 1:

 Step 1: Make an entry in the tnsnames.ora as mentioned below
LISTENER_<NAME/DATABASE NAME> =
  (ADDRESS = (PROTOCOL = TCP)(HOST = my.host.com)(PORT = 1521))

Where LISTENER_<NAME/DATABASE NAME>  is the parameter value for LOCAL_LISTENER which is mentioned in pfile/spfile
PORT is the listener port you are using.
Also there is no need to modify the pfile/spfile.

Technique 2 :
Step 2:

a)      If you are using a spfile for starting up your database, create a pfile from it and remove the LOCAL_LISTNER parameter and Create spfile from the pfile .
b)      Strat the database .
        sqlplus / as sysdba
              startup ;

c)        start the listener  lsnrctl start


Friday, September 19, 2014

ORA-00845: MEMORY_TARGET not supported on this system and ORA-00093: _shared_pool_reserved_min_alloc must be between 4000 and 0

Database not coming up due to below errors (ORA-00845: MEMORY_TARGET not supported on this system and ORA-00093: _shared_pool_reserved_min_alloc must be between 4000 and 0)

Scene 1)
##########################################
SQL> startup nomount;
ORA-00845: MEMORY_TARGET not supported on this system
SQL> shut abort
ORACLE instance shut down.
SQL> exit
Disconnected

Scene 2)
#########################################
SQL> startup nomount;
ORA-01078: failure in processing system parameters
ORA-00093: _shared_pool_reserved_min_alloc must be between 4000 and 0
SQL> shut abort;
ORACLE instance shut down.
SQL> exit
Disconnected

Scene 3)
#########################################
SQL> startup nomount
ORA-01078: failure in processing system parameters
ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 3072M
SQL>
SQL> exit
Disconnected
#########################################

These are all due to memory Memory related parameter which is not specified as it should be. 

Solution: 
Scene 1) This error always come if /dev/shm FS size is less then memory target parameter.   
To overcome from this situation either increase the /dev/shm to greater than memory target or keep less value of memory target from /dev/shm. 
Other way is to use SGA_MAX_SIZE instead of MEMORY_TARGET. 

Scene 2) This error only came if SGA_MAX_SIZE is set but aggregate value of  individual memory parameter (db_cache_size, shared_pool_size, java_pool_size, stream_pool_size etc..) value is more than SGA_MAX_SIZE
To overcome from this situation either increase the SGA_MAX_SIZE or decrease aggregate value of  individual memory parameter.

Scene 3) in case by mistaken SGA_MAX_SIZE and MEMORY_TARGET both has been define, and SGA_MAX_SIZE is greater than MEMORY_TARGET. 
To overcome from this situation remove or keep size 0  either SGA_MAX_SIZE or MEMORY_TARGET parameter value

[oracle@abcdbhost01 dbs]$ sqlplus '"as sysdba"

SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 10 20:48:05 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>  startup nomount
ORACLE instance started.

Total System Global Area 3340451840 bytes
Fixed Size                  2232960 bytes
Variable Size             771755392 bytes
Database Buffers         2550136832 bytes
Redo Buffers               16326656 bytes
SQL>

Friday, September 5, 2014

Database not starting due to ORA 00205 error in identifying control file

Database not starting up due to ORA-00205 error in identifying control file

SQL> startup
ORACLE instance started.

Total System Global Area 2147483648 bytes
Fixed Size                  2085360 bytes
Variable Size            1040190992 bytes
Database Buffers         1090519040 bytes
Redo Buffers               14688256 bytes
ORA-00205: error in identifying control file, check alert log for more info

If you are getting above error during starting up database,

shutdown the database and check database datafiles and controlfiles file system mount option. 

sometime it is not mounted with nolock option  in mostly linux system. 
run mount command to check current mount option:
mount

If output is like below for FS which contains your datafiles 
xxxxxxxxxxxxxxxxxx:/vol/xxxxxxxxx01/oradata on /oradata type nfs (rw,hard,wsize=32768,rsize=32768,addr=10.20.16.52)

Check FSTAB file
cat /etc/fstab

take backup of fstab  file
sudo cp /etc/fstab /etc/fstab_bkp

change the same entry in fstab
 sudo vi /etc/fstab

edit the /etc/fstab file like below: 
xxxxxxxxxxxxxxxx:/vol/xxxxxxxxxxxxxxxxxoradata /oradata        nfs      rw,nolock,hard,wsize=32768,rsize=32768,actimeo=120,timeo=600,tcp   1 2

Aftet this,  unmount the /oradata FS

sudo umount /oradata

Remount the same:

sudo mount  xxxxxxxxxxxxxxxxxxx:/vol/xxxxxxxxxxxxxx/oradata /oradata

If it doesn't work then 

use mount the same Fs with below comand: 

mount the FS with proper mount option for nfs

sudo mount -t nfs -o rw,nolock,hard,wsize=32768,rsize=32768,actimeo=120,timeo=600,tcp fcgsnprdsng03b:/vol/gemdbval01/oradata /oradata

check again for mount option
 mount

if it looks good this time then 
start the database
  

Convert snapshot standby database to Physical standby database: Dataguard 11gR2

Step 1 SQL> shutdown immediate; Step 2 SQL> startup nomount Step 3 SQL> alter database mount; Step 4 SQL>  ALTER DATABASE CONV...