Monday 28 December 2015

RAC Full Configuration step by step using third party Storage Openfiler

Configuration RACNODES
----------*********----------

vi /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6


# Public Network - (eth0)
192.168.1.35     rac1.dba.com       rac1
192.168.1.36     rac2.dba.com       rac2

# Private Interconnect - (eth1)
192.168.0.135   rac1-priv.dba.com  rac1-priv
192.168.0.136   rac2-priv.dba.com  rac2-priv

# Public Virtual IP (VIP) addresses for - (eth0)
192.168.1.202   rac1-vip.dba.com  rac1-vip
192.168.1.203   rac2-vip.dba.com  rac2-vip

# Scan IP
192.168.1.188   cluster-scan

#Openfile Ip
192.168.1.100 san.dba.com san


5.1.2. Edit the -sysctl.conf- of orcl1 with the following values.

vi /etc/sysctl.conf

-------------------

kernel.core_uses_pid = 1
kernel.shmmax=4294967295
kernel.sem=256 32000 100 142
fs.file-max = 6815744
kernel.msgmnb = 65535
kernel.msgmni = 2878
net.core.rmem_default = 262144
net.core.rmem_max =  4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 262144 262144 262144

fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

kernel.shmmni = 4096


5.1.3. Edit the -limits.conf- file  of orcl1 with the following values.

vi /etc/security/limits.conf
----------------------------

hard nofile 65535
soft nofile 4096
hard nproc 16384
soft nproc 2047
grid hard nofile 65536
oracle hard nofile 65536

Run the following command to change the current kernel parameters.
/sbin/sysctl -p


5.1.4. Create groups and users

------------------------------

groupadd -g 501 oinstall
groupadd -g 502 dba
useradd -u 503 -g oinstall -G dba oracle
passwd oracle

5.1.5. Install missing packages

-------------------------------

Caution: If you are getting warning
cd /etc/pki/rpm-gpg/
rpm -import RPM-GPG-KEY

If already rpm installed with warning use --force after -Uvh
example rpm -Uvh --force binutils-2.*

# cd /stage/54
# more run54.txt
Copy the output and paste it.
Ensure all rpms installed with out any warning messages.

-------------------------------------------------------------

Create the directories in which the Oracle software will be installed.

mkdir -p  /u01/app/11.2.0/grid

mkdir -p /u01/app/oracle/product/11.2.0/db_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01/

Disable NTP

-----------

Either configure NTP, or make sure it is not configured so the Oracle Cluster Time Synchronization Service (ctssd) can synchronize the times of the RAC nodes. If you want to deconfigure NTP do the following.

# service ntpd stop
Shutting down ntpd:                                        [  OK  ]

# chkconfig ntpd off

# mv /etc/ntp.conf /etc/ntp.conf.orig

# rm /var/run/ntpd.pid

Login as oracle and set the following in .bash_profile

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=rac2.dba.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=sales; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
GRID_HOME=/u01/app/11.2.0/grid; export GRID_HOME
DB_HOME=$ORACLE_BASE/product/11.2.0/db_1; export DB_HOME
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi

alias grid_env='. /home/oracle/grid_env'
alias db_env='. /home/oracle/db_env'

-------------------------------------------------------------------

Create a file called "/home/oracle/grid_env" with the following contents.  Add the following contents to set grid environment.

ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

----------------------------------------------------------------------

Create a file called "/home/oracle/db_env" with the following contents.  Add the following contents to set database environment.

PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
export ORACLE_UNQNAME=sales
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

-----------------------------------------------------------------------

Verify bash profiles:
Once the "/home/oracle/grid_env" has been run, you will be able to switch between environments as follows.

$ . grid_env

$ echo $ORACLE_HOME
/u01/app/11.2.0/grid

$ . db_env

$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1

Enableing the ISCSI-TARGET for Both Nodes.

This is status of LUN after mapping. From systems tab iscsi-target.

Client [iscsi initiator] Configuration:
Here we are using a redhat enterprise linux5 as client. In order to use openfiler target as disk, it has to be set as iscsi initiator. For that we need to install the following package.

#rpm -ivh iscsi-initiator-utils-6.2.0.865-0.8.el5.i386.rpm

# service iscsid start

Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]

# chkconfig iscsid on
# chkconfig iscsi on

Searching the iscsi target:

# iscsiadm -m discovery -t sendtargets -p 192.168.0.29
You can also use port number if you want. As follows

# iscsiadm -m discovery -t sendtargets -p 192.168.0.29:3260
192.168.0.27:3260,1 iqn.2006-01.com.openfiler:storage.lap

You will get the scanned result as the line above.

Loging in to the iscsi target:

# iscsiadm -m node -T 192.168.0.27:3260,1 iqn.2006-01.com.openfiler:storage.lap -p 192.168.0.29 -l

-l or --login

#fdisk -l

will list the iscsi targets now.

Example:

[root@server ~]# iscsiadm -m discovery -t sendtargets -p 192.168.0.29
192.168.0.29:3260,1 iqn.2006-01.com.openfiler:storage.lap

[root@server ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:storage.lap -p 192.168.0.29 -l

fdisk -l -> formating newly added asm disks on RAC1

fdisk /dev/sdb -> n,p,1,w
fdisk /dev/sdc -> n,p,1,w
fdisk /dev/sdd -> n,p,1,w
fdisk /dev/sde -> n,p,1,w

# /etc/init.d/oracleasm configure -i
                 -> oracle
                 -> dba
                 -> y,y

# oracleasm init  -> No messages also fine
# oraclasm status -> check the output it is mounted, that is fine.

/usr/sbin/oracleasm createdisk DISK1 /dev/sdb1
/usr/sbin/oracleasm createdisk DISK2 /dev/sdc1
/usr/sbin/oracleasm createdisk DISK3 /dev/sdd1
/usr/sbin/oracleasm createdisk DISK4 /dev/sde1


# oracleasm listdisks

/**************************************************************************
/*  The following is not required and should not be run  - run by advice by seniors only  */
# ./oracleasm stop
# ./oracleasm start
# ./oracleasm exit
#  oracleasm init  -> should show output as it is mounted
# oracleasm scandisks  -> should show up all the DISK* Instantiating...

**************************************************************************

start RAC1
and
start RAC2

Set network adapters
set hostname in neat
change grid_env,db_env if required
ping both priv and host ips

start grid installation
if you not using DNS SERVER then remove this file.
#mv /etc/resolv.conf /etc/resolv.conf_bkp


Thanks Comments Please.

Tuesday 22 December 2015

Top Monitoring RAC Commands

Top Monitoring RAC Commands

Check the status of the cluster

[oracle@rac1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

[oracle@rac1 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

[oracle@rac1 ~]$crsctl check cluster -all
**************************************************************
rac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

Check the status of the services on the cluster

[oracle@rac1 ~]$ crsctl status resource -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE rac1
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ora.asm
ONLINE ONLINE rac1
ora.gsd
OFFLINE OFFLINE rac1
ora.net1.network
ONLINE ONLINE rac1
ora.ons
ONLINE ONLINE rac1
ora.registry.acfs
ONLINE ONLINE rac1
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 OFFLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE rac1
ora.testrac.db
1 OFFLINE OFFLINE Instance Shutdown

Stop crs on all nodes (only one node up in this example)

[root@rac1 bin]# ./crsctl stop cluster -all
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘rac1’
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘rac1’
CRS-2673: Attempting to stop ‘ora.registry.acfs’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.cvu’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.oc4j’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.rac1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.scan1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.rac1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cvu’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.registry.acfs’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.oc4j’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.DATA.dg’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ‘rac1’
CRS-2677: Stop of ‘ora.ons’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘rac1’
CRS-2677: Stop of ‘ora.net1.network’ on ‘rac1’ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘rac1’ has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘rac1’
CRS-2677: Stop of ‘ora.evmd’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘rac1’
CRS-2677: Stop of ‘ora.cssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘rac1’
CRS-2677: Stop of ‘ora.diskmon’ on ‘rac1’ succeeded

Stop crs on specifc node

[root@rac1 bin]# ./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘rac1’
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘rac1’
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘rac1’
CRS-2673: Attempting to stop ‘ora.cvu’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.registry.acfs’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.oc4j’ on ‘rac1’
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.rac1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.rac1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.scan1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cvu’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.oc4j’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.registry.acfs’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.DATA.dg’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ‘rac1’
CRS-2677: Stop of ‘ora.ons’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘rac1’
CRS-2677: Stop of ‘ora.net1.network’ on ‘rac1’ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘rac1’ has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.crf’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘rac1’
CRS-2677: Stop of ‘ora.evmd’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.crf’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘rac1’
CRS-2677: Stop of ‘ora.cssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘rac1’
CRS-2677: Stop of ‘ora.gipcd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘rac1’
CRS-2677: Stop of ‘ora.diskmon’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.gpnpd’ on ‘rac1’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘rac1’ has completed
CRS-4133: Oracle High Availability Services has been stopped.

Disable CRS from starting on reboot

[root@rac1 bin]# ./crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.

Enable CRS to start on reboot

[root@rac1 bin]# ./crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.

Start crs on specifc node

[root@rac1 bin]# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.

Check database status

[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is running on node rac1
Instance RACDB2 is running on node rac2
Stop an instance

[oracle@rac1 ~]$ srvctl stop instance -i RACDB1 -d RACDB

[oracle@rac1 ~]$srvctl status database -d RACDB
Instance RACDB1 is not running on node rac1
Instance RACDB2 is running on node rac2

Start an instance

[oracle@rac1 ~]$ srvctl start instance -i RACDB1 -d RACDB

[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is running on node rac1
Instance RACDB2 is running on node rac2

Stop the database

[oracle@rac1 ~]$ srvctl stop database -d RACDB

[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is not running on node rac1
Instance RACDB2 is not running on node rac2

Start the database

[oracle@rac1 ~]$ srvctl start database -d RACDB

[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is running on node rac1
Instance RACDB2 is running on node rac2

Stop the listener on a Node

[oracle@rac1 ~]$ srvctl status listener -n rac1
Listener LISTENER is enabled on node(s): rac1
Listener LISTENER is not running on node(s): rac1

Start the listener on a Node

[oracle@rac1 ~]$ srvctl status listener -n rac1
Listener LISTENER is enabled on node(s): rac1
Listener LISTENER is running on node(s): rac1

Check the voting disk
[oracle@rac1 ~]$ crsctl query cssvotedisk
## STATE File Universal Id File Name Disk group
— —– —————– ——— ———
1. ONLINE 91b18024f9674f83bf5117d3c0996a05 (ORCL:VOL1) [DATA]
Located 1 voting disk(s).

Query the network addresses

[oracle@rac1 ~]$ oifcfggetif
eth0 192.168.245.0 global public
eth1 192.168.126.0 global cluster_interconnect

Show OCR backup – the voting file (disk) is also backed up with the OCR backup

[root@rac1 bin]# ./ocrconfig -showbackup
rac1 2012/07/17 07:47:17 /u01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocr
rac1 2012/07/17 03:47:15 /u01/app/11.2.0/grid/cdata/rac-cluster/backup01.ocr
rac1 2012/07/16 23:47:13 /u01/app/11.2.0/grid/cdata/rac-cluster/backup02.ocr
rac1 2012/07/16 19:47:11 /u01/app/11.2.0/grid/cdata/rac-cluster/day.ocr
rac1 2012/07/16 19:47:11 /u01/app/11.2.0/grid/cdata/rac-cluster/week.ocr
rac1 2012/03/23 11:30:19 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120323_113019.ocr

Take a manual backup of the OCR

[root@rac1 bin]# ./ocrconfig -manualbackup
rac1 2012/07/17 10:08:28 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120717_100828.ocr
rac1 2012/07/17 10:07:39 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120717_100739.ocr
rac1 2012/03/23 11:30:19 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120323_113019.ocr


COMMAND                                      DESCRIPTION
---------------------------------------------------------------------
crsctl status resource –t                      Clusterware Resource Status Check

srvctl status database -d ORCL        STATUS OF DATABASE

srvctl stop listener -l LISTENER_NAME      STOP A LISTENER

srvctl start listener -l LISTENER_NAME      START A LISTENER

crsctl stop has                                    stop all the clusterware services/ resources on specific node (including DB and listener) (run as root)

crsctl start has                                    start all the clusterware services/ resources on specific node (including DB and listener) (run as root)

crsctl stop cluster –all            to stop csr services on all nodes of clusterware (run as root)

crsctl start cluster –all           to start crs services on all nodes of clusterware (run as root)

crsctl check has                   to check if ohasd is running/ stopped (run as root)

crsctl enable has                  enable Oracle High Availability Services autostart (run as root)

crsctl disable has                 disable Oracle High Availability Services autostart (run as root)

crsctlconfig has                    check if Oracle High Availability Services autostart is enabled/ disabled (run as root)

srvctl status nodeapps         to check the status of services on all nodes

crsctl stop crs                                      stop all the cluster ware services/ resources ON THAT NODE! (run as root)

crsctl start crs                      start all the cluster ware services/ resources ON THAT NODE! (run as root)

cluvfy comp scan –verbose                Verifying scan status scan_listener                        

srvctlconfigscan_listener                    Verifying scan port

srvctl relocate scan -i 1 -n NODE1    Relocate scan listener 1 to the mentioned node
 
/etc/init.d/init.crs start                        START CRS PROCESS (AS ROOT USER)
 
srvctl start asm -n NODE1                START ASM INSTANCE on node 1
 
srvctl start asm -n NODE2                 START ASM INSTANCE on node 2
 
srvctl start database -d ORCL          START DATABASE
 
srvctl start instance -d ORCL -i ORCL1    START first INSTANCE (skip it if running 'start database' as that will start both instances)
 
srvctl start instance -d ORCL -i ORCL2    START second INSTANCE (skip it if running 'start database', as taht will start both instances)
 
srvctl start nodeapps -n NODE1                      START NODEAPPS on NODE1
 
srvctl start nodeapps -n NODE2                      START NODEAPPS ON NODE2
 
srvctl stop database -d ORCL                          STOP DATABASE 
 
srvctl stop instance -d ORCL -i ORCL1     STOP first INSTANCE (skip it if running 'stop database' as that will 
                                                                        stop both instances)
 
srvctl stop instance -d ORCL -i ORCL2     STOP second INSTANCE (skip it if running 'stop database' as that will
                                                                       stop both instances)
 
srvctl stop asm -n NODE1                 STOP ASM INSTANCES on NODE 1 (In 11G , we have OCR on ASM
                                                             so we cannot stop ASM, but if you have OCR in NON-ASM you should stop it)
 
srvctl stop asm -n NODE2                 STOP ASM INSTANCES on NODE 2 (In 
 
11G , we have OCR on ASM so we cannot stop ASM, but if you have OCR in NON-ASM 
you should stop it)
 
srvctl stop nodeapps -n NODE1                       STOP NODEAPPS  on NODE 1
 
srvctl stop nodeapps -n NODE2                       STOP NODEAPPS  on NODE 2
 
/etc/init.d/init.crsstop                                         STOP CRS PROCESSES (AS ROOT USER)



Thanks (Comments please)

Saturday 12 December 2015

How to Generate an ASH Report

How to Generate an ASH Report

Transient performance problems are short-lived and do not appear in the Automatic Database Diagnostics Monitor (ADDM) analysis. ADDM tries to report the most significant performance problems during an analysis period in terms of their impact on DB time. If a particular problem lasts for a very short duration, then its severity might be averaged out or minimized by other performance problems in the analysis period. Therefore, the problem may not appear in the ADDM findings. Whether a performance problem is captured by ADDM depends on its duration compared to the interval between the AWR snapshots.

If a performance problem lasts for a significant portion of the time between snapshots, it will be captured by ADDM. For example, if the snapshot interval is set to one hour, a performance problem that lasts for 30 minutes should not be considered as a transient performance problem because its duration represents a significant portion of the snapshot interval and will likely be captured by ADDM.

However, a performance problem that lasts for only 2 minutes could be a transient performance problem because its duration represents a small portion of the snapshot interval and will likely not show up in the ADDM findings. For example, if the user notifies you that the system was slow between 10:00 p.m. and 10:10 p.m., but the ADDM analysis for the time period between 10:00 p.m. and 11:00 p.m. does not show a performance problem, a transient performance problem probably occurred that lasted for only a few minutes of the 10-minute interval reported by the user.

How to generate an ASH Report for a single instance/RAC database.
SOLUTION :
Generating an ASH Report

The ashrpt.sql SQL script generates an HTML or text report that displays ASH information for a specified duration.

To generate an ASH report:

1. At the SQL prompt, enter:

@$ORACLE_HOME/rdbms/admin/ashrpt.sql

2. Specify whether you want an HTML or a text report:

Enter value for report_type: text

In this example, a text report is chosen.

3. Specify the begin time in minutes before the system date:

Enter value for begin_time: -10

In this example, 10 minutes before the current time is selected.

4. Enter the duration in minutes that the report for which you want to capture ASH information from the begin time.

Enter value for duration:

In this example, the default duration of system date minus begin time is accepted.

5. Enter a report name, or accept the default report name:

Enter value for report_name:
Using the report name ashrpt_1_0310_0131.txt

In this example, the default name is accepted and an ASH report named ashrpt_1_0310_0131 is generated. The report will gather ASH information beginning from 10 minutes before the current time and ending at the current time.

Generating an Oracle RAC ASH Report

The ashrpti.sql SQL script generates an HTML or text report that displays ASH information for a specified duration for specified databases and instances in an Oracle RAC environment. 

To generate an ASH report in an Oracle RAC environment:

1. At the SQL prompt, enter:

@$ORACLE_HOME/rdbms/admin/ashrpti.sql

2. Specify whether you want an HTML or a text report:

Enter value for report_type: html

In this example, an HTML report is chosen.

3. A list of available database IDs and instance numbers are displayed:

Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
----------- -------- ------------ ------------ ------------
3309173529 1 MAIN main examp1690
3309173529 1 TINT251 tint251 samp251
3309173529 2 TINT251 tint252 samp252
3309173529 3 TINT251 tint253 samp253
3309173529 4 TINT251 tint254 samp254

Enter the values for the database identifier (dbid) and instance number (inst_num):

Enter value for dbid: 3309173529
Using database id: 3309173529
Enter instance numbers. Enter 'ALL' for all instances in an Oracle
RAC cluster or explicitly specify list of instances (e.g., 1,2,3).
Defaults to current instance.
Enter value for inst_num: ALL
Using instance number(s): ALL

4. Specify the begin time in minutes before the system date:

Enter value for begin_time: -1:10

In this example, 1 hour and 10 minutes before the current time is selected.

5. Enter the duration in minutes that the report for which you want to capture ASH information from the begin time:

Enter value for duration: 10

In this example, the duration is set to 10 minutes.

6. Specify the slot width in seconds that will be used in the Activity Over Time section of the report:

Enter value for slot_width:

In this example, the default value is accepted.

7. Follow the instructions as explained in the subsequent prompts and enter values for the following report targets:
* target_session_id
* target_sql_id
* target_wait_class
* target_service_hash
* target_module_name
* target_action_name
* target_client_id
* target_plsql_entry

8. Enter a report name, or accept the default report name:

Enter value for report_name:
Using the report name ashrpt_rac_0310_0131.txt

In this example, the default name is accepted and an ASH report named ashrpt_rac_0310_0131 is generated. The report will gather ASH information on all instances belonging to the database with a database ID value of 3309173529 beginning from 10 minutes before the current time and ending at the current time.


Thanks 
comments plz.