Monday 30 December 2013

upgrade Oracle single instance database 11.2.0.3 to PSU 7....

Recently I upgrade oracle database 11.2.0.3.0 single instance  database to PSU 7 on Linux server 6.4. I made this blog to shared upgrade step with you.In upgrade process I installed fresh database version 11.2.0.3 then apply the specified patch.

:- Required patches(s/w)

1)p10404530_112030_Linux-x86-64_1of7.zip
  p10404530_112030_Linux-x86-64_2of7.zip  ---database 11.2.0.3

2)p16619892_112030_Linux-x86-64.zip  --PSU 

3)p6880880_112000_Linux-x86-64.zip  --Opatch  


step 1) install database 11.2.0.3


step  2)go to software stored location (where oracle software and patch is present)

[oracle@sdceatonoamintg1 ~]$ ls

database  p10404530_112030_Linux-x86-64_1of7.zip  p10404530_112030_Linux-x86-64_2of7.zip  p16619892_112030_Linux-x86-64.zip  p6880880_112000_Linux-x86-64.zip

step 3) unzip OPatch in ORACLE_HOME path using below command

[oracle@sdceatonoamintg1 ~]$ unzip p6880880_112000_Linux-x86-64.zip -d /u01/app/oracle/product/11.2.0/db_1/

Archive:  p6880880_112000_Linux-x86-64.zip
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/README.html
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/README.txt
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/oplan.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/oracle.oplan.classpath.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/automation.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/OsysModel.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/EMrepoDrivers.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/Validation.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/ValidationRules.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/osysmodel-utils.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/patchsdk.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/CRSProductDriver.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/JMXDrivers.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/OuiDriver.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/bundle.jar
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/apache-commons/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/apache-commons/commons-cli-1.0.jar
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/jaxb/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/jaxb/activation.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/jaxb/jaxb-api.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/jaxb/jaxb-impl.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/jlib/jaxb/jsr173_1.0_api.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/oplan
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/oplan/oplan.bat
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/docs/FAQ? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/docs/FAQ
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/docs/Users_Guide.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/docs/Users_Guide.txt
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/docs/Prereq_Users_Guide.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/docs/Prereq_Users_Guide.txt
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/fa/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/fa/oracle.opatch.fa.classpath.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/fa/oracle.opatch.fa.classpath.unix.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/fa/oracle.opatch.fa.classpath.windows.jar
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/opatch.jar? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/opatch.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/opatchsdk.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/oracle.opatch.classpath.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/oracle.opatch.classpath.unix.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/jlib/oracle.opatch.classpath.windows.jar
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/opatch/opatch_prereq.xml? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/opatch/opatch_prereq.xml
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/opatch/rulemap.xml? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/opatch/rulemap.xml
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/opatch/runtime_prereq.xml? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/opatch/runtime_prereq.xml
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/oui/knowledgesrc.xml? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/oui/knowledgesrc.xml
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/prerequisite.properties? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchprereqs/prerequisite.properties
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/crs/
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/crs/log/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/crs/auto_patch.pl
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/crs/installPatch.excl
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/crs/patch112.pl
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/crs/patch11202.pl
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/crs/patch11203.pl
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch.bat? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch.bat
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch.pl
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch.ini? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch.ini
 extracting: /u01/app/oracle/product/11.2.0/db_1/OPatch/version.txt
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchdiag
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatchdiag.bat
replace /u01/app/oracle/product/11.2.0/db_1/OPatch/emdpatch.pl? [y]es, [n]o, [A]ll, [N]one, [r]ename: Y
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/emdpatch.pl
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/README.txt
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/bin/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/bin/emocmrsp
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/doc/
   creating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/emocmclnt-14.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/emocmclnt.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/emocmcommon.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/http_client.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/jcert.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/jnet.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/jsse.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/log4j-core.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/osdt_core3.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/osdt_jce.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/regexp.jar
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/lib/xmlparserv2.jar
 extracting: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/ocm.zip
  inflating: /u01/app/oracle/product/11.2.0/db_1/OPatch/ocm/ocm_platforms.txt


step 4) set OPatch path in oracle user 'bash_profile'

PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch  export PATH

step 5) check OPatch version or its Inventory

[oracle@sdceatonoamintg1 ~]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.5
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2013-12-26_04-42-42AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2013-12-26_04-42-42AM.txt

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

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


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.

step 6) [oracle@sdceatonoamintg1 ~]$ ls

16619892  database  p10404530_112030_Linux-x86-64_1of7.zip  p10404530_112030_Linux-x86-64_2of7.zip  p16619892_112030_Linux-x86-64.zip  p6880880_112000_Linux-x86-64.zip

[oracle@sdceatonoamintg1 ~]$cd 16619892

[oracle@sdceatonoamintg1 16619892]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.5
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2013-12-26_04-43-07AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   13343438  13696216  13923374  14275605  14727310  16056266  16619892

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y



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...
Applying sub-patch '13343438' to OH '/u01/app/oracle/product/11.2.0/db_1'

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...

Verifying the update...
Applying sub-patch '13696216' to OH '/u01/app/oracle/product/11.2.0/db_1'

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.sdo.locator, 11.2.0.3.0...

Patching component oracle.sysman.console.db, 11.2.0.3.0...

Patching component oracle.sysman.oms.core, 10.2.0.4.4...

Verifying the update...
Applying sub-patch '13923374' to OH '/u01/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.network.cman, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...

Patching component oracle.network.rsf, 11.2.0.3.0...

Patching component oracle.network.listener, 11.2.0.3.0...

Patching component oracle.sysman.console.db, 11.2.0.3.0...

Verifying the update...
Applying sub-patch '14275605' to OH '/u01/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.network.client, 11.2.0.3.0...

Patching component oracle.network.rsf, 11.2.0.3.0...

Patching component oracle.precomp.common, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...

Patching component oracle.rdbms.rman, 11.2.0.3.0...

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.rdbms.util, 11.2.0.3.0...

Verifying the update...
Applying sub-patch '14727310' to OH '/u01/app/oracle/product/11.2.0/db_1'

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.sdo.locator, 11.2.0.3.0...

Patching component oracle.sysman.console.db, 11.2.0.3.0...

Patching component oracle.sysman.oms.core, 10.2.0.4.4...

Verifying the update...
Applying sub-patch '16056266' to OH '/u01/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.network.cman, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.network.listener, 11.2.0.3.0...

Patching component oracle.network.rsf, 11.2.0.3.0...

Patching component oracle.ovm, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.rdbms.rman, 11.2.0.3.0...

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.sdo.locator, 11.2.0.3.0...

Patching component oracle.rdbms.deconfig, 11.2.0.3.0...

Verifying the update...
Applying sub-patch '16619892' to OH '/u01/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.marvel, 11.2.0.3.0...

Patching component oracle.precomp.common, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.rdbms.rman, 11.2.0.3.0...

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Patching component oracle.sysman.agent, 10.2.0.4.3...

Patching component oracle.sysman.console.db, 11.2.0.3.0...

Patching component oracle.sysman.repository.core, 10.2.0.4.4...

Patching component oracle.xdk, 11.2.0.3.0...

Patching component oracle.xdk.parser.java, 11.2.0.3.0...

Patching component oracle.xdk.rsf, 11.2.0.3.0...

Verifying the update...

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/u01/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'
/u01/app/oracle/product/11.2.0/db_1/precomp/lib/ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/u01/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'



OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'
/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'


Composite patch 16619892 successfully applied.
OPatch Session completed with warnings.

step 6) [oracle@sdceatonoamintg1 16619892]$ opatch lsinventory

Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.5
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2013-12-26_04-47-55AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2013-12-26_04-47-55AM.txt

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

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


Interim patches (1) :

Patch  16619892     : applied on Thu Dec 26 04:46:59 GMT-05:00 2013
Unique Patch ID:  16346737
Patch description:  "Database Patch Set Update : 11.2.0.3.7 (16619892)"
   Created on 23 Jun 2013, 09:03:20 hrs PST8PDT
Sub-patch  16056266; "Database Patch Set Update : 11.2.0.3.6 (16056266)"
Sub-patch  14727310; "Database Patch Set Update : 11.2.0.3.5 (14727310)"
Sub-patch  14275605; "Database Patch Set Update : 11.2.0.3.4 (14275605)"
Sub-patch  13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)"
Sub-patch  13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)"
Sub-patch  13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
   Bugs fixed:
     13593999, 13566938, 10350832, 14138130, 12919564, 13561951, 13624984
     13588248, 13080778, 13914613, 13804294, 14258925, 12873183, 13645875
     14472647, 12880299, 14664355, 12998795, 14409183, 13719081, 14469008
     13492735, 14263036, 12857027, 13496884, 13015379, 14263073, 13742433
     13732226, 16314469, 16368108, 12905058, 6690853, 13742434, 12849688
     12950644, 13742435, 13464002, 13063120, 13534412, 12879027, 13958038
     14613900, 12585543, 13790109, 12535346, 16382448, 12588744, 11877623
     12395918, 13814739, 13786142, 12847466, 13649031, 13855490, 13981051
     12582664, 12797765, 14262913, 12923168, 16279401, 12912137, 13612575
     13384182, 13466801, 13484963, 14207163, 13724193, 13772618, 11063191
     16694777, 13070939, 12797420, 15869211, 13041324, 16279211, 16314467
     16314468, 12976376, 11708510, 13680405, 13742437, 13026410, 14589750
     13737746, 13742438, 14644185, 15841373, 13326736, 13596521, 14398795
     13579992, 13001379, 16344871, 13099577, 9873405, 13742436, 14275605
     9858539, 14841812, 11715084, 16231699, 14040433, 9703627, 12662040
     12617123, 16530565, 14207317, 12845115, 12764337, 13354082, 14459552
     13397104, 13913630, 12964067, 12983611, 13550185, 12780983, 13810393
     12583611, 14546575, 15862016, 13476583, 13489024, 11840910, 13903046
     15862017, 13572659, 16294378, 13718279, 14088346, 13657605, 13448206
     16314466, 14480676, 13419660, 13632717, 14668670, 14063281, 14110275
     13430938, 13467683, 13420224, 13812031, 14548763, 16299830, 12646784
     14512189, 12755116, 14035825, 13616375, 13427062, 12861463, 12834027
     15862021, 13632809, 13377816, 13036331, 14727310, 16619892, 13685544
     13499128, 15862018, 13584130, 16175381, 12829021, 15862019, 12794305
     14546673, 12791981, 13561750, 13503598, 13787482, 10133521, 12718090
     13848402, 13399435, 14023636, 9095696, 13860201, 12401111, 13257247
     13362079, 14176879, 12917230, 16014985, 13923374, 14220725, 13524899
     14480675, 16306019, 13559697, 12974860, 9706792, 12940620, 14480674
     13916709, 13098318, 14076523, 13773133, 15905421, 16794244, 13340388
     12731940, 13528551, 13366202, 12894807, 13343438, 13454210, 12748240
     14205448, 13385346, 14127231, 15853081, 14273397, 14467061, 12971775
     13923995, 14571027, 13582702, 13907462, 10242202, 13493847, 13857111
     13035804, 13544396, 16382353, 8547978, 14226599, 16794241, 14062795
     13035360, 12925089, 12693626, 13332439, 14038787, 11071989, 14062796
     16794243, 12913474, 14841409, 14390252, 16314470, 13370330, 13059165
     14062797, 14062794, 12959852, 12345082, 13358781, 12960925, 16703112
     9659614, 14546638, 13699124, 13936424, 14301592, 16794240, 13338048
     12938841, 12658411, 12620823, 12656535, 14062793, 12678920, 13038684
     14062792, 13807411, 16742095, 16794238, 15862022, 12594032, 13250244
     12612118, 9761357, 14053457, 13742464, 14052474, 13911821, 13457582
     7509451, 13527323, 13791364, 15862020, 13910420, 12780098, 13502183
     13696216, 13705338, 10263668, 14841558, 16794242, 15862023, 16056266
     16794239, 15862024, 13554409, 13645917, 13103913, 12772404, 13011409, 14063280



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

OPatch succeeded.

step 7) install oracle database using dbca..

step 8) cd $ORACLE_HOME/rdbms/admin

[oracle@sdceatonoamintg1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Dec 26 05:39:26 2013

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


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

SQL> @catbundle.sql psu apply;

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


Generating apply and rollback scripts...
Check the following file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_OAMDB_GENERATE_2013Dec26_05_40_44.log
Apply script: /u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catbundle_PSU_OAMDB_APPLY.sql
Rollback script: /u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catbundle_PSU_OAMDB_ROLLBACK.sql

PL/SQL procedure successfully completed.

Executing script file...


SQL> COLUMN spool_file NEW_VALUE spool_file NOPRINT
SQL> SELECT '/u01/app/oracle/cfgtoollogs/catbundle/' || 'catbundle_PSU_' || name || '_APPLY_' || TO_CHAR(SYSDATE, 'YYYYMonDD_hh24_mi_ss', 'NLS_DATE_LANGUAGE=''AMERICAN''') || '.log' AS spool_file FROM v$database;


SQL> SPOOL &spool_file
SQL> exec dbms_registry.set_session_namespace('SERVER')

PL/SQL procedure successfully completed.

SQL> PROMPT Processing EM Repository...
Processing EM Repository...
SQL> ALTER SESSION SET current_schema = sys;

Session altered.

SQL> @?/patch/scripts/admin_backport_14459552.sql
SQL> Rem
SQL> Rem $Header: emcore/source/oracle/sysman/emdrep/sql/core/latest/admin/admin_backport_14459552.sql /st_recommended_10.2.0.4.4db11.2.0.3/1 2013/02/14 08:17:08 edemembe Exp $
SQL> Rem
SQL> Rem admin_backport_14459552.sql
SQL> Rem
SQL> Rem Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
SQL> Rem
SQL> Rem    NAME
SQL> Rem      admin_backport_14459552.sql - <one-line expansion of the name>
SQL> Rem
SQL> Rem    DESCRIPTION
SQL> Rem      <short description of component this file declares/defines>
SQL> Rem
SQL> Rem    NOTES
SQL> Rem      <other useful comments, qualifications, etc.>
SQL> Rem
SQL> Rem    MODIFIED   (MM/DD/YY)
SQL> Rem    edemembe    02/14/13 - Created
SQL> Rem
SQL> -- Add CREATE TABLE privilege to repos user per bug 14273397.
SQL> GRANT CREATE TABLE TO SYSMAN;

Grant succeeded.

SQL>
SQL> -- Add alter user privilege to repos user per bug 14459552
SQL> GRANT ALTER USER TO SYSMAN;

Grant succeeded.

SQL> PROMPT Processing Oracle Database Packages and Types...
Processing Oracle Database Packages and Types...
SQL> ALTER SESSION SET current_schema = sys;

Session altered.

SQL> @?/rdbms/admin/execocm.sql
SQL> Rem
SQL> Rem $Header: emll/admin/scripts/execocm.sql /st_emll_11.2.0.3.0dbpsu/2 2013/02/05 22:41:20 davili Exp $
SQL> Rem
SQL> Rem execocm.sql
SQL> Rem
SQL> Rem Copyright (c) 2006, 2013, Oracle and/or its affiliates.
SQL> Rem All rights reserved.
SQL> Rem
SQL> Rem    NAME
SQL> Rem      execocm.sql - EXECute Oracle Configuration Manager job.
SQL> Rem
SQL> Rem    DESCRIPTION
SQL> Rem      This script submits and runs the database configuration collection
SQL> Rem      job as part of database creation.
SQL> Rem
SQL> Rem    NOTES
SQL> Rem      Create directory object for use by the job to create the configuration
SQL> Rem      file at.
SQL> Rem      This script should be run while connected as "SYS".
SQL> Rem
SQL> Rem    MODIFIED   (MM/DD/YY)
SQL> Rem    davili      02/04/13 - bug 16273291, update backport to most recent EMLL
SQL> Rem                           code
SQL> Rem    davili      01/15/13 - Backport jsutton_bug-13561750
SQL> Rem    jsutton     07/19/11 - Catch exceptions that pop up in upgrade path
SQL> Rem    jsutton     07/11/11 - Fix for upgrade path
SQL> Rem    jsutton     07/06/11 - XbranchMerge jsutton_bug-12710774 from main
SQL> Rem    jsutton     07/20/09 - Add priv grants for utl_inaddr
SQL> Rem    glavash     08/20/08 - grant required prives to user
SQL> Rem    dkapoor     07/31/07 - remove stats job
SQL> Rem    dkapoor     05/04/07 - stop old job
SQL> Rem    dkapoor     01/04/07 - drop job before creating one
SQL> Rem    dkapoor     09/20/06 - give priv only if not given to public
SQL> Rem    dkapoor     09/13/06 - grant execute on dbms_scheduler
SQL> Rem    dkapoor     07/26/06 - do not use define
SQL> Rem    dkapoor     07/21/06 - use create_replace_dir
SQL> Rem    dkapoor     06/06/06 - move directory creation after installing the
SQL> Rem                           packages
SQL> Rem    dkapoor     05/23/06 - Created
SQL> Rem
SQL>
SQL> DECLARE
  2    l_vers            v$instance.version%TYPE;
  3    l_dirobj_priv_cnt NUMBER;
  4    l_priv_cnt        NUMBER;
  5    l_comp_cnt        NUMBER;
  6    l_acl_count       NUMBER;
  7    l_acl_priv        NUMBER;
  8    l_acl_name        VARCHAR2(4000);
  9
 10  BEGIN
 11     BEGIN
 12       select count(*) into l_priv_cnt from dba_tab_privs where
 13         GRANTEE ='ORACLE_OCM' and TABLE_NAME='UTL_FILE' and
 14         upper(PRIVILEGE) = 'EXECUTE';
 15       IF l_priv_cnt = 0 THEN
 16          -- Grant priv only if its not already given.
 17          execute immediate 'GRANT EXECUTE ON SYS.UTL_FILE TO ORACLE_OCM';
 18       END IF;
 19
 20       select count(*) into l_priv_cnt from dba_tab_privs where
 21         GRANTEE ='ORACLE_OCM' and TABLE_NAME='DBMS_SCHEDULER' and
 22         upper(PRIVILEGE) = 'EXECUTE';
 23       IF l_priv_cnt = 0 THEN
 24          -- Grant priv only if its not given.
 25          execute immediate 'GRANT EXECUTE ON SYS.DBMS_SCHEDULER TO ORACLE_OCM';
 26       END IF;
 27
 28       select count(*) into l_priv_cnt from dba_tab_privs where
 29         GRANTEE ='ORACLE_OCM' and TABLE_NAME='UTL_INADDR' and
 30         upper(PRIVILEGE) = 'EXECUTE';
 31       IF l_priv_cnt = 0 THEN
 32          -- Grant priv only if its not given.
 33          execute immediate 'GRANT EXECUTE ON SYS.UTL_INADDR TO ORACLE_OCM';
 34       END IF;
 35
 36       -- need to set up ACL if DB version > 11
 37       select LPAD(version,10,'0') into l_vers from v$instance;
 38       -- Grant privilege to use UTL_INADDR via ACL if necessary
 39       IF l_vers >= '11.0.0.0.0' THEN
 40          -- check for XML DB installed
 41          execute immediate 'select count(*) from dba_registry '||
 42             'where COMP_NAME = ''Oracle XML Database'' and STATUS = ''VALID'''into l_comp_cnt ;
 43          IF l_comp_cnt > 0 THEN
 44            BEGIN
 45              -- make sure DBA_NETWORK_ACLS view exists (may not in upgrade path)
 46              execute immediate 'select count(*) from dba_objects where object_type=''VIEW'' and object_name=''DBA_NETWORK_ACLS''' into l_comp_cnt;
 47              IF l_comp_cnt > 0 THEN
 48                -- check for ACL assigned to localhost
 49                execute immediate 'select count(*) from dba_network_acls where host=''localhost''' into l_acl_count;
 50                IF (l_acl_count = 0) THEN
 51                   -- create ACL and assign to localhost
 52                   execute immediate
 53                   'BEGIN '||
 54                   '  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(''oracle-sysman-ocm-Resolve-Access.xml'', ''OCM User Resolve Network Access using UTL_INADDR'', ''ORACLE_OCM'', TRUE, ''resolve'');' ||
 55                   '  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(''oracle-sysman-ocm-Resolve-Access.xml'', ''localhost'');' ||
 56                   '  COMMIT;' ||
 57                   'END;';
 58                ELSE
 59                  -- ACL for localhost exists
 60                   -- check for resolve privilege for OCM user
 61                   execute immediate
 62                   'SELECT acl, DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE_ACLID(aclid, ''ORACLE_OCM'', ''resolve'') ' ||
 63                   '  FROM dba_network_acls WHERE host = ''localhost'''
 64                      INTO l_acl_name, l_acl_priv;
 65                   IF (l_acl_priv IS NULL OR l_acl_priv = 0) THEN
 66                      -- add resolve privilege
 67                      execute immediate
 68                      'BEGIN ' ||
 69                      '  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('''|| l_acl_name ||''', ''ORACLE_OCM'', TRUE, ''resolve'');' ||
 70                      '  COMMIT;' ||
 71                      'END;';
 72                   END IF;
 73                END IF;
 74              END IF;
 75            EXCEPTION
 76              WHEN OTHERS THEN NULL;
 77            END;
 78          END IF;
 79       END IF;
 80
 81       -- Grant RESTRICTED SESSION
 82       execute immediate 'GRANT RESTRICTED SESSION TO ORACLE_OCM';
 83
 84       ORACLE_OCM.MGMT_CONFIG_UTL.create_replace_dir_obj;
 85       select count(*) into l_dirobj_priv_cnt from dba_tab_privs where GRANTEE ='ORACLE_OCM' and TABLE_NAME='ORACLE_OCM_CONFIG_DIR' and upper(PRIVILEGE) = 'READ';
 86       IF l_dirobj_priv_cnt = 0 THEN
 87        execute immediate 'GRANT READ ON DIRECTORY ORACLE_OCM_CONFIG_DIR TO ORACLE_OCM';
 88       END IF;
 89       select count(*) into l_dirobj_priv_cnt from dba_tab_privs where GRANTEE ='ORACLE_OCM' and TABLE_NAME='ORACLE_OCM_CONFIG_DIR' and upper(PRIVILEGE) = 'WRITE';
 90       IF l_dirobj_priv_cnt = 0 THEN
 91         execute immediate 'GRANT WRITE ON DIRECTORY ORACLE_OCM_CONFIG_DIR TO ORACLE_OCM';
 92       END IF;
 93       COMMIT;
 94     EXCEPTION
 95       WHEN OTHERS THEN
 96         raise_application_error(-20007,SQLERRM);
 97    END;
 98  END;
 99  /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> -- remove old dba jobs, if exists
SQL> DECLARE
  2  job_num NUMBER;
  3  CURSOR job_cursor is
  4      SELECT job
  5      FROM dba_jobs
  6      WHERE schema_user = 'ORACLE_OCM'
  7      AND (what like 'ORACLE_OCM.MGMT_CONFIG.%'
  8       OR what like 'ORACLE_OCM.MGMT_DB_LL_METRICS.%');
  9  BEGIN
 10     FOR r in job_cursor LOOP
 11       sys.DBMS_IJOB.REMOVE(r.job);
 12       COMMIT;
 13     END LOOP;
 14  END;
 15  /

PL/SQL procedure successfully completed.

SQL>
SQL> #Rem stop the job
SQL> BEGIN
  2     BEGIN
  3       -- call to stop the job
  4       ORACLE_OCM.MGMT_CONFIG.stop_job;
  5     EXCEPTION
  6       WHEN OTHERS THEN
  7         -- ignore any exception
  8         null;
  9    END;
 10  END;
 11  /

PL/SQL procedure successfully completed.

SQL>
SQL> #Rem submit the job and run now
SQL> execute ORACLE_OCM.MGMT_CONFIG.submit_job;

PL/SQL procedure successfully completed.

SQL> execute ORACLE_OCM.MGMT_CONFIG.run_now;

PL/SQL procedure successfully completed.

SQL>
SQL> BEGIN
  2    execute immediate 'REVOKE RESTRICTED SESSION FROM ORACLE_OCM';
  3    EXCEPTION
  4      WHEN OTHERS THEN
  5        raise_application_error(-20007,SQLERRM);
  6  END;
  7  /

PL/SQL procedure successfully completed.

SQL> ALTER SESSION SET current_schema = SYS;

Session altered.

SQL> PROMPT Updating registry...
Updating registry...
SQL> INSERT INTO registry$history
  2    (action_time, action,
  3     namespace, version, id,
  4     bundle_series, comments)
  5  VALUES
  6    (SYSTIMESTAMP, 'APPLY',
  7     SYS_CONTEXT('REGISTRY$CTX','NAMESPACE'),
  8     '11.2.0.3',
  9     7,
 10     'PSU',
 11     'PSU 11.2.0.3.7');

1 row created.

SQL> COMMIT;

Commit complete.

SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_OAMDB_APPLY_2013Dec26_05_40_47.log

sql>select substr(action_time,1,30) action_time,
       substr(id,1,10) id,
       substr(action,1,10) action,
       substr(version,1,8) version,
       substr(BUNDLE_SERIES,1,6) bundle,
       substr(comments,1,20) comments
from   registry$history; 

ACTION_TIME                          ID            ACTION             VERSION              BUNDLE         COMMENTS
----------------------------------------------------------------------------- ------------------------------------ ---------------------------------------- -------------------------------- ------------------------ --------------------------------------------------------------------------------
17-SEP-11 10.21.11.595816 AM         0             APPLY              11.2.0.3              PSU           Patchset 11.2.0.2.0
26-DEC-13 05.14.03.826776 AM         7             APPLY              11.2.0.3              PSU           PSU 11.2.0.3.7
26-DEC-13 05.40.53.670045 AM         7             APPLY              11.2.0.3              PSU           PSU 11.2.0.3.7

Sunday 18 August 2013

Import only Schema structure from on user schema to other user schema in oracle...

Some time requirement is to transfer only structure of one oracle user schema to other oracle user schema for development operation or any operation(migration purpose) so that time impdp/expdp logical backup utility helps us to transfer one schema structure other schema .so my bellow example showing you step by step process of how transfer on schema structure to other schema?


1)export schema structure using following command...

[oracle@aveksa-sena dbs]$ expdp  directory=d_dump dumpfile=scott.dmp logfile=scott.log SCHEMAS=scott CONTENT=METADATA_ONLY parallel=2

(In above command i used parameter CONTENT=METADATA_ONLY for export only structure of schema)

Export: Release 11.2.0.2.0 - Production on Sun Aug 18 22:36:22 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: /as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01":  /******** AS SYSDBA directory=d_dump dumpfile=scott.dmp logfile=scott.log SCHEMAS=scott CONTENT=METADATA_ONLY parallel=2
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
  /u01/scott.dmp
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at 22:45:50


2) import schema structure using impdp command and specify the user name in remap_schema parameter where you want to import schema structure in my example i used test schema to import schema structure..

[oracle@aveksa-sena dbs]$ impdp  directory=d_dump dumpfile=scott.dmp logfile=scott.log remap_SCHEMA=scott:test  parallel=2

Import: Release 11.2.0.2.0 - Production on Sun Aug 18 22:50:19 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: /as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYS"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_FULL_01":  /******** AS SYSDBA directory=d_dump dumpfile=scott.dmp logfile=scott.log remap_SCHEMA=scott:test parallel=2
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"TEST" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYS"."SYS_IMPORT_FULL_01" completed with 1 error(s) at 22:51:10

[oracle@aveksa-sena dbs]$ sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on Sun Aug 18 22:51:21 2013

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

Enter user-name: /as sysdba

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

SQL> conn test/test
Connected.
SQL> select table_name from tabs;

TABLE_NAME
------------------------------
DEPT
EMP
BONUS
SALGRADE

SQL> select count(*) from dept;

  COUNT(*)
----------
         0

SQL> desc dept;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 DEPTNO                                    NOT NULL NUMBER(2)
 DNAME                                              VARCHAR2(14)
 LOC                                                VARCHAR2(13)

Wednesday 24 July 2013

How to install SQL Developer datamodeler on Linux?

      How to install SQL Developer data modeler on Linux?

     below is steps for installing sql Developer data modeler on linux...

Step 1: download sqldeveloper using below link..

       http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/index.html

Step 2: Download latest Java SE Development Kit 6....

       http://www.oracle.com/technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html

Step 3: install sql developer modeler  rpm package....
 
      # rpm -Uvh  datamodeler-3.3.0.747-1.noarch.rpm

Step 4: give permision to JDK

     #chmod a+x   jdk-6u35-linux-i586-rpm.bin

step 5: execute the rpm..

     # ./jdk-6u35-linux-i586-rpm.bin

Step 6: After successfully execute jdk..
       set JAVA_HOME path and sqldeveloper path in oracle user bash_profile.
EXAMPLE:
      JAVA_HOME=/usr/java/jdk1.6.0_35/; export JAVA_PATH
      PATH=$JAVA_HOME/bin:$PATH:/opt/datamodeler/; export PATH

Step 7: execute bash_profile...
     
      $. .bash_profile

Step 8: execute sqldeveloper command

      $ datamodeler





1) select data dictionary option...

 

2)click on add button....(specify your database parameter)

 

3) click on connect button. select you created connection and then click next button



4) select select the schema in which you want perform operation ...and then click next button.

 

5)then select object you need to import..... click on next button...





  

6)click on finish button....

 


save the log information or close it...


7) check relation between to object...

 

########################END############################# 

 


 

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...