Tuesday, August 4, 2009

How to generate AWR Report for all instances in Oracle 11g RAC?

spawrrac.sql:This script generates a global AWR report to report performance statistics on all nodes of a cluster.

Different Object types in Oracle 11g DB

Different Object types in Oracle 11g DB:
1 = INDEX,
2 = TABLE,
3 = CLUSTER,
4 = VIEW,
5 = SYNONYM,
6 = SEQUENCE,
7 = PROCEDURE,
8 = FUNCTION,
9 = PACKAGE,
10 = NON-EXISTENT,
11 = PACKAGE BODY,
12 = TRIGGER,
13 = TYPE,
14 = TYPE BODY,
19 = TABLE PARTITION,
20 = INDEX PARTITION,
21 = LOB,
22 = LIBRARY,
23 = DIRECTORY ,
24 = QUEUE,
25 = IOT,
26 = REPLICATION OBJECT GROUP,
27 = REPLICATION PROPAGATOR,
28 = JAVA SOURCE,
29 = JAVA CLASS,
30 = JAVA RESOURCE,
31 = JAVA JAR,
32 = INDEXTYPE,
33 = OPERATOR ,
34 = TABLE SUBPARTITION,
35 = INDEX SUBPARTITION
82 = (Data Mining) MODEL
92 = OLAP CUBE DIMENSION,
93 = OLAP CUBE ,
94 = OLAP MEASURE FOLDER,
95 = OLAP CUBE BUILD PROCESS


Source: 11g: dcore.bsq . The object types 92-95 are newly introduced in 11g DB for "On-line Analytical Processing".
Futher detail visit site: "http://www.oracle.com/technology/products/bi/olap/index.html"

Oracle 11g DB locks Details

Oracle 11g DB locks Details:

Lock type:
'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table',

Lock Mode:
0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Exclusive', /* X */
blocking_others:
0, 'Not Blocking', /* Not blocking any other processes */
1, 'Blocking', /* This lock blocks other processes */
2, 'Global', /* This lock is global, so we can't tell */
to_char(block)) blocking_others

DBA_LOCK_INTERNAL has a row for each lock or latch that is being held, and
one row for each outstanding request for a lock or latch.
The columns of DBA_LOCK_INTERNAL are:
session_id - session holding or acquiring the lock
type - type of lock (DDL, LATCH, etc.)
mode_held - mode the lock is currently held in by the session
mode_requested - mode that the lock is being requested in by the process
lock_id1 - type specific identifier of the lock
lock_id2 - type specific identifier of the lock

Important objects to view lock monitoring: DBA_KGLLOCK, DBA_LOCKS, DBA_LOCK_INTERNAL, DBA_DML_LOCKS, DBA_DDL_LOCKS, DBA_WAITERS, DBA_BLOCKERS, V$LOCK, V$LOCKED_OBJECT,
V$$SESSION_WAIT,V$RESOURCE_LIMIT, V$lock_element, V$lock_activity,v$locks_with_collisions

Further Details can be found in $ORACLE_HOME/rdbms/admin/catblock.sql

Tuesday, April 14, 2009

enable only sftp for identied user and disable ssh

Goal: only allow sftp to list of users and disable ssh.

Generally if ssh is enable, user can do both ssh as well as sftp. But some time business need that list of user should be able to do the sftp only and ssh for these users should be disabled.

1. To achieve this check openssh is installed on you unix box.

2. Start ssh service "/etc/init.d/sshd start"

2. Run command "env|grep -i shell" to find the default shell for user.

3. find the path of sftp-server in /usr/lib. (in my env. OEL5 path is /usr/libexec/openssh/sftp-server)

4. Run cammand to change the shell for user:
usermod -s /usr/libexec/openssh/sftp-server

5. now try to do the ssh with this user
ssh @localhost

This will not work.

6. Now try sftp @localhost

This will work.


After this user will be able to do only sftp and ssh would not work for these users for which login shell has been changed.

Thursday, July 31, 2008

How to set Display for local ip on RHEL5/OEL5

1. Check the current display setting:
echo $DISPLAY
:0.0
2. With this xclock will work.
3. Now suppose we have local m/c ip-address: 10.1.12.55
4. Set the display as
export $DISPLAY=10.1.12.55:0.0
5. Xclock
Can't open display on 10.1.12.55
6. set DISPLAY to :0.0
export DISPLAY=:0.0
7. Start gdmsetup, go to security , un-check the "Deny TCP connections to Xserver"
8. reeboot or restart gdm :
gdm-restart
9. Now set display as localip:
export DISPLAY=10.1.12.55:0.0
10. run xclock