Tuesday, May 4, 2010

Find out HBA port WWN on Solaris

  • Issue the following command on the host to find out how many HBAs are connected to the host:
    • luxadm -e port 
    • The output will be as under:
      • /devices/pci@0/pci@0/pci@8/pci@0/pci@a/SUNW,qlc@0/fp@0,0:devctl    NOT CONNECTED
      • /devices/pci@0/pci@0/pci@8/pci@0/pci@a/SUNW,qlc@0,1/fp@0,0:devctl  CONNECTED
    • The output shows that one HBA card is connected to the host
  • Issue the following command to get the port numbers and associated WWN for each HBA connected to the host
    • luxadm -e dump_map /devices/pci@0/pci@0/pci@8/pci@0/pci@a/SUNW,qlc@0,1/fp@0,0:devctl 
  •  The sample output is as under:
        Pos  Port_ID Hard_Addr Port WWN         Node WWN         Type 0    170900  0         20030003baccc902 10000003baccc902 0x0  (Disk device) 1    1c0300  0         10000000c9722f33 20000000c9722f33 0x1f (Unknown Type) 2    1f0200  0         20030003ba13e6a1 10000003ba13e6a1 0x0  (Disk device) 3    140300  0         2101001b322f4f21 2001001b322f4f21 0x1f (Unknown Type,Host Bus Adapter)
  • The above output shows that the QLC HBA has two ports  namely 0 and 2 with port  wwn 20030003baccc902 and 20030003ba13e6a1 which can be mapped to the luns on the storage

Wednesday, March 31, 2010

Setting directIO for UFS system

Preferred way to enable directio on Oracle is to set the following option in init.ora

FILESYSTEMIO_OPTIONS = setall


Check out the following to verify if DIRECT IO is enabled in Solaris:

http://developers.sun.com/solaris/articles/solUFSdiskIO.html

Oracle 11g background processes

Oracle 11g process:

  • smon
  • lgwr
  • dbwr (multiple process)
  • chkpt
  • pmon
  • mmon
    • process to collect statistics for AWR
  • mmnl
    • process to perform manageability related task
  • mman
    • process to manage automatic shared memory
  • pnnn (optional)
    • Process for parallel query operations
  • vktm (Virtual keeper of time
    • Process tracks wall-clock time and is used as a reference time counter
  • dia0
    • Diagnostic process to detects and resolve hangs and deadlocks
  • diag
    • Diagnosability capture process for performing diagnostic dumps
  • dbrm
    • Database resource management process
  • psp0
    • Process spawner to spawn oracle process as needed
  • reco
    • recoverer process
  • d000
    • dispatcher process to listen to and receive request from connected sessions
  • s0000
    • shared server process
  • smco
    • Space management co-ordinator ...spawns wnnn proces to carry out the task
  • fbda
    • flashback data archiver process
  • cjq0
    • Job queue process used for batch processing
  • gen0
    • General tak execution process
  • qmnc
    • Advanced queing coordination process. Spawns Qnnn process as needed

Friday, March 26, 2010

Enterprise manager : ERROR: NMO not setuid-root (Unix-only)

I was not able to login as OS user using Enterprise manager 11gR1. I kept getting the following error


ERROR: NMO not setuid-root (Unix-only)

All google results indicate that this error occurs if you have not run root.sh after installation. In my scenario , I verified that I had successfully ran and that nm? binaries in $ORACLE_HOME had the right permission:
-rwsr-s--- 1 root dba 22216 Mar 16 10:37 nmb
-rwsr-s--- 1 root dba 27056 Mar 16 10:37 nmo
-rwsr-s--- 1 root dba 95328 Mar 16 10:37 nmhs

However, I still continued to get the error.

Taking a closer look, I released that the directory which had $ORACLE_HOME installed was mounted with nosetuid options. Fixing that resolved the issue.

Out of memory error while create database

  • Issue prctl $$ command as oracle and root user and ensure that proj.max-shm-mem variable shows the value you need. Else update the /etc/system with the following and reboot the system:
    • set shmsys:shminfo_shmmax=0xb40000000
  • If you do not want to reboot the system, make sure you update the project for both root user and oracle user with prcl commands given below.
  • Create a project named oracle using following command:
    • projadd oracle
  • Verify that project was created
    • projects -l
  • Associate this project with oracle user:
    • Edit /etc/user_attr file and add the following line
      • oracle::::project=oracle (four colon)
  • Verify that project oracle is associated with oracle user:
    • login as oracle user and issue id -p. It should show oracle as project for oracle user.
  • Check the existing value of shared memory variable for this project:
    • prctl -n project.max-shm-memory -i project oracle
  • To set it to a different value:
    • To set the value dynamically for the given session...will be lost after reboot
      •  prctl -n project.max-shm-memory -v 40G -r -i project oracle
    • To set it in /etc/project file so it is persistent across reboot
      • # projmod -s -K "project.max-shm-memory=(priv,4gb,deny)" oracle

Setting up DBConsole for a database

  • Verify if dbsnmp user exist:
    • select * from all_users where username= 'DBSNMP'
  • Grant users the right privileges:
    • alter user DBSNMP identified by "<new password>" ;
    • alter user DBSNMP account unlock ;
  • Ensure remote login is enabled
    • Ensure REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE is set in the init.ora for the database
      •  show parameters remote% ;
    • Ensure password file exist in $ORACLE_HOME/dbs. Else create it as under: 
    • $ orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=< some password> entries= 5
  • Create DBConsole along with repos:
    • emca -config dbcontrol db -repos create
  • For additional info refer to
  • Verify that dbconsole is up and running
    • emctl status dbconsole
      If you recreated the db, just recreate the dbcontrol repos as under:
      emca -config dbcontrol db -repos recreate
    • If db console is running on your server, you can access EM through browser as under:

Wednesday, March 17, 2010

Location of log files in Oracle 11g

Log Location
  • Foreground process traces: $ADR_HOME/trace
  • Background process traces : $ADR_HOME/trace
  • Alert Log data : $ADR_HOME/alert and trace
  • Core dumps: $ADR_HOME/cdump
  • Incident dumps : $ADR_HOME/incident/incdir_n
  • ADR_ROOT or ADR_BASE is set to $DIAGNOSTIC_DEST initialization parameter. If this parameter is not set, the database sets $DIAGNOSTIC_DEST to $ORACLE_BASE if this variable is set. Else it sets it to $ORACLE_HOME/log
  • ADR_HOME for database is set to ADR_ROOT/diag/rdbms/DB_NAME/ORACLE_SID
  • You can find out the location of all ADR variables by following sql query
    • sql > select * from V$DIAG_INFO ;