Wednesday, April 15, 2015

AUTO START STOP ORACLE DATABASE SCRIPT



Save this script with oracle.sh

 execute with root user.


#! /bin/sh
##! /usr/bin/ksh
# Description: Starts and stops the Oracle database and listeners
# See how we were called.
export ORACLE_HOME=/u01/app/oracle/product
export LISTENER_NAME=LISTENER
case "$1" in
  start)
        echo -n "Starting Oracle Listeners: "
        su - oracle -c "lsnrctl start ${LISTENER_NAME}" >> /var/log/oracle
        echo "Done."
        echo ""
        echo -n "Starting Oracle Databases: "
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        su - oracle -c dbstart ${ORACLE_HOME} >> /var/log/oracle
        echo "Done."
        echo ""
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Finished." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        ;;
  stop)
        echo -n "Shutting Down Oracle Listeners: "
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Shutting Down Oracle Databases as part of system down." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        su - oracle -c "lsnrctl stop ${LISTENER_NAME}" >> /var/log/oracle
        echo "Done."
        echo -n "Shutting Down Oracle Databases: "
        su - oracle -c dbshut ${ORACLE_HOME} >> /var/log/oracle
        echo "Done."
        echo ""
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Finished." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        ;;
  *)
        echo "Usage: oracle {start|stop}"
        exit 1
esac
bash-4.3# ./oracle.sh start
bash-4.3# ./oracle.sh stop

Enjoy


Monday, April 6, 2015

PATCH APPLY USING OPATCH UTILITY



Unzip the patch file and read carefully README.html file.
and follow step by step as per your environment.

below single instance database patching p9352237_112010_LINUX


[oracle@node1 oraInventory]$ export opatch
[oracle@node1 oraInventory]$ export PATH=$PATH:$HOME:$ORACLE_HOME/OPatch:/bin
[oracle@node1 oraInventory]$

[oracle@node1 oraInventory]$ cd 9352237/
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-32-12PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch apply
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-32-33PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '9352237' to OH '/u01/app/oracle/product/11.2.0/db_1'

Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:


Following executables are active :
/u01/app/oracle/product/11.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecutables" failed.
System intact, OPatch will not attempt to restore the system

OPatch failed with error code 74
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch apply
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-34-28PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '9352237' to OH '/u01/app/oracle/product/11.2.0/db_1'

Running prerequisite checks...

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.


Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9352237' for restore. This might take a while...
Backing up files affected by the patch '9352237' for rollback. This might take a while...
Execution of 'sh /u01/app/oraInventory/9352237/custom/scripts/pre -apply 9352237 ':


Return Code = 0

Patching component oracle.rdbms.rsf, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libpls11.a"  with "lib/libpls11.a/phd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libpls11.a"  with "lib/libpls11.a/ph2drv.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libpls11.a"  with "lib/libpls11.a/ph2oa.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kot.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgh.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgl2.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgl4.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/qct.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/kdzt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/sagedata.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/kdzilcs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/kdzc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/libdbtools11.a"  with "rdbms/lib/libdbtools11.a/krmq.o"

Patching component oracle.rdbms.dbscripts, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/prvtamgt.plb"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlu112i.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlu112x.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catexp.sql"

Patching component oracle.rdbms, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kspt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxtt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktcnq.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktur.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjbr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/k2g.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfafo.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfcfg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfmboot.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfmedd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfmrole.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfsicd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdo.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktcn.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktfa.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktud.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/aud.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kzam.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kks.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kks1.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kksc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfda.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfdp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfds.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kff.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfio.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfio0.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfn.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfnb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfnc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfns.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfnm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksfd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kkopq.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxfp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxfr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxfxq.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjbl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksucln.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksk.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdlw.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst00.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst01.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst11.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdstrr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcfis.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbz.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktsla.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktslm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/koks3.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kqf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kwqa.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kwqm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kko.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qesrc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qkna.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qksrc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kkqtutl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kkqs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/knlb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbk.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kzu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjbm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qksvc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksmg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdbl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdzh.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdblc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktein.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbz.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktsp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdblc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdo.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktsf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/atb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kwqid.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdlrci.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdlxdup.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kmgs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kmgsb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kzvdve.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qks3t.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbi.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdli.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/skptch.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktslj.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdza.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/libknlopt.a"  with "rdbms/lib/libknlopt.a/ktd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/libknlopt.a"  with "rdbms/lib/libknlopt.a/jox.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfdp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfdputl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfn.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfo.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ktd.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/jox.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/kfod.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/mkpatch.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/env_rdbms.mk"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/xml/xsl/kulob.xsl"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/xml/xsl/kustorag.xsl"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/cpu/scripts/bug9371993.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/cpu/scripts/bug9016295.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/scripts/bug8820324.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/11.2.0.1.1/catpsu.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/11.2.0.1.1/catpsu_rollback.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/bundledata_PSU.xml"

Patching component oracle.oraolap, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/liboraolap11.a"  with "lib/liboraolap11.a/xscarrot.o"

Patching component oracle.rdbms.deconfig, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.so"

Patching component oracle.javavm.server, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/db_1/javavm/install/jvm_exp.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/javavm/install/initjvm.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/javavm/install/jvmursc.sql"
Running make for target client_sharedlib
Running make for target irman
Running make for target ikfod
Running make for target irenamedg
Running make for target idgmgrl
Running make for target imkpatch
Running make for target client_sharedlib
Running make for target ioracle
ApplySession adding interim patch '9352237' to inventory

Verifying the update...
Inventory check OK: Patch ID 9352237 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 9352237 are present in Oracle Home.

--------------------------------------------------------------------------------
********************************************************************************
********************************************************************************
**                                ATTENTION                                   **
**                                                                            **
** Please note that the Patch Set Update Installation (PSU Deinstallation)    **
** is not complete until all the Post Installation (Post Deinstallation)      **
** instructions noted in the Readme accompanying this PSU, have been          **
** successfully completed.                                                    **
**                                                                            **
********************************************************************************
********************************************************************************

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

Execution of 'sh /u01/app/oraInventory/9352237/custom/scripts/post -apply 9352237 ':


Return Code = 0

The local system has been patched and can be restarted.


OPatch succeeded.
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch lsinv
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-47-55PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-04-06_15-47-55PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  9352237      : applied on Mon Apr 06 15:44:11 IST 2015
Unique Patch ID:  12243774
   Created on 24 Mar 2010, 05:22:35 hrs PST8PDT
   Bugs fixed:
     8661168, 8769239, 8898852, 8801119, 9054253, 8706590, 8725286, 8974548
     8778277, 8780372, 8769569, 9027691, 9454036, 9454037, 9454038, 8761974
     7705591, 8496830, 8702892, 8639114, 8723477, 8729793, 8919682, 8818983
     9001453, 8475069, 9328668, 8891929, 8798317, 8820324, 8733749, 8702535
     8565708, 9036013, 8735201, 8684517, 8870559, 8773383, 8933870, 8812705
     8405205, 8822365, 8813366, 8761260, 8790767, 8795418, 8913269, 8897784
     8760714, 8717461, 8671349, 8775569, 8898589, 8861700, 8607693, 8642202
     8780281, 9369797, 8780711, 8784929, 8834636, 9015983, 8891037, 8828328
     8570322, 8832205, 8665189, 8717031, 8685253, 8718952, 8799099, 8633358
     9032717, 9321701, 8588519, 8783738, 8796511, 8782971, 8756598, 9454385
     8856497, 8703064, 9066116, 9007102, 8721315, 8818175, 8674263, 9352237
     8753903, 8720447, 9057443, 8790561, 8733225, 9197917, 8928276, 8991997, 8837736



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

OPatch succeeded.
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$

[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch lsinventory
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-57-56PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-04-06_15-57-56PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  9352237      : applied on Mon Apr 06 15:44:11 IST 2015
Unique Patch ID:  12243774
   Created on 24 Mar 2010, 05:22:35 hrs PST8PDT
   Bugs fixed:
     8661168, 8769239, 8898852, 8801119, 9054253, 8706590, 8725286, 8974548
     8778277, 8780372, 8769569, 9027691, 9454036, 9454037, 9454038, 8761974
     7705591, 8496830, 8702892, 8639114, 8723477, 8729793, 8919682, 8818983
     9001453, 8475069, 9328668, 8891929, 8798317, 8820324, 8733749, 8702535
     8565708, 9036013, 8735201, 8684517, 8870559, 8773383, 8933870, 8812705
     8405205, 8822365, 8813366, 8761260, 8790767, 8795418, 8913269, 8897784
     8760714, 8717461, 8671349, 8775569, 8898589, 8861700, 8607693, 8642202
     8780281, 9369797, 8780711, 8784929, 8834636, 9015983, 8891037, 8828328
     8570322, 8832205, 8665189, 8717031, 8685253, 8718952, 8799099, 8633358
     9032717, 9321701, 8588519, 8783738, 8796511, 8782971, 8756598, 9454385
     8856497, 8703064, 9066116, 9007102, 8721315, 8818175, 8674263, 9352237
     8753903, 8720447, 9057443, 8790561, 8733225, 9197917, 8928276, 8991997, 8837736



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

OPatch succeeded.



//////////////////////


[oracle@node1 ~]$ cd $ORACLE_HOME/rdbms/admin
[oracle@node1 admin]$
[oracle@node1 admin]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 15:48:52 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL>  CONNECT / AS SYSDBA
Connected to an idle instance.
SQL>
SQL>  STARTUP
ORACLE instance started.

Total System Global Area  393375744 bytes
Fixed Size                  1336764 bytes
Variable Size             285215300 bytes
Database Buffers          100663296 bytes
Redo Buffers                6160384 bytes
Database mounted.
Database opened.
SQL> @catbundle.sql psu apply

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.




SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 16:15:53 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from sys.v$version ;


[oracle@node1 9352237]$

ACTION_TIME                    ACTION NAMESP VERSION                                ID COMMENTS             BUNDLE_SERIES
------------------------------ ------ ------ ------------------------------ ---------- -------------------- ------------------------------
06-APR-15 03.51.39.966420 PM   APPLY  SERVER 11.2.0.1                                1 PSU 11.2.0.1.1       PSU


Thursday, January 15, 2015

DATABASE NAME AND DBID CHANGE USING NID UTILITY

login as: oracle
Using keyboard-interactive authentication.
Password:
Last login: Mon Jan 12 13:09:43 2015 from 192.168.68.38
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
$
$
$ bash

bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:18:19 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL>
SQL>
SQL> startup mount
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
Database mounted.
SQL>
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- ----------
NMS       MOUNTED

SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:20:12 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> alter database open;

Database altered.

SQL> alter user sys identified by sys;

User altered.

SQL> conn sys/sys as sysdba
Connected.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:21:02 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:21:50 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
Database mounted.
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ nid target =/ dbname=nms1

DBNEWID: Release 10.2.0.2.0 - Production on Mon Jan 12 14:22:22 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to database NMS (DBID=2769379598)

Connected to server version 10.2.0

Control Files in database:
    /opt/oracle/oradata/NMS/control01.ctl
    /opt/oracle/oradata/NMS/control02.ctl
    /opt/oracle/oradata/NMS/control03.ctl

Change database ID and database name NMS to NMS1? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 2769379598 to 858488030
Changing database name from NMS to NMS1
    Control File /opt/oracle/oradata/NMS/control01.ctl - modified
    Control File /opt/oracle/oradata/NMS/control02.ctl - modified
    Control File /opt/oracle/oradata/NMS/control03.ctl - modified
    Datafile /opt/oracle/oradata/NMS/system01.dbf - dbid changed, wrote new name
    Datafile /opt/oracle/oradata/NMS/undotbs01.dbf - dbid changed, wrote new nam
    Datafile /opt/oracle/oradata/NMS/sysaux01.dbf - dbid changed, wrote new name
    Datafile /opt/oracle/oradata/NMS/users01.dbf - dbid changed, wrote new name
    Datafile /opt/oracle/oradata/NMS/example01.dbf - dbid changed, wrote new nam
    Datafile /opt/oracle/oradata/NMS/temp01.dbf - dbid changed, wrote new name
    Control File /opt/oracle/oradata/NMS/control01.ctl - dbid changed, wrote new
    Control File /opt/oracle/oradata/NMS/control02.ctl - dbid changed, wrote new
    Control File /opt/oracle/oradata/NMS/control03.ctl - dbid changed, wrote new
    Instance shut down

Database name changed to NMS1.
Modify parameter file and generate a new password file before restarting.
Database ID for database NMS1 changed to 858488030.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.

bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:23:07 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> exit
Disconnected
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$ su - oracle
Password:
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
$
$
$ bash
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:24:03 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
ORA-01103: database name 'NMS1' in control file is not 'NMS'


SQL> select open_mode from v$database;
select open_mode from v$database
                      *
ERROR at line 1:
ORA-01507: database not mounted


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:24:44 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shut immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:25:00 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL>
SQL> exit
Disconnected
bash-3.00$
bash-3.00$
bash-3.00$ export ORACLE_SID=NMS1
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:26:42 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount pfile='/opt/oracle/admin/NMS/pfile/init.ora.112520141420'
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
Database mounted.
SQL>
SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      NMS1
SQL>
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open RESETLOGS;


Database altered.

SQL> SQL>

Monday, December 8, 2014

ADD DATAFILE IN RAC WITH ASM



Step 1: Check Space in ASM DiaskGroups

SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;

NAME                              FREE_MB   TOTAL_MB PERCENTAGE
------------------------------ ---------- ---------- ----------
WEBLOGDB_DATA1                          2         185080 .001080614
WEBLOGDB_DATA2                      19065     185080 10.3009509
WEBLOGDB_DATA3                      27253     185080 14.7249838
REDO                                               87549      139232 62.8799414

SQL>
SQL>
SQL>
SQL>














Step 2:  Add Datafile with respective ASM diskgroups

SQL>
SQL> ALTER TABLESPACE USERS ADD DATAFILE '+WEBLOGDB_DATA3' SIZE 100M  AUTOEXTEND ON  MAXSIZE 10240M;

Tablespace altered.

SQL>

Step 3: Check and verify datafile

SQL> select a.FILE#,a.CREATION_TIME,b.TABLESPACE_NAME,b.FILE_NAME ,b.BYTES/1024/1024 from v$datafile a ,dba_data_files b where a.FILE#=b.FILE_ID and b.TABLESPACE_NAME='&TABLESPACE_NAME'  order by a.CREATION_TIME,b.FILE_ID





ORA-10873: file 1 needs to be either taken out of backup mode or media recovered

[oracle@racha1 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 2 16:50:33 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>
SQL> startup
ORACLE instance started.

Total System Global Area  636100608 bytes
Fixed Size                  1338392 bytes
Variable Size             184550376 bytes
Database Buffers          444596224 bytes
Redo Buffers                5615616 bytes
Database mounted.
ORA-10873: file 1 needs to be either taken out of backup mode or media
recovered
ORA-01110: data file 1: '+DATA/testdb/datafile/system.271.860462435'



///////////////

[oracle@racha1 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 2 16:50:33 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>
SQL> startup
ORACLE instance started.

Total System Global Area  636100608 bytes
Fixed Size                  1338392 bytes
Variable Size             184550376 bytes
Database Buffers          444596224 bytes
Redo Buffers                5615616 bytes
Database mounted.
ORA-10873: file 1 needs to be either taken out of backup mode or media
recovered
ORA-01110: data file 1: '+DATA/testdb/datafile/system.271.860462435'


SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[oracle@racha1 ~]$
[oracle@racha1 ~]$
[oracle@racha1 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 2 16:54:02 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL>
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
MOUNTED

SQL>
SQL>
SQL> select * from v$backup;

     FILE# STATUS                CHANGE# TIME
---------- ------------------ ---------- ---------
         1 ACTIVE                1541869 02-DEC-14
         2 ACTIVE                1541869 02-DEC-14
         3 ACTIVE                1541869 02-DEC-14
         4 ACTIVE                1541869 02-DEC-14
         5 ACTIVE                1541869 02-DEC-14
         6 ACTIVE                1541869 02-DEC-14
         7 ACTIVE                1541869 02-DEC-14
         8 ACTIVE                1541869 02-DEC-14
         9 ACTIVE                1541869 02-DEC-14

9 rows selected.

SQL>
SQL>
SQL> alter database end backup;

Database altered.

SQL>
SQL> select * from v$backup;

     FILE# STATUS                CHANGE# TIME
---------- ------------------ ---------- ---------
         1 NOT ACTIVE            1541869 02-DEC-14
         2 NOT ACTIVE            1541869 02-DEC-14
         3 NOT ACTIVE            1541869 02-DEC-14
         4 NOT ACTIVE            1541869 02-DEC-14
         5 NOT ACTIVE            1541869 02-DEC-14
         6 NOT ACTIVE            1541869 02-DEC-14
         7 NOT ACTIVE            1541869 02-DEC-14
         8 NOT ACTIVE            1541869 02-DEC-14
         9 NOT ACTIVE            1541869 02-DEC-14

9 rows selected.

SQL>
SQL> alter database open;

Database altered.

SQL>
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL>
SQL>

Friday, November 14, 2014

ASM MONITORING COMMAND

///////////TO CHECK DISKGROUP SPACE INFORMATION

SQL> SELECT name, free_mb/1024, total_mb/1024, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;


////////////////////IDENTIFY CANDIDATE DISK



 SELECT
    NVL(a.name, '[CANDIDATE]') as disk_group_name
  , b.path as disk_file_path
  , b.name as disk_file_name
  , b.failgroup as disk_file_fail_group
 FROM
    v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number)
 ORDER BY
    a.name;


/////////////////////CHECK ASM FILE INFORMATION

select file_number , sum(bytes)/(1024*1024) from v$asm_file group by file_number;

ORACLE RAC MONITORING COMMANDS

/////////////////check services

dbserver2:oracle$
dbserver2:oracle$
dbserver2:oracle$
dbserver2:oracle$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    dbserver1
ora....R1.lsnr application    ONLINE    ONLINE    dbserver1
ora....er1.vip application    ONLINE    ONLINE    dbserver1
ora....SM2.asm application    ONLINE    ONLINE    dbserver2
ora....R2.lsnr application    ONLINE    ONLINE    dbserver2
ora....er2.gsd application    ONLINE    ONLINE    dbserver2
ora....er2.ons application    ONLINE    ONLINE    dbserver2
ora....er2.vip application    ONLINE    ONLINE    dbserver2
ora....ogdb.db application    ONLINE    ONLINE    dbserver1
ora....ebdb.cs application    ONLINE    ONLINE    dbserver1
ora....db1.srv application    ONLINE    ONLINE    dbserver1
ora....db2.srv application    ONLINE    ONLINE    dbserver2
ora....b1.inst application    ONLINE    ONLINE    dbserver1
ora....b2.inst application    ONLINE    ONLINE    dbserver2
dbserver2:oracle$
dbserver2:oracle$
dbserver2:oracle$




/////////////////////////////cluster health status


dbserver1:oracle$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
dbserver1:oracle$
dbserver1:oracle$



/////////////////ocr backup info


dbserver2:oracle$ ocrconfig -showbackup

dbserver1     2014/10/07 11:47:21     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/10/07 07:47:21     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/10/07 03:47:19     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/10/05 19:47:11     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/09/29 07:46:33     /u01/app/oracle/product/10.2.0/crs/cdata/crs
dbserver2:oracle$





//////////////////////all node cluster database status

dbserver1:oracle$
dbserver1:oracle$ srvctl status database -d weblogdb
Instance weblogdb1 is running on node dbserver1
Instance weblogdb2 is running on node dbserver2
dbserver1:oracle$


///////////////////////////instance staus

////node1

srvctl status instance -d weblogdb -i weblogdb1

dbserver1:oracle$ srvctl status instance -d weblogdb -i weblogdb1
Instance weblogdb1 is running on node dbserver1
dbserver1:oracle$


////node2

srvctl status instance -d weblogdb -i weblogdb2

dbserver2:oracle$
dbserver2:oracle$ srvctl status instance -d weblogdb -i weblogdb2
Instance weblogdb2 is running on node dbserver2
dbserver2:oracle$
dbserver2:oracle$




////////////////////asm instance status/////////////////////////////////






////node1

srvctl status asm -n dbserver1

dbserver1:oracle$
dbserver1:oracle$ srvctl status asm -n dbserver1
ASM instance +ASM1 is running on node dbserver1.
dbserver1:oracle$
dbserver1:oracle$


////////node2

srvctl status asm -n dbserver2

dbserver2:oracle$
dbserver2:oracle$ srvctl status asm -n dbserver2
ASM instance +ASM2 is running on node dbserver2.
dbserver2:oracle$


///////////////////cluster nodeapps status/////////////////////////////////////////////





////node1

srvctl status nodeapps -n dbserver1
dbserver1:oracle$
dbserver1:oracle$ srvctl status nodeapps -n dbserver1
VIP is running on node: dbserver1

///node2

srvctl status nodeapps -n dbserver2
dbserver2:oracle$
dbserver2:oracle$ srvctl status nodeapps -n dbserver2
VIP is running on node: dbserver2
GSD is running on node: dbserver2
Listener is running on node: dbserver2
ONS daemon is running on node: dbserver2
dbserver2:oracle$


/////////////////////

canva popular keywords

Business & Work Keyword Template Style / Use Case Presentation Business decks, pitches, school slides Report Annual reports, whitepapers...