Thursday, December 4, 2008

V$BH

V$BH displays the status and number of pings for every buffer in the SGA. This is a Real Application Clusters view.

Column

Datatype

Description

FILE#

NUMBER

Datafile identifier number (to find the filename, query DBA_DATA_FILES or V$DBFILE)

BLOCK#

NUMBER

Block number

CLASS#

NUMBER

Class number

STATUS

VARCHAR2(6)

Status of the buffer:

· free - Not currently in use

· xcur - Exclusive

· scur - Shared current

· cr - Consistent read

· read - Being read from disk

· mrec - In media recovery mode

· irec - In instance recovery mode

XNC

NUMBER

Number of PCM x to null lock conversions due to contention with another instance. This column is obsolete and maintained for backward compatibility.

LOCK_ELEMENT_ADDR

RAW(4 | 8)

Address of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock.

LOCK_ELEMENT_NAME

NUMBER

The address of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock.

LOCK_ELEMENT_CLASS

NUMBER

The address of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock.

FORCED_READS

NUMBER

Number of times the block had to be reread from the cache because another instance has forced it out of this instance's cache by requesting the lock on the block in exclusive mode

FORCED_WRITES

NUMBER

Number of times GCS had to write this block to cache because this instance had used the block and another instance had requested the lock on the block in a conflicting mode

DIRTY

VARCHAR2(1)

Y - block modified

TEMP

VARCHAR2(1)

Y - temporary block

PING

VARCHAR2(1)

Y - block pinged

STALE

VARCHAR2(1)

Y - block is stale

DIRECT

VARCHAR2(1)

Y - direct block

NEW

VARCHAR2(1)

Always set to N. This column is obsolete and maintained for backward compatibility.

OBJD

NUMBER

Database object number of the block that the buffer represents

TS#

NUMBER

Tablespace number of block

Note:

1. select * from V$BH WHERE FILE#=16;

FILE#

BLOCK#

CLASS#

STATUS

XNC

FORCED_

READS

FORCED_

WRITES

LOCK_

ELEMENT_

ADDR

DIRTY

TEMP

PING

STALE

DIRECT

NEW

OBJD

TS#

16

3

12

xcur

0

0

0

00

N

N

N

N

N

N

4294967295

16

16

2

13

xcur

0

0

0

00

N

N

N

N

N

N

4294967295

16

2. V$BH shows the contents of the data buffers as well as the number of blocks for each type of segment in the buffer. It is especially useful for showing the amount of table and index caching in databases with multiple data buffer pools. The following script taken from Inside the Oracle data buffer cache analyzes the contents of data buffers.

set pages 999
set lines 92
 
ttitle 'Contents of Data Buffers'
 
drop table t1;
 
create table t1 as
select
   o.owner          owner,
   o.object_name    object_name,
   o.subobject_name subobject_name,
   o.object_type    object_type,
   count(distinct file# || block#)         num_blocks
from
   dba_objects  o,
   v$bh         bh
where
   o.data_object_id  = bh.objd
and
   o.owner not in ('SYS','SYSTEM')
and
   bh.status != 'free'
group by
   o.owner,
   o.object_name,
   o.subobject_name,
   o.object_type
order by
   count(distinct file# || block#) desc
;
 
column c0 heading "Owner"                                    format a12
column c1 heading "Object|Name"                              format a30
column c2 heading "Object|Type"                              format a8
column c3 heading "Number of|Blocks in|Buffer|Cache"         format 99,999,999
column c4 heading "Percentage|of object|blocks in|Buffer"    format 999
column c5 heading "Buffer|Pool"                              format a7
column c6 heading "Block|Size"                               format 99,999
 
select
   t1.owner                                          c0,
   object_name                                       c1,
   case when object_type = 'TABLE PARTITION' then 'TAB PART'
        when object_type = 'INDEX PARTITION' then 'IDX PART'
        else object_type end c2,
   sum(num_blocks)                                     c3,
   (sum(num_blocks)/greatest(sum(blocks), .001))*100 c4,
   buffer_pool                                       c5,
   sum(bytes)/sum(blocks)                            c6
from
   t1,
   dba_segments s
where
   s.segment_name = t1.object_name
and
   s.owner = t1.owner
and
   s.segment_type = t1.object_type
and
   nvl(s.partition_name,'-') = nvl(t1.subobject_name,'-')
group by
   t1.owner,
   object_name,
   object_type,
   buffer_pool
having
   sum(num_blocks) > 10
order by
   sum(num_blocks) desc
;

Oracle data dictionary views

Oracle dynamic performance views

V$ACTIVE_SESS_POOL_MTH

Thank you for visiting Spatial DBA - Oracle and ArcSDE.

I have stopped updating the blog.

Please visit Oracle DBA Tips (http://www.oracledbatips.com) for more Oracle DBA Tips.

===================================================================



V$ACTIVE_SESS_POOL_MTH displays available active session pool resource allocation methods.

Column
Datatype
Description
NAME
VARCHAR2(40)
Name of the active session pool resource allocation method
Note:
1. select * from V$ACTIVE_SESS_POOL_MTH;
NAME
ACTIVE_SESS_POOL_ABSOLUTE
2. Views used to monitor resource manager usage include the following:
View
Description
DBA_RSRC_CONSUMER_GROUP_PRIVS
USER_RSRC_CONSUMER_GROUP_PRIVS
DBA view lists all resource consumer groups and the users and roles to which they have been granted. USER view lists all resource consumer groups granted to the user.
DBA_RSRC_CONSUMER_GROUPS
Lists all resource consumer groups that exist in the database. Resource Manager system privileges. USER view lists all the users that are granted system privileges for the DBMS_RESOURCE_MANAGER package.
DBA_RSRC_MANAGER_SYSTEM_PRIVS
USER_RSRC_MANAGER_SYSTEM_PRIVS
DBA view lists all users and roles that have been granted Database
DBA_RSRC_PLAN_DIRECTIVES
Lists all resource plan directives that exist in the database.
DBA_RSRC_PLANS
List all resource plans that exist in the database.
DBA_USERS
USERS_USERS
DBA view contains information about all users of the database. Specifically, for the Database Resource Manager, it contains the initial resource consumer group for the user. USER view contains information about the current user, and specifically, for the Database Resource Manager, it contains the current user's initial resource consumer group.
V$ACTIVE_SESS_POOL_MTH
Displays all available active session pool resource allocation methods.
V$PARALLEL_DEGREE_LIMIT_MTH
Displays all available parallel degree limit resource allocation methods.
V$QUEUEING
Displays all available queuing resource allocation methods.
V$RSRC_CONSUMER_GROUP
Displays information about active resource consumer groups. This view can be used for tuning.
V$RSRC_CONSUMER_GROUP_CPU_MTH
Displays all available CPU resource allocation methods for resource consumer groups.
V$RSRC_PLAN
Displays the names of all currently active resource plans.
V$RSRC_PLAN_CPU_MTH
Displays all available CPU resource allocation methods for resource plans.
V$SESSION
Lists session information for each current session. Specifically, lists the name of each current session's resource consumer group.

Oracle data dictionary views

V$ACTIVE_SERVICES

V$ACTIVE_SERVICES displays information about the active services in the database.

Column

Datatype

Description

SERVICE_ID

NUMBER

Service ID

NAME

VARCHAR2(64)

Name of the service

NAME_HASH

NUMBER

Service name hash

NETWORK_NAME

VARCHAR2(512)

Network name

CREATION_DATE

DATE

Creation date

CREATION_DATE_HASH

NUMBER

Creation date hash

GOAL

VARCHAR2(12)

Service workload management goal:

· NONE

· SERVICE_TIME

· THROUGHPUT

DTP

VARCHAR2(1)

Indicates whether the service is for DTP or distributed transactions including XA transactions (Y) or not (N)

BLOCKED

VARCHAR2(3)

Indicates whether a service on the specified instance is blocked from accepting new connections altogether (YES) or not (NO). If a service is blocked, then all connections will be directed to other instances (if any) that are hosting the desired service.

AQ_HA_NOTIFICATION

VARCHAR2(3)

Indicates whether AQ notifications are sent for HA events (YES) or not (NO)

CLB_GOAL

VARCHAR2(5)

Connection load balancing goal used with statistics that are sent to the listeners to determine how new connections are distributed:

· LONG

· SHORT

Note:

1.

select * from V$ACTIVE_SERVICES;

SERVICE_ID

NAME

NAM_

HASH

NETWORK_

NAME

CREATION_

DATE

CREATION_

DATE_

HASH

GOAL

DTP

BLOCKED

AQ_

HA_

NOTIFICATION

CLB_

GOAL

3

mydbXDB

1119650025

mydbXDB

2006-06-10 11:46:21 AM

168918946

NONE

N

NO

NO

LONG

4

mydb.env.gov.bc.ca

720991384

mydb.env.gov.bc.ca

2006-06-10 11:46:21 AM

168918946

NONE

N

NO

NO

LONG

1

SYS$BACKGROUND

165959219

2006-06-10 9:31:34 AM

0

NONE

N

NO

NO

SHORT

2

SYS$USERS

3427055676

2006-06-10 9:31:34 AM

18489460

NONE

N

NO

NO

SHORT

Oracle data dictionary views

Oracle dynamic performance views

V$ACTIVE_INSTANCES

V$ACTIVE_INSTANCES displays the mapping between instance names and instance numbers for all instances that have the database currently mounted.

Column

Datatype

Description

INST_NUMBER

NUMBER

Instance number

INST_NAME

VARCHAR2(60)

Instance name

Note:

1. This view is ONLY populated in Real Application Clusters mode (or in Parallel Server mode in Oracle8i and earlier).

Oracle data dictionary views

Oracle dynamic performance views

V$ACCESS

V$ACCESS displays information about locks that are currently imposed on library cache objects. The locks are imposed to ensure that they are not aged out of the library cache while they are required for SQL execution.

Column

Datatype

Description

SID

NUMBER

Session number that is accessing an object

OWNER

VARCHAR2(64)

Owner of the object

OBJECT

VARCHAR2(1000)

Name of the object

TYPE

VARCHAR2(24)

Type identifier for the object

Note:

1. Use the following script (Metalink note 1020010.6) to report the SQL text of some of the locks currently being held in the database.

select s.username username,  
       a.sid sid,  
       a.owner||'.'||a.object object,  
       s.lockwait,  
       t.sql_text SQL 
from   v$sqltext t,  
       v$session s,  
       v$access a 
where  t.address=s.sql_address  
and    t.hash_value=s.sql_hash_value  
and    s.sid = a.sid  
and    a.owner != 'SYS' 
and    upper(substr(a.object,1,2)) != 'V$';

Oracle data dictionary views

Oracle dynamic performance views