Thursday, May 20, 2010

Oracle Applications 11i Hot Backup Cloning with Rapid Clone

We are getting lot of questions on Hot Backup Cloning of 11i in the forum. So we thought that, if we write one article regarding this, it will be more useful for the apps newbies. Here I am sharing the information that, what i follow during the hotbackup cloning. You all might have done this before.

Source System (PROD):

(a) P4 3.0 GHz System with 2GB RAM and 200 GB HDD (Redhat Linux AS 4)

/d01 ——- 40 GB (Application Tier Files)

/d02 ——- 10 GB (10g Oracle Home)

/d03 ——- 80 GB (Data Files)

/backup —- 100 GB (NFS mount point Shared on TEST Server)

Hostname: prodserver

Application Version: 11.5.10.2

Database Version: 10.2.0.2 Target System (TEST):

(b) P4 2.6 GHz system with 1.5 GB RAM with 300 GB HDD (Redhat Linux AS 4)

/d01 ——- 40 GB (Application Tier Files)

/d02 ——- 10 GB (10g Oracle Home)

/d03 ——- 80 GB (Data Files)

/backup —- 100GB (NFS Share Directory)

Hostname: testserver

Application Version: 11.5.10.2

Database Version: 10.2.0.2

Note: This target System was previously cloned with cold backup. This is second time cloning with Hot Backup from PRODSERVER.

Stage1: Prerequisites:

 ========> Apply OUI22 Patch, 5035661 to every IAS Oracle Home
          and RDBMS Oracle Home to be cloned. 
          If you are having 10g Oracle Home,
          there is no need of applying this patch. 
          You need to apply this patch on IAS Oracle Home 
         (if Database is not 10g)

A. Applying the patch on the iAS $ORACLE_HOME:

   ====================================================
   (a)  Unzip the patch into the  directory:
       $unzip -od /d01/prodora/iAS p5035661_11i_LINUX.zip
   (b)   Source the Apps environment file :
         $. $APPL_TOP/APPSORA.env
   (c)   Change directory to the /appsoui/setup
        $cd $IAS_ORACLE_HOME/appsoui/setup
   (d)  Execute the perl script OUIsetup.pl:
       $perl OUIsetup.pl
  NOTE:
  In the case of a Multi-Node instance, the above process
  should be repeated on the  of each Node.
(B) Applying the patch on the RDBMS $ORACLE_HOME: 
     (This step is not required for my current setup, 
    because my database version is 10g R2)
  (a)  Unzip the patch into the  directory:
       $unzip -od /u01/proddb/9.2.0 p5035661_11i_LINUX.zip
  (b)  Source the DB environment file :
       $. $ORACLE_HOME/PROD_prodserver.env
  (c) Change directory to the /appsoui/setup
      $cd $ORACLE_HOME/appsoui/setup
  (d) Execute the perl script OUIsetup.pl:
      $perl OUIsetup.pl
======> Check all other Requirements as Perl, JRE, JDK, ZIP utilities on Source and Target Nodes as per
        document “Cloning Oracle Applications Release 11i with Rapid Clone”
=======> Apply the Latest AD Minipack on Application Tier (Latest One is AD.I.5)
=======รจ Apply the Latest Autoconfig Template Patch and Latest Rapidclone Patches to Application Tier (Check Metalink for These Patches)
Stage2: Prepare the Source System (PRODSERVER)
      (a) Login into Database Tier as ORACLE user and run the preclone
           $cd $ORACLE_HOME/appsutil/scripts/PROD_prodserver
           $perl adpreclone.pl dbTier
      (b) Login into the Application Tier as APPLMGR User and run the  preclone
           $cd $COMMON_TOP/admin/scripts/PROD_prodserver
           $perl adpreclone.pl appsTier
Stage3: Put the Database in Begin Backup Mode and copy the Database Files 
       (a)   Login into database as sysdba user
             $sqlplus “/as sysdba”
             Sql> alter database begin backup;
       (b)   Copy Archive log files created during hot backup to /backup directory.
       (c)   Copy the All Data files to /backup directory.
       (d)   Backup the control file to trace.
             Sql> alter database backup control file to trace;
             Copy this trace file to /backup directory
       (e)   Copy the current init.ora file to /backup directory
       (f)   End the Begin Backup Mode.
             Sql> alter database end backup.
 Stage4: Copy the Application Tier File System Files
         (a)Login into the Application Tier as APPLMGR user and copy the APPL_TOP, COMMON_TOP, 
             IAS ORACLE HOME and 8.0.6 Oracle Home to /backup directory
 Stage5: Copy the Source Database files and Application Files to Target server
     Copy the parameter file, backup control file and archive log files from /backup directory  
          to /d01, /d02 and /d03 in target server.
 Stage 6: Configure the Target Database (TESTSERVER)

Log on to the target system as the ORACLE user

(1) Configure the

cd /appsutil/clone/bin

perl adcfgclone.pl dbTechStack

(2) Create the target database control file manually

Open the backed up control file

a. remove all lines before the startup nomount statement

b. Modify the REUSE to SET

c. Modify Source DB SID to Target SID (Here PROD to TEST)

d. Modify NORESETLOGS TO RESETLOGS

e. delete all lines after the CHARACTER SET statement

————————————

CREATE CONTROLFILE SET DATABASE “TEST” NORESETLOGS ARCHIVELOG…

LOGFILEGROUP 1

‘/d03/log01.log’ SIZE 50M,

DATAFILE

‘/d03/system01.dbf’,

‘/d03/undotbs01.dbf’,

CHARACTER SET UTF8;

—————————————————–

On the target system, modify the init.ora to have the target SID and location of the control file and also make sure that init.ora parameters are set for archive log mode On the target system,

starup the database in nomount stage

sql> startup nomount pfile=<>

sql> @clone.ctl ( here clone.ctl is the control file which we have modified above)

Once control file is created, database will be in mount stage

execute recover command using backup control file after the database is mounted

SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;

After the last archive log has been applied, issue the following command

SQL> alter database open resetlogs;

After opening the database, add temp files to target database

(3) Run the library update script against the database

cd /appsutil/install/

Where is “sl” for HP-UX, “so” for any other UNIX platform and not required for Windows.

(4)Configure the target database (the database must be open)

cd /appsutil/clone/bin

perl adcfgclone.pl dbconfig

where target context file is: /appsutil/.xml

Stage 7 : Configure the Target Application Tier

Logon to the target system as the APPLMGR user and type the following commands

$Cd $COMMON_TOP/clone/bin

$Perl adcfgclone.pl appsTier

Finishing tasks:

(1) Update Profile options

(2) Update Printer Settings

(3) Update the workflow configuration settings

(4) Verify the APPLCSF variable setting

(5) Update the session_cookie_domain value in icx_parameters

For the finishing tasks, check the finishing tasks section of the following document

Cloning Oracle Applications Release 11i with rapid clone Note: 230672.1

Rapid Clone for Single Node - Linux

The Basic Steps for Cloning

After installing the Rapid Clone and AutoConfig patches, you are ready to clone an instance. There are ten basic steps involved. I have outlined them below:

1. Run system configuration on the Application tier:
/admin/scripts//adautocfg.sh
Use the APPS password when prompted.

2. Run system configuration on the database tier:
/appsutil//scripts/adautocfg.sh
Use the APPS password when prompted.

3. Copy AutoConfig to the RDBMS ORACLE_HOME:
Apply patch 2952369 to acquire adchkcfg utility.
Create appsutil.zip file by: perl /bin/admkappsutil.pl.
Copy appsutil.zip file to the
unzip -o appsutil.zip

4. Generate the database context file:
cd /appsutil/bin
adbldxml.sh tier=database appsuser= appspasswd=
Output log is written to: $ORACLE_HOME/appsuti/out//cfgcheck.txt

5. Generate and apply AutoConfig configuration file:
cd /appsutil/bin
adconfig.sh contextfile= appspass=

6. Prepare for source database clone:
cd /appsutil/scrips/
./perl adpreclone.pl dbTier

7. Prepare for source application clone:
cd /admin/scripts/
./perl adpreclone.pl appsTier

8. Copy the application tier file system:
Logon to the source system as APPLMGR and shut down the server processes.
Copy the following application directories from the source to the target node/file system:

APPL-TOP
OA_HTML
OA_JAVA
COMMON_TOP/util
COMMON_TOP/clone
806 ORACLE_HOME
iAS ORACLE_HOME

Shut down the source database and copy it to the target node/file system.
Restart the source database and source application server processes.

9. Configure the target system database sever:
cd /appsutil/clon/bin
./perl adcfgclone.pl dbTier

10. Configure the target system application tier:
cd /clone/bin
./perl adcfgclone.pl appsTier

Note: These steps are for a single node install. If you are using Oracle Workflow, you must update wf_notification_attributes and wf_item_attribute_values.

Version 2.1.0.17 of the Oracle Universal Installer and Perl 5.005 should be installed and included in your path. Be sure to review your install logs after cloning to make sure there are no errors. After you have verified connectivity in the cloned environment, have a user navigate through the system to verify the clone is functional and complete.

Rapid Cloning Steps for Oracle EBS R12 (R12.0.6) Windows

Rapid Cloning Steps for Windows R12

Source System:
1.Run adpreclone.pl in Database Node
2.Perl $ORACLE_HOME\appsutil\scripts\$CONTEX_NAME\adpreclone.pl dbTier
3.Run adpreclone.pl in Apps Node
4.Perl $ADMIN_SCRIPTS_HOME\adpreclone.pl appsTier
5.Shut down the Applications and database
6.Change all services type into manual (option)
7.Restart the system (option)
8.Check if any FNDLIBR programs are running or not
9.Take a cold backup of database and applications

Target System:
Prepare your target system as per the source system configuration
1.Install Windows Server 2003 service pack 2 Ent Edition(Target system is windows server 2003)
2.Install Visual Studio 2005
3.Install Active perl
4.Install Cygwin Change make version from 3.81 into 3.80
5.Copy the Source system backup into target system
6.Set perl locations by using existing env file(It varies DB node and Apps Node, We will set this two times)
7.Goto the $ORACLE_HOME\appsutil\clone\bin folder and the post clone scripts
8.Run Postclone scripts in db Tier
9.Perl $ORACLE_HOME\appsutil\clone\Bin\adcfgclone.pl dbTier
10.Run Postclone in Apps Tier
11.Perl $COMMON_TOP\clone\bin\adcfgclone.pl appsTier

Finishing Tasks:
1.Update the profile options
Rapid clone will update the site level profile options only, we need to update instance level profile options manually
2.Update the printer settings
3.Update the workflow configuration settings
Cloning an Oracle Applications instance will not update the host and instance specific information used by Oracle Workflow. Review the following tables and columns to verify there is no instance specific data in the Workflow configuration on the target system.

Important Notes:
a).While running Postclone in appsTier it prompts hostname, we should give like hostname.domainname for example sys10.sample.com
b).While running post clone in appsTier it prompts visual studio directory don\u2019t include bin folder. For example give like c:\vc\VC, don\u2019t give like c:\vc\VC\bin

Oracle Applications HOWTO: change apps password

Steps to change apps password

1. Backup entire system

2. Stop concurrent manager

  cd $COMMON_TOP/admin/scripts/$CONTEXT_NAME
adcmctl.sh stop apps/

3. Backup FND_ORACLE_USERID table

  sqlplus apps/
drop table FND_ORACLE_USERID_BAK;
create table FND_ORACLE_USERID_BAK as select * from FND_ORACLE_USERID;
exit;

4. Change apps password

  $FND_TOP/bin/FNDCPASS apps/ 0 Y system/ SYSTEM APPLSYS 

5. Change apps password in configuration files

  $IAS_ORACLE_HOME/Apache/modplsql/cfg/wdbsvr.app
$IAS_ORACLE_HOME/listener/cfg/wdbsvr.app
$ORACLE_HOME/listener/cfg/wdbsvr.app
$FND_TOP/resource/wfmail.cfg
$OA_HTML/bin/appsweb.cfg
$AD_TOP/admin/template/CGIcmd.dat

Known Issues

1. Symptom : Can not login to Oracle Applications

  Cause   : Invalid apps password in $IAS_HOME/Apache/modplsql/cfg/wdbsvr.app
Solution: Change apps password in $IAS_HOME/Apache/modplsql/cfg/wdbsvr.app

Monday, May 10, 2010

Opatch Syntax

OPatch is the Oracle database's Interim (one-off) Patch Installer.

If OPatch is not installed into your Oracle Home ($ORACLE_HOME/OPatch), you may need to download it from Metalink and install it yourself.

Syntax

Syntax and options can be displayed using the -help option:

$ cd $ORACLE_HOME/OPatch
$ opatch -help
Invoking OPatch 10.2.0.4.2

Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.


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

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

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

example:
'opatch -help'
'opatch apply -help'
'opatch lsinventory -help'
'opatch napply -help'
'opatch nrollback -help'
'opatch rollback -help'
'opatch prereq -help'
'opatch util -help'

OPatch succeeded.

Listing installed patches

All patches that are installed with Oracle's OPatch Utility can be listed by invoking the opatch command with the lsinventory option. Here is an example:

$ cd $ORACLE_HOME/OPatch

$ opatch lsinventory
Invoking OPatch 10.2.0.1.0

Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
...
Installed Top-level Products (1):

Oracle Database 10g 10.2.0.1.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

OPatch succeeded.

Tips for using the OPatch Utility


The best tutorial for Opatch
=====================
http://download.oracle.com/docs/cd/B28359_01/em.111/b31207/oui7_opatch.htm


Brandeis University has published a nice overview on using the Oracle OPatch utility to apply patches to Oracle databases:
This page contains syntax example for using the OPatch command line utility to apply patches, apply interim patches and viewing a list of patches. It shows the OPatch command invocation:

Or use the wrapper script (unix only) which may be invoked after setting the correct $ORACLE_HOME environment variable

opatch command [options>] [-h[elp]]


where command is one of:

apply

lsinventory

rollback

version

It also lists the patch log file directory:

$ORACLE_HOME/.patch_storage/patch_logfile

Search This Blog