Monday, August 8, 2011

MMAN Statistics

Some background on memory broker:

The Automatic Shared Memory Management feature uses background process named Memory Manager (MMAN).MMAN serves as the SGA Memory Broker and coordinates the sizing of the memory components. The SGA Memory Broker keeps track of the sizes of the components and pending resize operations.There is not so many document on this process but here is some help:

Let’s see what is MMAN responsible for :
SQL> select substr(DEST,1,10) DEST, DESCRIPTION from x$messages where DEST=’MMAN’;

DEST DESCRIPTION
—————————— ——————————————————–
MMAN lock memory at startup
MMAN lock memory timeout action
MMAN Memory Management
MMAN Complete deferred initialization of components
MMAN Handle sga_target resize
MMAN Handle mem_target resize
MMAN Handle sga_target deferred request delete
MMAN Reset advisory pool when advisory turned ON

The SGA Memory Broker keeps track of the sizes of the components and pending resize operations.

We can dump memory broker statistics into trace file using

oradebug dump DUMP_ADV_SNAPSHOTS command e.g.
SQL> oradebug setmypid
SQL> oradebug dump DUMP_ADV_SNAPSHOTS 0

Default value for memory broker statistis is 30 sec.It is controled by underscore parameter

_memory_broker_stat_interval 30 memory broker statistics gathering interval for auto sga

and can be changed with alter system command e.g.

alter system set “_memory_broker_stat_interval”=60 scope=both sid=’demo1′; will change gathering interval to one minute.

New snapshot will be generated after _memory_broker_stat_interval expires.

Trace file has various statistics for diffrent SGA components.Note snapshots numbers and timestamp.

Processing Oradebug command ‘dump DUMP_ADV_SNAPSHOTS 0′
Dumping memory broker statistics snapshots 5677
0: ———————————————————–
Stats Entry #5646 taken at timestamp 671200759
Stat Value
——————————-
DB time 355973
DEFAULT cache read count 33608
DEFAULT cache read time 227
shared pool load count 24336
shared pool load time 53486
java pool load count 422
java pool load time 11
shared io pool wait time 0
Component Granules
——————————-
DEFAULT cache 70
Shared Pool 33
Large Pool 1
Java Pool 2
SGA Target 107
PGA Target 72
Default Cache Advice Version=12 Start Index of Version=9
Default Cache Granules -> Estimated Read Time
———————————————–
———————————————–
7 -> 364, 14 -> 275, 21 -> 235, 28 -> 227, 35 -> 227, 42 -> 227, 49 -> 227, 56 -> 227, 63 -> 227, 70 -> 227, 77 -> 227, 84 -> 227, 91 -> 227, 98
-> 227, 105 -> 227, 112 -> 227, 119 -> 227, 126 -> 227, 133 -> 227, 140 -> 227
Shared Pool Advice Version=16 Start Index of Version=9
Shared Pool Granules -> Estimated Load Time
———————————————–
25 -> 3590, 29 -> 1856, 33 -> 195, 37 -> 1, 41 -> 1, 45 -> 1, 49 -> 1, 53 -> 1, 57 -> 1, 61 -> 1, 65 -> 1, 69 -> 1
Java Pool Advice Version=2 Start Index of Version=20
Java Pool Granules -> Estimated Load Time
———————————————–
1 -> 195, 2 -> 195, 3 -> 195, 4 -> 195
PGA Target Advice Version=1 Start Index of Version=0
PGA Granules -> Estimated PGA Processing Time
———————————————–
9 -> 11962649, 18 -> 11886641, 36 -> 11886641, 54 -> 11886641, 72 -> 11886641, 86 -> 11886641, 100 -> 11886641, 115 -> 11886641, 129 -> 11886641,
144 -> 11886641, 216 -> 11886641, 288 -> 11886641, 432 -> 11886641, 576 -> 11886641
————————————————————-
1: ———————————————————–
Stats Entry #5677 taken at timestamp 671202561

Want to know how to get the SQLPLUS command history

If you are running sqlplus or RMAN on Windows than you can use upper arrow to get history.What about linux?

First option:

1) Install readline wrapper:

yum install rlwrap

2) Change .bashrc and make alias :

alias sqlplus=’rlwrap sqlplus’ alias rman=’rlwrap rman’

The other option is to install qqlplus which you can find on the link

http://gqlplus.sourceforge.net/

I tried it on my Oracle 11 running Linux 64bit and did not work.I used already made executable under Linux folder ( included into compressed source file ) but I am sure this can be fixed by comipiling source code.

How to trace Oralce Data Gaurd

Data Guard Broker (DGMGRL) can connect to database using following options:

-echo
-silent
-xml
-debug
-logfile

So if I need to run dgmgrl command in debug mode I would execute following :

dgmgrl -debug / or

-bash-3.2$ dgmgrl -debug sys/secret@test

DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
[W000 01/05 12:27:03.81] Connecting to database using test.
[W000 01/05 12:27:03.85] Executing query [select dbms_drs.dg_broker_info('VERSION') from dual].
[W000 01/05 12:27:03.86] Query result is '11.2.0.1.0'
Connected.
or dgmgrl -debug / shutdown command will shutdown instance ,generate trace file and then exit.

If Data Guard Broker is used then tracing can be enabled using DGMGRL command
and setting property LogArchiveTrace to value other than 0.

/** Tracing primary site **/

DGMGRL> edit database ‘primary_db_name’ set property LogArchiveTrace=’1′;

/** Tracing standby site **/

DGMGRL> edit database ‘standby_db_name’ set property LogArchiveTrace=’1′;

Also this parameter can be set by issueing a SQL statement :

SQL> ALTER SYSTEM SET LOG_ARCHIVE_TRACE=1;

Values are described in table bellow:

Level Meaning
0 Disables archived redo log tracing (default setting)
1 Tracks archiving of log files
2 Tracks archive status by archive log file destination
4 Tracks archive operational phase
8 Tracks archive log destination activity
16 Tracks detailed archive log destination activity
32 Tracks archive log destination parameter modifications
64 Tracks ARCn process state activity
128 Tracks FAL server process activity
256 Tracks RFS Logical Client
512 Tracks LGWR redo shipping network activity
1024 Tracks RFS physical client
2048 Tracks RFS/ARCn ping heartbeat
4096 Tracks real-time apply activity
8192 Tracks Redo Apply activity (media recovery or physical standby)

After a long time I am updating my blog.

After a long time I am updating my blog.

Thanks for the mail. Which waked me up from my hot seat.

Thanks for the one who sent that mail.