Sunday, November 13, 2011

Oracle RAC installation in Solaris 11 Container

Here are the steps to create a containers on Solaris 11 to install Oracle RAC:


  • If the Servers do not enough physical NICs
    • Virtualize the NICs
  •  Create VNICs for public and private interface
    • dladm create-vnic -l igb0 vnic5
    •  dladm create-vnic -l igb2 priv5
  •  Create an exclusive IP container with these interfaces
    • set ip-type=exclusive
    •  add net set physical=vnic5 end
    •  add net set physical= priv5 end
  •     Setup private and public interface
    •  Ipadm show-if
    •  Ipadm create-ip priv5
    •  Ipadm create-addr -T static -a 199.6.6.6/24 priv5/v4addr
    •  Ipadm show-addr
  •  No need to update any /etc files with hostname if ipadm command is used
  •  Configure shared memory
    •  Set max-shm-memory=50G
  • Add ASM device/s to the zone
    • Add Device:
      • Set match: <device name>
      • Set allow-partition=true
      • Set allow-raw-io=true
    • End
  •  Provide right privileges to the container
    •  Set limitpriv=default,proc_priocntl
  •  Install RAC as you install in global container



Suppose you need to create a container that uses  igb0 as public interface and igb2 as private interface for Oracle RAC installation. It uses a pool with one CPU in it and mounts 2 FS. This blog summarizes the steps to create such a container.
  • Create the VNICs for public and private interface
From the global container create VNICs from public interface igb0 and for  private interface igb2
  • # dladm create-vnic -l igb0 vnic5
  • # dladm create-vnic -l igb2 priv5

  •  Create a pool with one CPU in it:
poolcfg -c 'create pset rac5_set(uint pset.min=1;uint pset.max=1)'
poolcfg -c ' create pool rac5Pool'
poolcfg -c 'associate pool rac5Pool (pset rac1_set)'
 poolcfg -c 'transfer to pset rac5_set(cpu 4)'
pooladm -c
pooladm

Check out http://ritukamboj.blogspot.com/search/label/ResourcePool for more info.
  • Create a zone:
Create racZone5 directory under /zonepools/zones and issue the following command:
  • zonecfg -z racZone5 -f zonetemplate.cfg
where zonetemplate.cfg is as under

create
set zonepath=/zonepools/zones/racZone5
set autoboot=false
set limitpriv=default,proc_priocntl
set ip-type=exclusive
add net
set physical=vnic5
end
add net
set physical= priv5
end
set max-shm-memory=50G
add fs
set dir=/u05
set special=/u05
set type=lofs
end
add fs
set dir=/installer
set special=/installer
set type=lofs
end
set pool=rac5Pool
Run
  • zoneadm -z racZone5 install
  • zoneadm -z racZone5 boot
  • zlogin -C racZone5 (for inital configuration)


  • Verify that you can see the VNICS in the container
root@etchst8-zone22:~# dladm show-link
LINK                CLASS     MTU    STATE    OVER
vnic5               vnic      1500   up       ?
priv5               vnic      1500   up       ?
root@etchst8-zone22:~# ^C
  • Verify that public interface NIC is plumped up (through initial configuration)
root@etchst8-zone23:~# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --
vnic6      ip       ok       yes    --
  • Plump the private interface

  • ipadm show-if
  •  ipadm create-ip priv6
  • ipadm create-addr -T static -a 199.6.6.6/24 priv6/v4addr
root@etchst8-zone23:~# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
vnic6/v4          static   ok           10.6.138.55/24
priv6/v4addr      static   duplicate    199.6.6.6/24
lo0/v6            static   ok           ::1/128
vnic6/v6          addrconf ok           fe80::8:20ff:fe31:49c4/10
 Create Oracle user and required directories for Oracle installation

Tuesday, October 18, 2011

Backup and recovery concepts

RMAN environment


The RMAN environment consist of following components:

Required components:
  • RMAN client : The client application that manages the backup and recovery of target database.
  • target database: A database that RMAN backs up and restores

Optional components:

  • recovery catalogy database:
  • recovery catalog schema
  • physical standby database
  • duplicate database: a copy of the primary database that you can use for testing purposes
  • fast recovery area:
  • media manager:
  • media mangement catalog


RMAN channels


The RMAN client itself does not perform backup, restore or recovery opertations. When you connect the RMAN client to a target database, RMAN allocates server sessions on the target instance and directs them to perfom the operations.

The RMAN channel corresponds to a one database server session. It represents one stream of data to a device.

A channel establishes a connection from the RMAN client to a target or auxiallary database instance by starting a server session on the instance.

The RMAN supported device types are disk and SBT (system backup to tape). An SBT device is controlled by third party media manager.


The RMAN channels can be allocated either automatically or manually .

You can enable automatic channel allocation by using configure_channel command. . When you run a command that can use automatic channels, RMAN automatically allocates the channels with the options you specified in configure_channel command. RMAN determines the names for the automatic channels. RMAN comes preconfigured with DISK channel that you can use for backups to disk.

You can manually allocate channels as well. You give user defined names to manually created channels.

The number of channels available for use with a device determines whether RMAN reads from or write to this device in parallel or not. In parallelism, the back up of the file is performed by more than one channel. Each channel may back up more than one file but unless a multisection backup is performed, no file is backed up by more than one channel.

RMAN Backup Options


You can backup your database using "BACKUP" command. RMAN determines backup options based on RMAN environment and RMAN defaults.

This table summarizes the RMAN options and their default values:

Backup Option Default Value All possible values Example Note
Device type Value set in CONFIGURE_DEFAULT_DEVICE_TYPE Device type can be disk or SBT BACKUP Database
device type disk
(or) device type SBT

Backup type By default , RMAN creates backup sets Backup type can be backupset or image copy Backup as copy
(or) backup as backupset

File Format

format "/disk1/backup_%U" (file location)
(or) format 'tdgroup' (ASM group)

































Overview of RMAN backups

When you issue BACKUP command the following files are backed up:

  • Datafiles and control files
  • Server parameter files
  • Archived redo logs
  • RMAN backups
Network configuration files, password files , contents of Oracle home are not backed up with RMAN.

The backups created can either be consistent or in-consistent.

The entire database can be backup ed with "backup database" command. The database should either be mounted or open for backup to succeed.

Backing up tablespaces and datafiles:


If you want to backup only certain tablespaces or datafiles, you can issue BACKUP TABLESPACES or BACKUP DATAFILES command. When you specify tablespaces, RMAN translates the tablespace name internally into a list of datafiles.

RMAN automatically backs up control file and server parameter file when datafile 1 is included in the backup. If the control file autobackup is enabled , then RMAN writes the current control file and server parameter file to a seperate autobackup piece.

Backing up control files :

If the configure controlfile autobackup is set to ON, RMAN automatically backs up the control file and server parameter file after every backup and after database structural changes. The control file autobackup contains metadata about the previous backup, which is crucial for disaster recovery.

You can take manual backup of control file by

Running backup current controlfile command
Include a backup of control file within any backup by using include current controlfile option of the backup command
Backup datafile 1 (as it automoatically includes backup of control file and sp file)


Manual backup of control file is not the same as autobackup. Autoback contains metadata about the backup that just completed. Also, RMAN can automatically restore autobackups without the user of recovery catalog

Overview of Incremental backups


An incremental backup copies only datafile blocks that have changed since a specified previous backup.

An incremental backup is of two types:
  • Cumulative incremental backup
    • Backs up all blocks changed after the most recent incremental backup at level 0
  • Differential incremental backup
    • Backs up all blocks changes after the most recent incremental backup at level 1 or level 0
    • By default incremental backups are differntial.
  •  
    The contents of full backup and backup increment level 0 are the same. However, a full backup cannot be used as part of incremental strategy. Level 0 incremental backup is the basis of incremental strategy.

    A good rule of thump is to take new level 0 backup whenever 20% or more of the data has changed.

    In a data guard environment, you can offload incremental backups to a physical standby database. Incremental backups of a standby and primary database are interchangeable.

    To make differential incremental backup

    backup
    incremental level 0
    database ;

    To make cumulative incremental backup

    backup
    incremental level 1 cumulative
    database;

    To make incremental backups in the fast recovery area:
    backup
    incremental level 1
    from scn <look this up>



    Archival backups:


    You can use BACKUP ....KEEP to creat a backup that is both all-inclusive and exempt from the backup retention policy. The KEEP options also specifies that the backup should be exempt from the retention policy either forever or for a specified period of time (KEEP UNTIL TIME '01-JAN-08'.

    The characteristics of BACKUP ....KEEP command are as under:
    • It automatically backs up datafiles, control file (even if control file autobackup is disabled) and server parameter file.
    • It automatically generates an archived redo log backip to ensure that the database backup can be recovered to a consistent state.


    An Overview of Data Recovery Manager

    Data recovery manager is a tool to help reduce MTTS (Mean time to recover). The GUI of DRA is available in database control and grid control by selecting Perform Recovery in Availability tab. DRA has following commands:
    • LIST FAILURE
    • ADVISE FAILURE
    • REPAIR FAILURE
    • CHANGE FAILURE

    Advise failure comand is used to view repair options which typically include both automated and manual options. Repair failure command is used to repair the failure automatically. Once the failure is repaired, Repair failure command closes the relevant repaired failure. If you chose to repair failure manually, you should use change failure command to change the status of an open failure to closed. Change failure command is used to alter the status and priority of failure. You can change the status of the failure to closed or to priority high or priority low. You cannot set the status to open nor can you set the priority to critical with change failure command.


    To list all failures:
    • rman > list failure
    To list details of a particular failure
    • rman > list failure <failure id > detail
    List a subset of failure
    • rman > list failure low ( low is the failure priority; high and critical are the other two failure priority values)
    • rman > list failure close
    • rman > list failure exclude failure <failure id>
    To determine repair options for a subset of failure
    • rman > advice failure <failure id>
    To see what will be repaired if repair failure command is invoked
    • rman > repair failure preview

    Monday, October 10, 2011

    ILOM basics

    • Reset the server (poweroff and power on the server) 
      • reset /SYS
    • Start the console
    -> start /SP/console
    Are you sure you want to start /SP/console (y/n)? y
    Serial console is in use.

    -> stop /SP/console
    Are you sure you want to stop /SP/console (y/n)? y

    -> start /SP/console
    Are you sure you want to start /SP/console (y/n)? y

    Serial console started.  To stop, type ESC (


    • Log on to console
    telnet <hostts-m2> <portnum>




    When you start /sp/console, you get one of the following prompt.
    The prompt displayed on the terminal or shell tool tells you which channel you are accessing:
    • The # or % prompt indicates that you are at the system console and that the Solaris OS is running.
    • The ok prompt indicates that you are at the system console and that the server is running under OpenBoot firmware control.
    • The -> prompt indicates that you are at the service processor.
    • Additional Info:
    Command Cheat sheet:
    http://thegeekdiary.com/most-commonly-used-ilom-commands-cheat-sheet/

    http://www.fatmin.com/2008/04/sun-5220-consol.html

    http://blogs.oracle.com/merwick/entry/switching_between_alom_and_ilom

    Monday, October 3, 2011

    Naming Services essential

    • The naming and Directory services provided by Solaris are as under:
      • DNS 
      • NIS
      • LDAP
      • /etc files
      •  
      •  Modern network  uses two or more of these services in combination. When more than one service is used, the services are co-ordinated by nsswitch.conf file
      • Typically, NIS clients are configured with the nsswitch.conf file to use only NIS for machine name and address lookups. If this type of lookup fails, an NIS server can forward these lookups to DNS.ypcat, ypwhich and ypmatch commands are used for retrieving NIS maps
         
    • Solaris 10 Operating system ships with BIND 9.X DNS name server.
    • DNS service FMRL is svc:/network/dns/server:<instance> and svc:network/dns/client:<instance>
      • # svcs \*dns\*
        • STATE          STIME    FMRI
        • disabled       Sep_27   svc:/network/dns/server:default
        • online         Sep_27   svc:/network/dns/client:default
        • online         Sep_27   svc:/network/dns/multicast:default
    • The BIND 9.x configuration file in Solaris is : /etc/rndc.conf.
    • There are two extensions to DNS protocol. They are multicast DNS (mDNS) and DNS service discovery (DNS-SD)
      • mDNS extends the Domain Name service to operate over link-local multicast. Both Multicast DNS and Servic e Discovery are installed by default when installing the Solaris OS. In addition to being installed, mDNS must be enabled and must be included in /etc/nsswitch.conf
      • To enable mDNS, add mdns to hosts and ipnodes of /etc/nsswtich.conf (refer to /etc/nsswitch.dns for example)
      • The log file for mDNS can be found under /var/svc/log/network-dns-multicast:default.log
    • You can use dns-sd command as network diagnosis tool to browse and discover services.
    • To find out more about how DNS client resolver work in Solaris:
    • To  setup DNS server in Solaris
      • http://wikis.sun.com/display/tma/DNS+on+Solaris+11

    Monday, September 12, 2011

    Run Oracle Database in distinct resource pools in global container

    Suppose you have created three resource pools namely:
    • rac1Pool
    • rac2Pool
    • rac3Pool
    You want to run four Oracle database instances in each of these three pools and in the global pset.
    You can do so by creating 3 additional oracle users namely oracle_2, oracle_3 and oracle_4. All these users should have the same group as oracle user  and different (distinct)  home directory . Also, ensure that Oracle user home directory has group write permission. The command to create additional users is as under:
    • useradd -g oinstall -G dba -u 202 oracle_2
    •  useradd -g oinstall -G dba -u 203 oracle_3
    • useradd -g oinstall -G dba -u 204 oracle_4
    Next, create three projects with following pool and user association:
    rac1Project ---> rac1Pool---->oracle
    rac2Project---->rac2Pool----->oracle_2
    rac3Project---->rac3Pool----->oracle_3
    You can create the above mentioned associated by issuing the following command:
    1)Create a project , associate it with right user and pool:
    • projadd -U oracle -p 400  -K project.pool=rac1Pool rac1Project 
    • projadd -U oracle_2 -p 402  -K project.pool=rac2Pool rac2Project 
    • projadd -U oracle_3 -p 403 -K project.pool=rac3Pool rac3Project
    Additonal info : http://docs.oracle.com/cd/E26502_01/html/E29024/rmpool.task-41.html#rmpool.task-46

    2)Associate the user with right project  


    edit /etc/user_attr and add the following line
    • oracle::::project=rac1project  (add four colons after oracle)
    • orace_2::::project=rac2Project
    • oracle_3::::project=rac3Project
    3) Re-login as the use and verify that it is associated with right project
    •  id -p

    Thursday, August 11, 2011

    Bash Basics

    IO Redirection
    • 1>filename # Redirect stdout to file "filename."
    •  1>>filename # Redirect and append stdout to file "filename."
    •  2>filename # Redirect stderr to file "filename."
    • 2>>filename # Redirect and append stderr to file "filename."
    •  &>filename # Redirect both stdout and stderr to file "filename."
    Bash basic arithmetic:

    Surround your expression with double parenthesis .....
    #!/bin/bash
    x=5   # initialize x to 5
    y=3   # initialize y to 3
    add=$(($x + $y))   # add the values of x and y and assign it to variable add
    sub=$(($x - $y))   # subtract the values of x and y and assign it to variable sub
    mul=$(($x * $y))   # multiply the values of x and y and assign it to variable mul
    div=$(($x / $y))   # divide the values of x and y and assign it to variable div
    mod=$(($x % $y))   # get the remainder of x / y and assign it to variable mod

    Thursday, July 21, 2011

    Statspack Events

    enq: US - contention

    When you see enq: US - contention on Top 5 wait events on AWR or Statspack report or in ADDM findings you can take the following actions :

    1) Check undo advisor if in 10g anf up.
    2) Edit your undo retension parameter
    3) Give space to Undo Tablespace
    4) Move Undo tablespace to an other disk not so hot disk.

    Mostly this wait event concerns autoxents on undo tablespaces.

    • db file sequential read and read by other session
    Check buffer pool statistics and buffer wait (especiallyu data block wait)
    A "db file sequential read" occurs when a an Oracle process looks for a block in the buffer cache and can’t find the block. The block is then read of disk, creating IO.

    Db file sequential read wait time is increasing:
    Check the average read times per file under FILE IO Stats
    Check cache buffer hit ratio under "Buffer pool advisory"

    Oracle Installation notes

    • Create user and group:
      •  groupadd -g 201 dba
      • groupadd -g 200 oinstall
      •  useradd -g oinstall -G dba -u 200 oracle
      • mkdir /export/home/oracle
      • chown -R oracle:oinstall /export/home/oracle 
      • passwd oracle (setup password for oracle user) 
    • Create ZFS pool to install Oracle (optional)
      •  Find out which pools exist and which disks are used by those pools
        • zpool status
        •  Create a pool named oraclePool
        • zpool create  oraclePool c0t5000C5001D250C7Fd0   c0t5000C5001D207157d0 
          zfs create oraclePool/11gR2
    • Create directories and provide them right permissions:
      • mkdir -p /u01/app/oracle
      • mkdir -p /u01/app/11.2.0/grid
      • mkdir -p /u01/app/oracle/11.2.0/db
      • chown -R oracle:oinstall /u01
      • chmod -R 775 /u01
      • Oracle BASE : /u01/app/oracle
      • GRID Base: /u01/app/11.2.0/grid
      • DB BASE: /u01/app/oracle/11.2.0/grid
    • Install the required packages
      •  pkg install  SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWpool SUNWsprot SUNWtoo SUNWuiu8 SUNWfont-xorg-core SUNWfont-xorg-iso8859-1 SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw pkg://solaris/SUNWxwplt

    • Set project attributes
      • projmod -s -K 'process.max-file-descriptor=(basic,10000,deny)' oracleProject

    Things to check
    • 11.2.0.3 and later are supported on Solaris 11
    •  
    •  Set up AWT_TOOLKIT variable on Solaris 11
      • if installing on Solaris 11, set the following variable so runInstaller can work
        • export AWT_TOOLKIT=XToolkit
    • To setup rsh/ rlogin/ssh between nodes on Solaris 11:
      •  pkg  install service/network/legacy-remote-utilities
      •  inetadm -e  svc:/network/login:rlogin
      • svcadm enable /network/shell:default
    • Clone ASM and DB installation
      • Check out Appendix B of this document:

    http://download.oracle.com/docs/cd/E11882_01/install.112/e24346/toc.htm

      • If you want to do a slient install with response file check out appendix A.
    •  Verify if you have all the required packages:

      • pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWuiu8 SUNWfont-xorg-core SUNWfont-xorg-iso8859-1 SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw SUNWxwplt 
      • Else install the packages
      • pkg  install <list of space separated pkg names> 
      • If required you can delete existing publisher and add new publisher
        •  pkg set-publisher -G '*' -g  http://ipkg.us.oracle.com/solaris11/dev/ solaris
          # pkg publisher
          PUBLISHER                             TYPE     STATUS   URI
          solaris                               origin   online   http://ipkg.us.oracle.com/solaris11/dev/
           

    Friday, July 1, 2011

    Solaris Network monitoring

    nicstat reports network utilization and saturation by interface.

    The utilization measurement is based on the current throughput divided by maximum speed of the interface.The saturation measurement is a value that reflects errors due to saturation if kstat found any.

    You can compile nicstat with gcc using the following options:
    gcc nicstat.c -o nicstat -lkstat -lgen -lsocket -lrt

    1 Gbit NIC deliver: 128 MBytes/sec
    10GBit NIC delivers 1280 MBytes/sec
    Consider the following nicstat ouput from a 1Gbs NIC which provides a max of 1000MB/8 =125MBytes/sec.

    Int   rKB/s   wKB/s   rPk/s   wPk/s    rAvs    wAvs %Util    Sat

    net0   14.31   14.20   18.40   16.40   796.2   886.8  0.01   0.00
    net0 54421.9  1347.6 38495.8  7521.8  1447.6   183.5  44.6   0.00
    net0  114501  3390.0 81297.2 24512.0  1442.2   141.6  93.8   0.00

    For line 2, throughput is (54422+1348=55770KB/sec). So the util is 55770/125000 *100= 44%.
    For line 3, throughut is (114501+81297).Hence util = 117891/125000*100 =94%


    dladm is the admin utility for data link interfaces which helps to display information like the link status, speed,duplex and other vital statistics on each interface historically as well as on real time.

    • How many physical NICS are up on the system

    # dladm show-phys | grep up
    net1              Ethernet             up         1000   full      igb1
    net6              Ethernet             up         10     full      usbecm2
    net0              Ethernet             up         1000   full      igb0


    • What is the speed of the NIC

    # dladm show-phys
    LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
    net1              Ethernet             up         1000   full      igb1
    net6              Ethernet             up         10     full      usbecm2
    net4              Ethernet             down       0      unknown   ixgbe0
    net3              Ethernet             unknown    0      unknown   igb3
    net0              Ethernet             up         1000   full      igb0
    net5              Ethernet             down       0      unknown   ixgbe1
    net2              Ethernet             unknown    0      unknown   igb2
    # dladm show-ether
    LINK              PTYPE    STATE    AUTO  SPEED-DUPLEX                    PAUSE
    net1              current  up       yes   1G-f                            bi
    net6              current  up       no    10M-f                           none
    net4              current  down     yes   0M                              bi
    net3              current  unknown  yes   0M                              bi
    net0              current  up       yes   1G-f                            bi
    net5              current  down     yes   0M                              bi
    net2              current  unknown  yes   0M                              bi

    • How many links exist on each physical interface . And what is its MTU

    # dladm show-link | grep up
    net1                phys      1500   up       --
    net6                phys      1500   up       --
    net0                phys      1500   up       --
    public1             vnic      1500   up       net0
    public4             vnic      1500   up       net0



    • Get the connection between link names, devices and locations , use dladm show-phys with -L option

    root@p4826-01:~# dladm show-phys -L
    LINK              DEVICE       LOC
    net0              igb0         /SYS/MB
    net1              igb1         /SYS/MB
    net2              igb2         /SYS/MB
    net3              igb3         /SYS/MB
    net4              nxge0        /SYS/PM0
    net5              nxge1        --
    net6              nxge2        --
    net7              nxge3        --
    net8              nxge4        --
    net9              nxge5        --
    net10             nxge6        --
    net11             nxge7        --
    net12             usbecm2      --


    • You can find the MAC address of the link using the following command:

    root@p4826-01:~# dladm show-linkprop -p mac-address
    LINK     PROPERTY        PERM VALUE        EFFECTIVE    DEFAULT   POSSIBLE
    net5     mac-address     rw   0:21:28:93:b3:1 0:21:28:93:b3:1 0:21:28:93:b3:1 --
    net10    mac-address     rw   0:21:28:93:b3:56 0:21:28:93:b3:56 0:21:28:93:b3:56 --
    net3     mac-address     rw   0:21:28:fa:4a:93 0:21:28:fa:4a:93 0:21:28:fa:4a:93 --

    • You can find the MAC address of the physical links on the system with the following command:


    root@p4826-01:~# dladm show-phys -m | grep net2
    net2                primary  0:21:28:fa:4a:92   no    --




    • Basic receive side and transmit side statistics on all configured datalinks:

    dlstat displays packets and byte sizes for receive and transmit by default.

     LINK    IPKTS   RBYTES    OPKTS   OBYTES
               net1    2.33K  139.62K    2.35K   98.77K
               net6        2      140    2.34K   98.21K
               net4        0        0        0        0
               net3        0        0        0        0
               net0    4.03G    1.35T    2.91G    7.75T
               net5        0        0        0        0
               net2        0        0        0        0
            public1  191.69K   18.74M        0        0
            public4  191.68K   18.74M        0        0

               net1        0        0        0        0
               net6        0        0        0        0
               net4        0        0        0        0
               net3        0        0        0        0
               net0  101.89K  120.01M   67.02K   73.86M
               net5        0        0        0        0
               net2        0        0        0        0
            public1        1       60        0        0
            public4        1       60        0        0

               net1        0        0        0        0
               net6        0        0        0        0
               net4        0        0        0        0
               net3        0        0        0        0
               net0  102.93K  118.61M   66.16K   77.21M


    • To display historical data on each interface
    Use -s option to show-link command


    # dladm show-link -s
                    ipackets  rbytes         ierrors opackets        obytes      oerrors
    e1000g0         923206    815131608   0       297292    123324065   0
    e1000g1         194550    58980153    0       20904     2093152     0
    e1000g2         194804    25533658    0       2208      141594      0
    e1000g3         165030    21211696    0       9824      2757277     0

    • To display real time information on each interface,
      add -i <interval> option to -s option for show-link command


    # dladm show-link -s -i 10
                    ipackets  rbytes         ierrors opackets        obytes      oerrors
    e1000g0         923273    815138604   0       297327    123328173   0
                    ipackets  rbytes         ierrors opackets        obytes      oerrors
    e1000g0         6         384         0       2         332         0
                    ipackets  rbytes         ierrors opackets        obytes      oerrors
    e1000g0         5         1380        0       2         332         0
    ^C# dladm show-dev -s -i 10
                    ipackets  rbytes         ierrors opackets        obytes      oerrors
    e1000g0         923320    815144418   0       297359    123332029   0
                    ipackets  rbytes         ierrors opackets        obytes      oerrors
    e1000g0         6         666         0       2         332         0
    ^C#

    • Additonal info
    http://www.softpanorama.org/Net/Solaris/network_configuration.shtml#Marking_an_Ethernet_Interface_as_Down
    http://www.thezonemanager.com/2010/03/measuring-network-throughput-via.html

    List hidden paramters in Oracle Database

    You can get the hidden parameter values by querying x$ksppcv and x$ksppi as follows:
    • select a.ksppinm name, b.ksppstvl value from sys.x$ksppi a,sys.x$ksppcv b where a.indx = b.indx and a.ksppinm=’_smm_max_size’;
    • select a.ksppinm name, b.ksppstvl value from sys.x$ksppi a,sys.x$ksppcv b where a.indx = b.indx and a.ksppinm=’_pga_max_size’;

    Create psrset

    Here is how you can create a processor set with two cores (32 threads)

    • psrset -c 0-31
    if you get :
    • An  "Operation not supported" error indicates that pool facility is active.
    Disable the pool facility as under:
    • svcs *pool*
    • STATE          STIME    FMRI
    • disabled       Feb_17   svc:/system/pools/dynamic:default
    • online         Feb_17   svc:/system/pools:default
    • you have mail
    • # svcadm disable svc:/system/pools:default
    • # svcs *pool*
    • STATE          STIME    FMRI
    • disabled       Feb_17   svc:/system/pools/dynamic:default
    • disabled       11:44:04 svc:/system/pools:default
    Create psrset with first 32 processors and verify that the processor set was successfully created
    psrset 0-31
     psrset -i
    user processor set 1: processors 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    The output indicates that process set named 1 has processors from id 0 to 31.

    Tuesday, June 28, 2011

    When is DISM enabled in Solaris

    • You can find out if ISM or DISM is enabled, by executing the following :
      • pmap -xs ora_<SID>_lgwr | grep -i ism
    • The algorithm for finding out if DISM will be enabled is as under:
      • Is memory_target or memory_max_target is set
        • Yes: enable DISM
        • No : Is the size of sga_max_size > size for all SGA components
          •  Yes : Enable DISM
          •  No : enable ISM
    • If you want to disable DISM, ensure that sga_max_size is set to a value less than the size of all SGA components
      • You can find the size of all SGA components as under:
        • select sum(value)/(1024*1024*1024) as totalMB from v$sga;
    • Info on sga_target and sga_max_size:
      • sga_target enables automatic SGA mangement. You do not need to set individual SGA buffers if you set sga_target. It can be dynamically increased to sga_max_size.
      • sga_max_size is the max size of the SGA. It is a static parameter. By default, Oracle sets sga_max_size to sga_target if sga_max_size is not set. Additonal info : http://forums.oracle.com/forums/thread.jspa?threadID=535400

    Wednesday, June 8, 2011

    Which CPU is servicing the interupts

    Issue the mpstat  command. Refer to intr and xcal columns for interrupts. Usually when the value of these two columns are equal, it is network interrupt.

    To find out which CPU is servicing network (NIC) and IO (HBA) interrupts you can also  invoke the following command

    intrstat 10 10

    Create Statspack

    "snapshot" is  snapshot of database statistics and performance information as of a specific point in time.

    There is no such thing as "comparing two snapshots". To get information about database activity and/or performance, you have to generate the StatsPack report for the duration between two snapshots.
    Thus, for example, a StatsPack report for the duration between Snapshot 1 and Snapshot 2 shows activity and performance information for that time duration.

    Script to take snapshot:

    echo "connect to sql plus and taking a snap"

    sqlplus "/nolog" << !
    connect perfstat/perfstat
    variable snap_before number ;
    begin :snap_before :=statspack.snap; end;
    /
    print snap_before
    !
    sleep 60
    echo "starting second snapshot"

    sqlplus "/nolog" << !
    connect perfstat/perfstat
    variable snap_after number ;
    variable snap_before number ;
    begin
    :snap_after := statspack.snap ;
    end ;
    end ;
    /
    print snap_after ;
    begin
    select :snap_after -1 into :snap_before from dual ;
    end ;
    /

    define begin_snap=:snap_before
    define end_snap=:snap_after
    define report_name=snapshot
    @$ORACLE_HOME/rdbms/admin/spreport

    Cluster verification Utility

    • To view what prerequisites are failing
      • ./runcluvfy.sh comp sys -n  t5120-241-06,t5220-241-03 -p crs
    • To generated a fixup script in /tmp/ directory to fix the prerequisites that are failing
      • ./runcluvfy.sh stage -pre crsinst -fixup -fixupdir /tmp/ritu.sh  -n t5120-241-06,t5220-241-03
    • Additional commands:
      • ./runcluvfy.sh -help
      • ./runcluvfy.sh stage -list or stage -help
      •  ./runclvfy.sh comp -list or comp -help
      • System requirement verification
        • ./runcluvfy.sh comp sys -n {node list} -p {crs|database} -verbose
      • Storage verification
        • ./runcluvfy.sh comp ssa -n {node list}  -s {storageid_list] - verbose
    • Detailed Documentation:

    Monday, May 9, 2011

    WARNING: oradism not setup correctly in alert log

    If you see the following warning in alert file :

    WARNING: -------------------------------
    WARNING: oradism not set up correctly.
    Dynamic ISM can not be locked. Please
    setup oradism, or unset sga_max_size.
    [diagnostic 0, 16, 64882]
    ----------------------------------------

    the solution is as under:

    1- cd $ORACLE_HOME/bin

    2- chmod 4550 oradism
    3- chmod g+s oradism
    4- chown root:dba oradism
    5- Bounce the database

    Refer to Metalink note 374367.1 for additional info.

    Tuesday, April 5, 2011

    Sort Area in PGA

    If parallel servers are disabled, than the max size of the sort area is determined by _smm_max_size parameter. The value is in KB. The _pga_max_size is the max size of a single session pga. It is expressed in bytes.

    You can view this paramter as under:
    select a.ksppinm name, b.ksppstvl value from sys.x$ksppi a,sys.x$ksppcv b where
    a.indx = b.indx and a.ksppinm='_smm_max_size';
    select a.ksppinm name, b.ksppstvl value from sys.x$ksppi a,sys.x$ksppcv b where
    a.indx = b.indx and a.ksppinm='_pga_max_size';
    show parameters 'pga%';
    For 10gR2:

    When max_parallel_servers is set to 0:

    If pga_aggr_target < 500mb , _smm_max_size is set to 20% of PAT (pga_aggr_target)
    if PAT is between 500mb and 1gb , _smm_max_size is set to 100M
    if PAT > 1GB, _smm_max_size is set to 10% of PAT

    When parallel operations are enabled

    Upper bound limited to 50% of PAT/DOP

    when DOP <=5, _smm_max_size is used
    when DOP > 5 _smm_px_max_size/DOP limits the max memory usuage

    _pga_max_size defaults to 2* _smm_max_size

    Thursday, March 24, 2011

    Recipes

    Meetha pooda or sweet pancake is made in many parts of India including Punjab and Rajasthan. In Punjab, it is served as breakfast. You can also make it as an anytime sweet.
    Recipe of meetha pooda (chilla)
    1 cup whole wheat flour (atta)
    1/2 cup sugar
    1/2 tsp saunf (fennel) powder
    2-3 green cardamom (hari elaichi) - crushed
    Ghee (clarified butter) or oil to shallow fry
    1. In a bowl, mix all the ingredients except oil or ghee. Add water slowly mixing with other hand. Add enough water to make lump free batter of consistency thicker than that of pakoda (fritters). Beat well.
    2. Heat a non- stick tava (griddle). Grease it and turn the heat to low. Pour a ladlefull or 2 tablespoon batter in the center of the tava.
    3. Spread it gently in the outward circular motion like you would do for a chilla or an omellete. Spread it with the back of a ladle (karchhi). Turn the heat to medium.
    4. After 2 minutes, drizzle some oil or ghee on the pooda. Remove it with the help of a wide, thin spatula and turn over.
    5. Cook the other side also for 2 minutes and remove from the tava. Your meetha pooda is ready. Similarly make other poodas from rest of the batter.
    Always spread the pooda on low heat and cook it on medium heat.
    If the first pooda sticks to the tava, don’t get disheartened. It usually happens with the first puda. As the tava get seasoned, rest of the meetha puda will turn out fine.

    Out Of Memory Error

    Execute prctl $$ command to  use the current shell process to determine resource limits


    A threshold value on a resource control constitutes a point at which local actions can be triggered or global actions, such as logging, can occur.
    Each threshold value on a resource control must be associated with a privilege level. The privilege level must be one of the following three types:
    basic
    Can be modified by the owner of the calling process.
    privileged
    Can be modified by the current process (requiring sys_resource privilege) or by prctl(1) (requiring proc_owner privilege).
    system
    Fixed for the duration of the operating system instance.
    A resource control is guaranteed to have one system value, which is defined by the system, or resource provider. The system value represents how much of the resource the current implementation of the operating system is capable of providing.
    Any number of privileged values can be defined, and only one basic value is allowed. Operations that are performed without specifying a privilege value are assigned a basic privilege by default.

    If you see "Out of memory errors" , you may want to enable logging of resource control limit threshold.
    By default, Solaris 10  does not  log resource limit threshold notifications. You can see whether they are enabled or not by using the “rctladm” command:

    To turn on the syslog for "project.max-shm-memory", issue the following:
    rctladm -e syslog project.max-shm-memory
    
    
    
    To set the process.max-address.space to 20GB, add the following line to /etc/project
             
    
    user.ben:12345::::process.max-address.space=(privileged,20000000000,deny)
    
    An example of /etc/project:
    user.oracle:100::::process.max-address-space=(privileged,40240000000,deny);proce
    ss.max-data-size=(priv,10737418240,deny);process.max-sem-nsems=(priv,8192,deny);
    process.max-stack-size=(priv,10737418240,deny);project.max-file-descriptor=(priv
    ,65536,deny);project.max-sem-ids=(priv,100,deny);project.max-shm-ids=(priv,8192,
    deny);project.max-shm-memory=(privileged,2199023255552,deny)
    
    
    
    
    This setting however only takes effect for new processes and not for existing process.
    
    ie prctl $$ (will continue to show old value for process.max-address-space)
    '
    $ su oracle -c 'sh -c "prctl $$"' (will show the new value as you are starting a new shell)
    or ...su oracle -c 'sh -c "xterm"'

    Mapping disk instance name with physical name

    Say you need to find the instance name for the following disks:
    '/dev/rdsk/c6t20030003BACCC8FAd0s6',
    '/dev/rdsk/c6t20030003BACCC8FAd1s6',
    '/dev/rdsk/c6t20030003BACCC902d0s6',
    '/dev/rdsk/c6t20030003BACCC902d1s6



    Look for 902 (0 and 1) in /etc/path_to_inst file:
    "/pci@0/pci@0/pci@8/pci@0/pci@a/SUNW,qlc@0,1/fp@0,0/ssd@w20030003baccc902,1" 3 "ssd"
    "/pci@0/pci@0/pci@8/pci@0/pci@a/SUNW,qlc@0,1/fp@0,0/ssd@w20030003baccc902,0" 4 "ssd"

    Look for 8FA (0 and 1 ) in /etc/path_to_inst file:
    "/pci@0/pci@0/pci@8/pci@0/pci@a/SUNW,qlc@0,1/fp@0,0/ssd@w20030003baccc8fa,1" 72 "ssd"
    "/pci@0/pci@0/pci@8/pci@0/pci@a/SUNW,qlc@0,1/fp@0,0/ssd@w20030003baccc8fa,0" 7 "ssd"


    The mapping is as under:
    '/dev/rdsk/c6t20030003BACCC8FAd0s6  : ssd7
    '/dev/rdsk/c6t20030003BACCC8FAd1s6:ssd72
    /dev/rdsk/c6t20030003BACCC902d0s6:ssd4
    /dev/rdsk/c6t20030003BACCC902d1s6:ssd3

    Tuesday, March 8, 2011

    Solaris Containers

    • How to create Zones
    • Create a root directory for zones with rwx permission for user.
      • mkdir /zones1
      • chmod 700 /zones1
    • Create a zone configuration file as under:
      • create
      • set zonepath=/zones1
      • set autoboot=true
      • Add network (exclusive IP or default shared IP):
        • Setting exclusive IP
      If you are setting up exclusive IP: (do not set address attribute for exclusive IP)
        set ip-type=exclusive
        add net
        set physical=e1000g2
        end

        Additional info about exclsive IP setup:
        http://download.oracle.com/docs/cd/E19082-01/819-6990/gicom/index.html

          • Setting default shared IP
        If you are setting default shared IPadd net
        set physical=e1000g2
        set address=<ip address of container>
        end

        • Add Raw devices
        To add raw devices to the containers configuration

        add device
        set match=/dev/rdsk/c6t20030003BACCC902*
        end
        add device
        set match=/dev/rdsk/c6t20030003BACCC8FA*
        end

        On Solaris 11:
        zonecfg:rac4Zone> add device
        zonecfg:rac4Zone:device> set match=/dev/rdsk/c1t0d0s0
        zonecfg:rac4Zone:device> set allow-partition=true
        zonecfg:rac4Zone:device> set allow-raw-io=true
        zonecfg:rac4Zone:device> end


        • Add FS
        To add fs refer to
        • http://docs.oracle.com/cd/E23824_01/html/821-1460/z.admin.task-11.html

        To mount a global directory as lofs to container

        zonecfg -z zones1
        add fs
        set dir=/oracle11gR2
        set special=/oracle11gR2
        set type=lofs
        set options=nodevices
        end

        • Set shared memory :
          global# zonecfg -z myzone
          zonecfg:myzone> set max-shm-memory=50G
          • Add dedicated CPU 
            Adding dedicated -cpu is a simpler form of creating a pool and attaching it to the container. Add dedicated-cpu command creates a temporary pool and assigns it to the container

            add dedicated-cpu
            set ncpus=32
            end

            • Remove dedicated CPU

            To remove the dedicated-cpu, issue the following command
            remove dedicated-cpu

            • Add resource pool
              • set pool=rac1pool
            • Remove pool
              • On Solaris 11
                •  clear pool
              • On Solaris 10 Update 3 and below
                • set pool=""

            • Steps to create and configure a container

            1. Invoke zonecfg command to configure the zone
              1. zonecfg -z zones1 -f test.cfg
            2.  Install the configured zone
              1. zoneadm -z zones1 install
            3.  Use the list subcommand of zoneadm to list the installed zones and verify their status. The status of the zone is "Installed"
              1. zoneadm list -iv
            4. Boot the zone
              1. zoneadm -z zones1 boot
            5.  Verify that status of the zone is "running"
              1. zoneadm list -v
            6.  Log in to Zone console to perform the internal zone configuration
              1. zlogin -C zone1
            7.  Optionally edit /etc/sysidcfg file to perfom the inital zone configuration
              1. Go to /etc/ directory of the local zone
                1. cd /export/home/zones/root/etc
              2. Create sysidcfg file in this directory

            • Steps to delete a container
              • zoneadm -z myzone halt
              • zoneadm -z myzone uninstall
              • zonecfg -z myzone delete -F

            • List a container and info about it

            • List all zones from global zone
              • zoneadm list -v
            • Login to local zone from global zone:
              • zlogin <zonename>
            • In the zone , issue zonename to print its name
            • Get info about the zone
              • zonecfg -z myzone info
            • To verify if /dev/rdsk/c6 is accessible in local container
              • ls /my_zone/root/dev/rdsk/.....

            • Initial zone configuration

            • Hostname and ip address: 
              • The hostname can be resolved through DNS or NIS
                • Verify if it is resolved through DNS
                  • nslookup isve-111-212 
                • Verify if it resolves through NIS
                  • ypcat hosts | grep isve-111-212
                • If hostname is resolved through dns /etc/nsswitch.conf should have the following 
                  • ipnodes:        files dns
                • else it should be as under:
                  • ipnodes:        files nis
            • netmask: /etc/inet/netmasks
            • Router IP : /etc/defaultrouter
            • Dominname : exec domainname command
            • Name service : Check /etc/nsswitch.conf to confirm it is NIS
            • Name server: output of ypwhich command
            • Ip addres of name server : ping -s <nameserver>
            • DNS name server ip address from /etc/resolv.conf

            • Modify exisiting zone

            • Change net settings {removing address or physical attribute of the net will delete both network parameters
              • zonecfg -z zone1 info
              • remove net address=<value> {or remove net physical=<value>}
              • add net
              •    set physical
              •     set address
              • end
            • Some changes need the zone to be rebooted to take effect
              • zoneadm -z zone1 reboot


            If you want to restart initial zone configuration
            • zlogin -S zonename /usr/sbin/sys-unconfig
            • or login to zones (zlogin zonename) , issue sys-unconfig and reboot
            • On Solaris 11, you can configure using the following commnd
              • /usr/sbin/sysconfig unconfigure
            How to specify netmask in containers:
            Why is zone booting command failing as under:

             zoneadm -z zones2 boot
            zoneadm: zone 'zones2': These file-systems are mounted on subdirectories of /zones2/root:
            zoneadm: zone 'zones2':   /zones2/root/var/sadm/install/.door
            zoneadm: zone 'zones2': call to zoneadmd failed
            You do not have the right zones patch installed..... Wait for 10 minutes and issue the command and it will work if you do not want  to install the updated patches


            If you see the following error, login in to the console to view the SCI ....


            root@unknown:~# sysconfig configure
            This program will re-configure your system.
            Do you want to continue (y/[n])? y
            Interactive configuration requested.
            System Configuration Interactive (SCI) tool will be launched on console.
            Since you are currently not logged on console,
            you may not be able to navigate SCI tool.
            Would you like to proceed with re-configuration (y/[n])? y

            How to create a resource pool and bind a project to that pool

            Create Resource Pool
            • Enable the resource pool service
              • svcadm enable system/pools:default
            • Enable dynamic resource pool
              • svcadm enable system/pools/dynamic:default
            • Check if both are enabled
              • svcs \*pool\*
            • Create a processor set named oracle_set with 32 processors
              • poolcfg -c 'create pset oracle_set( uint pset.min=32; uint pset.max=32)'
            • Create a pool named oraclePool
              • poolcfg -c ' create pool oraclePool
            • Associate the pool with processor set
              • poolcfg -c 'associate pool oraclePool (pset oracle_set)'
            •  Display the info
              • poolcfg -c info
            • Commit the changes to /etc/pooladm.cfg
              •  pooladm -c
            • Alternatively, you can save the configuration in a file and invoke pooladm with that file
            Here is an example of configuration file that creates a pool with 8 CPUs in it

            cat sPool:
            create pset rac1_set(uint pset.min=8;uint pset.max=8)
            create pool rac1Pool
            associate pool rac1Pool(pset rac1_set)
            transfer to pset rac1_set(cpu 0;cpu 1 ; cpu 2; cpu 3; cpu 4 ; cpu 5 ; cpu 6; cpu 7)

            Invoke the following command to save current configuration in /etc/pooladm.conf file.

             if that file does not exist
            • pooladm -s
            Execute the following command to execute commands from sPool file
            • poolcfg -f sPool
            • poolcfg -c info
            • pooladm -c
            The following commands can be used to delete the pool:

            cat delPool
            destroy pset rac1_set
            destroy pool rac1Pool
            poolcfg -f delPool

            If poolcfg -c info is not taking the right changes, you may want to flush out current in-memory config and start afresh ...

            pooladm -x # flush current in-memory config
            pooladm -s # blank /etc/pooladm.conf config

            For more info : http://www.brendangregg.com/zones.html


              Bind the oracle project to this pool

              • Set project.pool attribute for oracle project to oraclePool so that oracle project gets binded to oraclePool by default. This implies that all processes starting in this project are bound to the pool automatically
                •  projmod -a -K project.pool=poolname project

              Destroy the processor set and pool set

              • poolcfg -c 'destroy pset oracle_set' /etc/pooladm.conf
              • poolcfg -c 'destroy pool oraclePool'
              • poolcfg -c info
              • pooladm -c
              Bind a process to the resource pool

              The following procedure uses poolbind with the -p option to manually bind a process  to a pool named oraclePool
              • Bind the process named ohare to the resource pool oraclePool
                • # poolbind -p oraclePool <procesid of process to be binded>
              • verify which pool a particular process is binded to
                • $ poolbind -q <process id of binded process)
              Monitor pool and processor set:
              • Execute the following commands
                • poolstat 5
                • poolstat -r pset 5 
              If you cannot find dynamic-resource SMF service (system/pools/dynamic:default ), download dynamic-resource-pools pkg.



              Verify if dynamic-resource-pools package exist on your system or not.
              •  pkg info dynamic-resource-pools
              pkg: info: no packages matching the following patterns you specified are
              installed on the system.  Try specifying -r to query remotely:

                      dynamic-resource-pools


              • pkg info resource-pools
                        Name: system/resource-mgmt/resource-pools
                     Summary: Resource Pools
                 Description: core software for resource pools
                    Category: System/Core
                       State: Installed
                   Publisher: solaris
                     Version: 0.5.11
               Build Release: 5.11
                      Branch: 0.175.1.0.0.9.0
              Packaging Date: Mon Feb 06 23:51:31 2012
                        Size: 811.45 kB
                        FMRI: pkg://solaris/system/resource-mgmt/resource-pools@0.5.11,5.11-0.                             175.1.0.0.9.0:20120206T235131Z


              • # pkg search dynamic-resource-pools
              INDEX      ACTION VALUE                                               PACKAGE
              pkg.fmri   set    solaris/system/resource-mgmt/dynamic-resource-pools pkg:/syste                             m/resource-mgmt/dynamic-resource-pools@0.5.11-0.175.1.0.0.9.0


              • # pkg install dynamic-resource-pools
                         Packages to install:  3
                     Create boot environment: No
              Create backup boot environment: No
                          Services to change:  5

              DOWNLOAD                                  PKGS       FILES    XFER (MB)
              Completed                                  3/3   1015/1015    52.5/52.5

              PHASE                                        ACTIONS
              Install Phase                              1374/1374

              PHASE                                          ITEMS
              Package State Update Phase                       3/3
              Image State Update Phase                         2/2


               
              Additional info:
              ttp://www.brendangregg.com/zones.html#resource_cpu0

                Wednesday, February 9, 2011

                Solaris Technotes

                • Enable rsh in S10:
                http://unixadministrator.blogspot.com/2008/12/how-to-enable-rsh-on-solaris-10.html
                Also, verify that the account from where you are setting rsh has a password ....

                • corestat does not show output
                verify that cpustat command is giving the right output.if cpustat says resource currently unavailable, reboot the system.The cpustat command that corestat executes can be found in corestat file ....
                • Kill all oraclebench process 
                  ps -ef | grep oraclebench | awk '{print $2}' | xargs -n1 kill -9

                • List ora_smon_test process

                pgrep -fl ora_smon_test 
                • To remove all the files from  a directory , when rm gives "list too long" error
                        find . -name '*' | xargs rm
                • To enable ssh for root  

                • Edit /etc/ssh/sshd_config file 
                    • search for: PermitRootLogin no 
                    • change the 'no' to yes.
                • Edit etc/default/login 
                  • comment out "CONSOLE=/dev/console"
                • Restart sshd 
                  • with following command
                    •  # svcadm restart svc:/network/ssh:default
                  • Or as under
                    •  # /lib/svc/method/sshd restart
                 
                •  Sqlplus cheatsheet:
                 
                • http://www.adp-gmbh.ch/ora/sqlplus/use_vars.html
                • http://www.cs.csubak.edu/~wang/CS342/SqlPlus.htm

                     

                Connecting to database from remote client

                • Start listener on server machine
                • Install adminstrative client s/w on the client machine and add server name in tnsname.ora in client machine
                •  Verify on client machine:
                  • tnsping <servicename>
                  • sqlplus tpcc/tpcc@bench (where tpcc is the username and bench is the service name)
                  • setenv TWO_TASK bench
                  • sqlplus tpcc/tpcc (you should get the prompt)
                  •  
                • What is the use of TWO_TASK environment variable ?
                If you are in a Unix environment, you can normally set 2 environment variables:
                • ORACLE_HOME
                • ORACLE_SID
                that will connect you to a local database identified by that home and sid. If you wanted
                to be able to connect to a remote database or a database on that machine via SQLNet, you
                can also set:
                •  TWO_TASK = <tnsconnect string> 
                The setting of TWO_TASK overrides the ORACLE_SID when set. You will not connecting to a
                local database with two_task but rather using sqlnet to connect to a remote database.
                So, instead of: 
                I can: 
                $ setenv TWO_TASK some_db
                $ sqlplus scott/tiger
                and the @some_db is implied.

                Tuesday, February 8, 2011

                Whitepaper links

                • Oracle Database on Sun SPARC Enterprise T-series Systems : Suitablilty Analysis
                • Optimizing Single Instance Oracle Databases on Oracle's T-Series Servers:
                • Deploying Oracle Database on the Oracle Solaris Platform -Best Practices:
                • Best Practices for Runing Oracle Databases in Oracle Solaris Containers
                • Session in MySQL Conf 2008 : Best Practices for Deploying MySQL on the Solaris Platform
                • Session in Oracle OpenWorld 2010:
                http://www.oracle.com/technetwork/server-storage/solarisstudio/oow-focus-on-solaris-173299.pdf

                • Oracle Optimized Solution
                How to Consolidate, Optimize, and Deploy Oracle Database Environments with Flexible Virtualized Services
                Oracle Optimized Solution for Oracle Database
                http://www.oracle.com/technetwork/server-storage/hardware-solutions/o12-032-howto-db-throughput-avail-1592601.pdf
                 
                 
                •  Oracle Optimized Soltuion:
                 
                How to Accelerate Test and Development Through Rapid Cloning of Production Databases and Operating Environments
                 
                http://www.oracle.com/technetwork/server-storage/hardware-solutions/o13-022-rapid-cloning-db-1919816.pdf
                
                
                •  Session in Oracle Open World 2012

                How to Configure HCC for Optimizing Query Database Performance and lowering TCO
                • Deploying MySQL Database in Solaris Cluster Environments

                Looking at another FC storage

                Storage configuration is as under:

                • luxadm  -e port

                4 HBAs are connected:
                /devices/pci@1,700000/SUNW,qlc@0/fp@0,0:devctl                     CONNECTED
                /devices/pci@1,700000/SUNW,qlc@0,1/fp@0,0:devctl                   CONNECTED
                /devices/pci@13,700000/SUNW,qlc@0/fp@0,0:devctl                    CONNECTED
                /devices/pci@13,700000/SUNW,qlc@0,1/fp@0,0:devctl                  CONNECTED

                You can find out the WWN number of each HBA as under :


                Pos AL_PA ID Hard_Addr Port WWN         Node WWN         Type
                0     e1  4     e1     200700a0b832f4bd 200600a0b832f4bc 0x0  (Disk device)
                1     1   7d    0      2100001b320b6958 2000001b320b6958 0x1f (Unknown Type,Host Bus Adapter)


                Pos AL_PA ID Hard_Addr Port WWN         Node WWN         Type
                0     e8  1     e8     200600a0b832f4bd 200600a0b832f4bc 0x0  (Disk device)
                1     1   7d    0      2101001b322b6958 2001001b322b6958 0x1f (Unknown Type,Host Bus Adapter)


                Pos AL_PA ID Hard_Addr Port WWN         Node WWN         Type
                0     ef  0     ef     202400a0b83892c4 200400a0b83892c4 0x0  (Disk device)
                1     1   7d    0      2100001b329bdf46 2000001b329bdf46 0x1f (Unknown Type,Host Bus Adapter)


                Pos AL_PA ID Hard_Addr Port WWN         Node WWN         Type
                0     e8  1     e8     203400a0b83892c4 200400a0b83892c4 0x0  (Disk device)
                1     1   7d    0      2101001b32bbdf46 2001001b32bbdf46 0x1f (Unknown Type,Host Bus Adapter)


                Additional info about HBAs including their speed can be found by issuing the following comand
                • fcinfo hba-ports
                # fcinfo hba-port
                HBA Port WWN: 2100001b320b6958
                        OS Device Name: /dev/cfg/c1
                        Manufacturer: QLogic Corp.
                        Model: 375-3356-02
                        Firmware Version: 05.03.02
                        FCode/BIOS Version:  BIOS: 1.24; fcode: 1.24; EFI: 1.08;
                        Serial Number: 0402G00-0814437006
                        Driver Name: qlc
                        Driver Version: 20100301-3.00
                        Type: L-port
                        State: online
                        Supported Speeds: 1Gb 2Gb 4Gb
                        Current Speed: 4Gb
                        Node WWN: 2000001b320b6958
                HBA Port WWN: 2101001b322b6958
                        OS Device Name: /dev/cfg/c2
                        Manufacturer: QLogic Corp.
                        Model: 375-3356-02
                        Firmware Version: 05.03.02
                        FCode/BIOS Version:  BIOS: 1.24; fcode: 1.24; EFI: 1.08;
                        Serial Number: 0402G00-0814437006
                        Driver Name: qlc
                        Driver Version: 20100301-3.00
                        Type: L-port
                        State: online
                        Supported Speeds: 1Gb 2Gb 4Gb
                        Current Speed: 4Gb
                        Node WWN: 2001001b322b6958
                HBA Port WWN: 2100001b329bdf46
                        OS Device Name: /dev/cfg/c6
                        Manufacturer: QLogic Corp.
                        Model: 371-4325-01
                        Firmware Version: 05.03.02
                        FCode/BIOS Version:  BIOS: 2.02; fcode: 2.03; EFI: 2.01;
                        Serial Number: 0402H00-1002804353
                        Driver Name: qlc
                        Driver Version: 20100301-3.00
                        Type: L-port
                        State: online
                        Supported Speeds: 2Gb 4Gb 8Gb
                        Current Speed: 4Gb
                        Node WWN: 2000001b329bdf46
                HBA Port WWN: 2101001b32bbdf46
                        OS Device Name: /dev/cfg/c7
                        Manufacturer: QLogic Corp.
                        Model: 371-4325-01
                        Firmware Version: 05.03.02
                        FCode/BIOS Version:  BIOS: 2.02; fcode: 2.03; EFI: 2.01;
                        Serial Number: 0402H00-1002804353
                        Driver Name: qlc
                        Driver Version: 20100301-3.00
                        Type: L-port
                        State: online
                        Supported Speeds: 2Gb 4Gb 8Gb
                        Current Speed: 4Gb
                        Node WWN: 2001001b32bbdf46

                You can find out which disk are attached to which HBA by the following command:

                (where P is WWN of the HBA port found by luxadm dump_map command or fcinfo hba_port command)
                • fcinfo remote-port -sl -p 2100001b320b6958
                Remote Port WWN: 200700a0b832f4bd
                        Active FC4 Types:
                        SCSI Target: yes
                        Node WWN: 200600a0b832f4bc
                        Link Error Statistics:
                                Link Failure Count: 3
                                Loss of Sync Count: 9
                                Loss of Signal Count: 133
                                Primitive Seq Protocol Error Count: 0
                                Invalid Tx Word Count: 0
                                Invalid CRC Count: 0
                        LUN: 0
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c1t4d0s2
                        LUN: 1
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c1t4d1s2
                        LUN: 2
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c1t4d2s2
                        LUN: 3
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c1t4d3s2

                • # fcinfo remote-port -sl  -p  2101001b32bbdf46
                Remote Port WWN: 203400a0b83892c4
                        Active FC4 Types:
                        SCSI Target: yes
                        Node WWN: 200400a0b83892c4
                        Link Error Statistics:
                                Link Failure Count: 13
                                Loss of Sync Count: 2167
                                Loss of Signal Count: 3158
                                Primitive Seq Protocol Error Count: 0
                                Invalid Tx Word Count: 0
                                Invalid CRC Count: 0
                        LUN: 0
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c7t1d0s2
                        LUN: 1
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c7t1d1s2
                        LUN: 2
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c7t1d2s2
                        LUN: 3
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c7t1d3s2
                • # fcinfo remote-port -sl -p 2101001b322b6958
                Remote Port WWN: 200600a0b832f4bd
                        Active FC4 Types:
                        SCSI Target: yes
                        Node WWN: 200600a0b832f4bc
                        Link Error Statistics:
                                Link Failure Count: 3
                                Loss of Sync Count: 9
                                Loss of Signal Count: 69
                                Primitive Seq Protocol Error Count: 0
                                Invalid Tx Word Count: 0
                                Invalid CRC Count: 0
                        LUN: 0
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c2t1d0s2
                        LUN: 1
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c2t1d1s2
                        LUN: 2
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c2t1d2s2
                        LUN: 3
                          Vendor: SUN
                          Product: CSM200_R
                          OS Device Name: /dev/rdsk/c2t1d3s2
                • # fcinfo remote-port -sl -p 2100001b329bdf46
                Remote Port WWN: 202400a0b83892c4
                        Active FC4 Types:
                        SCSI Target: yes
                        Node WWN: 200400a0b83892c4
                        Link Error Statistics:
                                Link Failure Count: 10
                                Loss of Sync Count: 1776
                                Loss of Signal Count: 3331
                                Primitive Seq Protocol Error Count: 0
                                Invalid Tx Word Count: 0
                                Invalid CRC Count: 0
                        LUN: 0
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c6t0d0s2
                        LUN: 1
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c6t0d1s2
                        LUN: 2
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c6t0d2s2
                        LUN: 3
                          Vendor: SUN
                          Product: LCSM100_F
                          OS Device Name: /dev/rdsk/c6t0d3s

                The above output shows that each HBA has four disk attached
                1 HBA : 200700a0b832f4bd : c1t4do-d3
                2 HBA : 203400a0b83892c4:  c7t1d0-d3
                3 HBA :200600a0b832f4bd: c2t1d0-d3
                4 HBA: 202400a0b83892c4:  c6t0d0-d3

                On the storage side:
                There are two arrays:
                One is 6140 with 1.7 terabytes of storage with a total of 13 disk each of 136 GB . It has two controllers
                6140 is divided into four volumes of 442GB each. Two volumes are connected to controller A and two are connected to controller B.
                Each controller has 2 ports. However, the link of only port per controller is up
                The wwn of the port that is up on Controller A (A/1) is
                20:06:00:A0:B8:32:F4:BD
                The wwn of the port that is up on controller B (B/1)is
                20:07:00:A0:B8:32:F4:BD

                The second storage is 2540 with 1.6 TB of storage with a total of 12 SAS disk each of 136 GB. It consist of single controller.The link of both ports on the controller are active.
                The WWN of the first port of the controller (A/1) is
                20:24:00:A0:B8:38:92:C4
                the WWN of the second port of the controller (A/2) is oth the
                20:34:00:A0:B8:38:92:C4
                2540 consist of 4 volumes each of 408 GB

                Combining info about storage and HBA info on server side.
                c1t4 disk and c2t1 disks are from 6140.
                c7t1 and c6t0 are disks from 2150. These two disk are from single controller and are identical.