Tuesday, August 28, 2012

Applying Opatch in simple way

Applying a Opatch
Detail description on applying opatch can be find Oracle Documentation. Hear is shall quickly explain you simple way of applying patch
Note: I would still recommend you to read oracle documentation before applying

Step by Step execution
$ bash
$ export ORACLE_HOME=/scratch/aime1/PS4_SOA/mw970/soa8310
$ export MW_HOME=/scratch/aime1/PS4_SOA/mw970
$ echo $ORACLE_HOME
/scratch/aime1/PS4_SOA/mw970/soa8310
$ cd /scratch/aime1
$ mkdir OraInventory tmp
$ export TMP=`pwd`
$ export TMPDIR=`pwd`
$ cd OraInventory
$ echo inventory_loc=`pwd` > ../oraInst.loc
$ pwd
/scratch/aime1/OraInventory
==========================opatch help=================================
$ /scratch/aime1/PS4_SOA/mw970/soa8310/OPatch/opatch -help
Invoking OPatch 11.1.0.8.3

Oracle Interim Patch Installer version 11.1.0.8.3
Copyright (c) 2010, Oracle Corporation.  All rights reserved.


 Usage: opatch [ -help ] [ -r[eport] ] [ command ]

            command := apply
                       lsinventory
                       napply
                       nrollback
                       rollback
                       query
                       version
                       prereq
                       util

 <global_arguments> := -help       Displays the help message for the command.
                       -report     Print the actions without executing.

 example:
   'opatch -help'
   'opatch -help -fmw'
   'opatch auto -help'
   'opatch apply -help'
   'opatch lsinventory -help'
   'opatch napply -help'
   'opatch nrollback -help'

   'opatch rollback -help'
   'opatch prereq -help'
   'opatch util -help'


OPatch succeeded.
==========================opatch check inventroy location=====================

bash-3.2$ /scratch/aime1/PS4_SOA/mw970/soa8310/OPatch/opatch lsinventory -invPtrLoc /scratch/aime1/PS4_SOA/mw970/soa8310/oraInst.loc
Invoking OPatch 11.1.0.8.3

Oracle Interim Patch Installer version 11.1.0.8.3
Copyright (c) 2010, Oracle Corporation.  All rights reserved.


Oracle Home       : /scratch/aime1/PS4_SOA/mw970/soa8310
Central Inventory : /ade/aime1_dte5759/oracle/work/FMW_SOA_INST/oraInventory
   from           : /scratch/aime1/PS4_SOA/mw970/soa8310/oraInst.loc
OPatch version    : 11.1.0.8.3
OUI version       : 11.1.0.9.0
OUI location      : /scratch/aime1/PS4_SOA/mw970/soa8310/oui
Log file location : /scratch/aime1/PS4_SOA/mw970/soa8310/cfgtoollogs/opatch/opat
ch2012-08-28_01-36-13AM.log

Patch history file: /scratch/aime1/PS4_SOA/mw970/soa8310/cfgtoollogs/opatch/opat
ch_history.txt


OPatch detects the Middleware Home as "/scratch/aime1/PS4_SOA/mw970"

Lsinventory Output file location : /scratch/aime1/PS4_SOA/mw970/soa8310/cfgtooll
ogs/opatch/lsinv/lsinventory2012-08-28_01-36-13AM.txt

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

Oracle SOA Suite 11g                                                 11.1.1.5.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.

==========================opatch apply=================================
bash-3.2$ cd 14203193
bash-3.2$ ls
etc  files  README.txt
bash-3.2$ /scratch/aime1/PS4_SOA/mw970/soa8310/OPatch/opatch apply -invPtrLoc /scratch/aime1/PS4_SOA/mw970/soa8310/oraInst.loc
Invoking OPatch 11.1.0.8.3

Oracle Interim Patch Installer version 11.1.0.8.3
Copyright (c) 2010, Oracle Corporation.  All rights reserved.


Oracle Home       : /scratch/aime1/PS4_SOA/mw970/soa8310
Central Inventory : /ade/aime1_dte5759/oracle/work/FMW_SOA_INST/oraInventory
   from           : /scratch/aime1/PS4_SOA/mw970/soa8310/oraInst.loc
OPatch version    : 11.1.0.8.3
OUI version       : 11.1.0.9.0
OUI location      : /scratch/aime1/PS4_SOA/mw970/soa8310/oui
Log file location : /scratch/aime1/PS4_SOA/mw970/soa8310/cfgtoollogs/opatch/opatch2012-08-29_22-36-05PM.log

Patch history file: /scratch/aime1/PS4_SOA/mw970/soa8310/cfgtoollogs/opatch/opatch_history.txt


OPatch detects the Middleware Home as "/scratch/aime1/PS4_SOA/mw970"

ApplySession applying interim patch '14203193' to OH '/scratch/aime1/PS4_SOA/mw970/soa8310'

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 = '/scratch/aime1/PS4_SOA/mw970/soa8310')


Is the local system ready for patching? [y|n]
yes
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '14203193' for restore. This might take a while...
Backing up files affected by the patch '14203193' for rollback. This might take a while...

Patching component oracle.integration.soainfra, 11.1.1.5.0...
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/decision/decision_deleteComponentInstancesDOP.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/decision/decision_deleteNoCompositeIdInstances.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/decision/purge_decision_oracle.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/fabric/fabric_createTempTable.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/fabric/fabric_deleteNoCompositeIdInstances.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/fabric/purge_fabric_oracle.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/mediator/mediator_createTempTables.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/mediator/mediator_deleteNoCompositeIdInstances.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/mediator/purge_mediator_oracle.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/orabpel/orabpel_deleteComponentInstances.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/orabpel/orabpel_deleteComponentInstancesDOP.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/orabpel/orabpel_deleteNoCompositeIdInstances.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/orabpel/purge_bpel_oracle.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/soa/delete_instances.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/soa/delete_instances_in_parallel.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/soa/delete_insts_in_parallel_job.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/soa/purge_soa_oracle.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/workflow/hwf_createTempTables.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/workflow/hwf_deleteNoCompositeIdInstances.sql"
Copying file to "/scratch/aime1/PS4_SOA/mw970/soa8310/rcu/integration/soainfra/sql/soa_purge/workflow/purge_hwf_oracle.sql"
ApplySession adding interim patch '14203193' to inventory

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

The local system has been patched and can be restarted.


OPatch succeeded.


===========================================================

Tuesday, August 21, 2012

RCU schema silent installs

RCU schema silent installs

Schema can be installed using graphical ui or silent install

Pre-Requisaites
1. Before performing any of the install you should make sure all servers are done and you not connected to schema which you are trying to drop and recreate
2. all schema files are present under RCU_HOME/rcu/integration/soainfra/oracle/
3. Parameters that is required for running command
  • databaseType 
  • machine name
  • db_port
  • db_sid
  • schema prefix
  • component 

example : let us consider dropping and recreting of SOAINFRA schema
file present at RCU_HOME/rcu/integration/soainfra/oracle/createschema_soainfra_oracle.sql

How to Drop a Repository
NOTE: you have to have all password handy

 Drop repro

$RCU_HOME/RCU/bin/rcu -dropRepository -silent -databaseType ORACLE -connectString your machine.com:1521:dbsid.com -dbUser sys -lockSchemas false -dbRole sysdba -schemaPrefix PSNEW -component SOAINFRA

========================Output=========================================   
Output
Processing command line ....
Repository Creation Utility - Checking Prerequisites
Checking Global Prerequisites
Repository Creation Utility - Checking Prerequisites
Checking Component Prerequisites
Repository Creation Utility - Drop
Repository Drop in progress.
Percent Complete: 33
Percent Complete: 30
Percent Complete: 96
Repository Creation Utility: Drop - Completion Summary
Database details:
Host Name                       : yourmachine.com
Port                            : 1521
Service Name                    : dbsid.COM
Connected As                    : sys
Prefix for (prefixable) Schema Owners : PSNEW
RCU Logfile                     : /scratch/test/RCU/rcu/log/logdir.2012-08-21_06-12/rcu.log
Component schemas dropped:
Component                       Status  Logfile
SOA Infrastructure              Success /scratch/test/RCU/rcu/log/logdir.2012-08-21_06-12/soainfra.log
========================================================================

How to create a Repository
NOTE: you have to have all password handy
      
CreateRepo 
 $RCU_HOME/RCU/bin/rcu -createRepository -silent -databaseType ORACLE -connectString your machine.com:1521:dbsid.com -dbUser sys -lockSchemas false -dbRole sysdba -schemaPrefix PSNEW -component SOAINFRA

========================Output=========================================

Processing command line ....
Repository Creation Utility - Checking Prerequisites
Checking Global Prerequisites
The database you are connecting is with non-AL32UTF8 character set. Oracle strongly recommends using AL32UTF8 as the database character set.
Repository Creation Utility - Checking Prerequisites
Checking Component Prerequisites
Repository Creation Utility - Creating Tablespaces
Validating and Creating Tablespaces
Repository Creation Utility - Create
Repository Create in progress.
Percent Complete: 0
Percent Complete: 7
Percent Complete: 14
Percent Complete: 21
Percent Complete: 21
Percent Complete: 32
Percent Complete: 94
Repository Creation Utility: Create - Completion Summary
Database details:
Host Name                   : yourmachine.com
Port                                : 1521
Service Name                        : db_sid.COM
Connected As                        : sys
Prefix for (prefixable) Schema Owners : PS6NEW
RCU Logfile                 : /scratch/test/RCU/rcu/log/logdir.2012-08-21_06-21/rcu.log
Component schemas created:
Component                   Status  Logfile
SOA Infrastructure          Success /scratch/test/RCU/rcu/log/logdir.2012-08-21_06-21/soainfra.log
Repository Creation Utility - Create : Operation Completed
======================================================================
NOTE: you can pass multiple schema components as below
-component SOAINFRA -component ORASDPM -component MDS -component BAM
Each component before creation asks for passwords
======================================================================
Likely Error usually encountered 

Processing command line ....
Repository Creation Utility - Checking Prerequisites
Checking Global Prerequisites
Repository Creation Utility - Checking Prerequisites
Checking Component Prerequisites
RCU-6092:Component Selection validation failed. Please refer to log at /scratch/test/RCU/rcu/log/logdir.2012-08-21_06-12/rcu.log for details.
RCU-6083:Failed - Check prerequisites requirement for selected component:SOAINFRA
Please refer to RCU log at /scratch/test7June/RCU/rcu/log/logdir.2012-08-21_06-12/rcu.log for details.
The schema owner PSNEW_SOAINFRA is connected to the database. Please disconnect and try again.


Solution : Please disconnect sqlplus from all schema users  and try again