Search This Blog

Total Pageviews

Thursday 8 September 2011

Oracle process / processes , sessions and transactions


Oracle process / processes  , sessions  and transactions .


Oracle backgrounds (give them 25) plus your user sessions (number of shared servers/dedicated servers),
number of job processes/aq processes you want to permit, parallel execution servers if applicable.

Select count(*) from v$process where BACKGROUND=1;

COUNT(*)
----------
25



PROCESSES = Operating System Dependant
SESSIONS = (1.1 * PROCESSES) + 5
TRANSACTIONS = 1.1 * SESSIONS


processes (x) = based on your system
sessions (s ) = x*1.1+5
transactions = s * 1.1




Sql command to increase the value

alter system set PROCESSES=100 scope=SPFILE;
alter system set SESSIONS=115 scope=SPFILE;
alter system set TRANSACTIONS=126 scope=SPFILE;


set pages 100  feed off echo offt verify off
col resource_name        head "Resource" for a30
col current_utilization  head "Current" for 99999
col max_utilization      head "Max" for 999999999
col initial_allocation   head "initial" for a10
col limit_value          head "Limit" for a10
--spool resource_limits.lis
ttitle 'Resource Limits'
select resource_name resource_name,current_utilization current_utilization,max_utilization max_utilization,initial_allocation initial_allocation,limit_value limit_value
from v$resource_limit;


 netstat -apn | grep 1521 | grep TIME | wc -l


to check file open 
for i in `ps -ef|grep -i ora_ | awk '{ print $2 }'` ; do echo "PID # ${i} open files count : $(sudo ls -l /proc/${i}/fd | wc -l)" ; done

in file 
for i in `ps -ef|grep -i ora_ | awk '{ print $2 }'` ; do echo "PID # ${i} open files count : $(sudo ls -l /proc/${i}/fd | wc -l)" ; done > file.txt


Resource Current Max initial Limit
------------------------------ ------- ---- ---------- ----------
processes 29 49 150 150
sessions 37 67 247 247
enqueue_locks 20 57 3010 3010
enqueue_resources 19 55 1304 UNLIMITED
ges_procs 0 0 0 0
ges_ress 0 0 0 UNLIMITED
ges_locks 0 0 0 UNLIMITED
ges_cache_ress 0 0 0 UNLIMITED
ges_reg_msgs 0 0 0 UNLIMITED
ges_big_msgs 0 0 0 UNLIMITED
ges_rsv_msgs 0 0 0 0
gcs_resources 0 0 0 0
gcs_shadows 0 0 0 0
dml_locks 0 0 1084 UNLIMITED
temporary_table_locks 0 3 UNLIMITED UNLIMITED
transactions 0 0 271 UNLIMITED
branches 0 0 271 UNLIMITED
cmtcallbk 0 3 271 UNLIMITED
max_rollback_segments 11 11 271 65535
sort_segment_locks 0 10 UNLIMITED UNLIMITED
k2q_locks 0 0 494 UNLIMITED
max_shared_servers 1 1 UNLIMITED UNLIMITED
parallel_max_servers 0 0 10 3600


col resource_name format a15 heading "Parameters"
col max_utilization format 99999 heading "Max Value Reached"
col current_utilization format 99999 heading "Current Value"
col initial_allocation format a10 heading "SPFILE Value"
SELECT upper(resource_name) as resource_name,current_utilization,max_utilization,initial_allocation FROM v$resource_limit
WHERE resource_name in ('processes', 'sessions');


Parameters Current Value Max Value Reached SPFILE Val
--------------- ------------- ----------------- ----------
PROCESSES 29 49 150
SESSIONS 37 67 247


SQL> select name, value from v$sysstat where name like '%logon%';

NAME VALUE
---------------------------------------------------------------- ----------
logons cumulative 86871
logons current 26


Note what Metalink Note:187405.1 and Note:184821.1


unix parameter

oracle@apt-amd-02:~> cat /proc/sys/kernel/sem
250 32000 100 128
SEMMSL SEMMNS SEMOPM SEMMNI

These values represent SEMMSL, SEMMNS, SEMOPM, and SEMMNI.


SEMMSL = The maximum number of sempahores that can be in one semaphore set. It should be same size as maximum number
of Oracle processes (The PROCESSES parameter in the init.ora file).

SEMMNS Parameter = SEMMSL * SEMMNI (250*128=32000)

SEMOPM = Oracle recommends to set SEMOPM to a minimum value of 100 for 9i R2 and 10g R1/R2 databases on x86 and x86-64 platforms

SEMMNI = Oracle recommends SEMMNI to be at least 128 for 9i R2 and 10g R1/R2 databases except for 9i R2 on x86 platforms where the
minimum value is lower. Since these recommendations are minimum settings, it's best to set it always to at least 128 for 9i and 10g databases on x86 and x86-64 platforms.


oracle@apt-amd-02:~> ipcs -a

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 262144 root 644 80 2
0x00000000 294913 root 644 16384 2
0x00000000 327682 root 644 280 2
0x00000000 819211 oracle 660 4096 0
0x00000000 851980 oracle 660 4096 0
0x8e5a1228 884749 oracle 660 4096 0

------ Semaphore Arrays --------
key semid owner perms nsems
0xa5e152d8 327682 oracle 660 154

------ Message Queues --------
key msqid owner perms used-bytes messages



all shared memory segments that are allocated on the system


oracle@apt-amd-02:~> ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 262144 root 644 80 2
0x00000000 294913 root 644 16384 2
0x00000000 327682 root 644 280 2
0x00000000 819211 oracle 660 4096 0
0x00000000 851980 oracle 660 4096 0
0x8e5a1228 884749 oracle 660 4096 0




oracle@apt-amd-02:~> ipcs -m -i 819211

Shared memory Segment shmid=819211
uid=1001 gid=1000 cuid=1001 cgid=1000
mode=0660 access_perms=0660
bytes=4096 lpid=23741 cpid=5902 nattch=0
att_time=Thu Sep 8 08:40:00 2011
det_time=Thu Sep 8 08:40:00 2011
change_time=Mon Aug 1 08:09:25 2011



to delete the memory

oracle@apt-amd-02:~> ipcrm shm 819211
resource(s) deleted




oracle@apt-amd-02:~> ipcrm shm 819211
resource(s) deleted
oracle@apt-amd-02:~> sysresv
skgm error 27124: errno = 22, info = 3, 884749, 0, 0, 884749, 0, 4

IPC Resources for ORACLE_SID "orcl" :
Shared Memory
ID KEY
No shared memory segments used
Semaphores:
ID KEY
327682 0xa5e152d8
Oracle Instance not alive for sid "orcl"


oracle@apt-amd-02:~> sysresv -i
skgm error 27124: errno = 22, info = 3, 884749, 0, 0, 884749, 0, 4

IPC Resources for ORACLE_SID "orcl" :
Shared Memory
ID KEY
No shared memory segments used
Semaphores:
ID KEY
327682 0xa5e152d8
Oracle Instance not alive for sid "orcl"
Remove ipc resources for sid "orcl" (y/n)?y
Done removing ipc resources for sid "orcl"

semaphore settings, run:

ipcs -ls


oracle@apt-amd-02:~> ipcs -ls

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 100
semaphore max value = 32767


No comments:

Oracle DBA

anuj blog Archive