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