Tuesday, April 26, 2011

Migrate Oracle DB 9i and Application 11.5.10.2 from Sun Solaris 64bit to Red Hat 5.6 32bit with upgrade to Oracle DB 10g

Hi All.
Here the Step by Step guide for migration Oracle DB 9.2.0.7 and 11.5.10.2 from Sun Solaris to DB 10.2.0.5 and 11.5.10.2 Oracle Red Hat 5.


!!! Guys ,please pay attention, this guide is for my special 11.5.10.2 release.
Please review the Oracle Documentation that posted below before you starting !!!


Action Plan:
---------------------------------------------------
1. Prepare Red Hat 5 Linux server for DB10g installation..
2. Install Oracle DB10g (10.2.0.1) on target server.
3. Export from source instance  (9.2.0.7).
4. Import to target instance (10.2.0.1).
5. Upgrade to 10.2.0.5.
6. Migrate Oracle Application 11i to Linux server.
---------------------------------------------------
1. Prepare Red Hat 5 Linux server for DB10g installation.
 1.1 The following packages must be installed from the OEL 5 or RHEL 5 distribution media:
compat-libstdc++-egcs-1.1.2-1
compat-libstdc++-33-3.2.3-6
compat-libstdc++-296-2.96-138
compat-libcwait-2.1-1
compat-oracle-el5-1.0-5
openmotif21-2.1.30-11.EL5
binutils-2.15
libXp-1.0.0-8.1.el5
compat-libgcc-296-2.96-138
compat-libstdc++-33-3.2.3-61
compat-db-4.2.52-5.1
You can download here:
http://oss.oracle.com/projects/compat-oracle/files/Enterprise_Linux/
 1.2  Doc ID: 362203.1 Oracle Applications Release 11i with Oracle 10g Release 2 (10.2.0)

vi /etc/sysctl.conf
---------------------
# Kernel Parameters for Oracle 10.2.0
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
run command :
su - root
sysctl -p
vi /etc/security/limits.conf :
==============================
# To increase the shell limits for Oracle 10g
orhgold soft nproc 2047
orhgold hard nproc 16384
orhgold soft nofile 1024
orhgold hard nofile 65536
vi /etc/pam.d/system-auth :
===========================
session required pam_limits.so
session required pam_unix.so
vi /etc/profile :
===========================
if [ $USER = "orhgold" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -u 16384
              ulimit -n 63536
 fi
        else
              ulimit -u 16384 -n 63536
        fi
fi

2. Install Oracle DB10g (10.2.0.1) on target server.
Download Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Linux x86 
Database: http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip
Companion: http://download.oracle.com/otn/linux/oracle10g/10201/10201_companion_linux32.zip
2.1. Unzip software + chown with oracle user in Target server.
2.2. Create ORACLE_HOME folder (ex: /d01/oracle/product/10.2.0)
2.3. Export to new ORACLE_HOME ( export ORACLE_HOME=/d01/oracle/product/10.2.0)
2.4. Run the ./runInstaller -ignoreSysPrereqs  from "database" folder
    Select Conf Options - Install DB software only
2.5. Run the ./runInstaller -ignoreSysPrereqs  from "companion" folder
     Select Product to Install: 2
2.6. Update oracle .bash_profile(profile):
     export PATH=$PATH:$HOME/bin:/d01/oracle/product/10.2.0/bin:/d01/oracle/product/10.2.0/perl/bin
     export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/d01/oracle/product/10.2.0/lib
     export PERL5LIB=/d01/oracle/product/10.2.0/perl/lib/5.8.3:/d01/oracle/product/10.2.0/perl/lib/site_perl/5.8.3

3. Export from source instance  (9.2.0.7).

3.1 On Source:
Apply p7429271_11i_SOLARIS.zip - AD.I.7 (I advice to do it before starting the export procedure. It will help a lot in a future)
Apply the Applications consolidated export/import utility patch 4872830 to the source administration server node. This patch provides several SQL scripts that facilitate exporting and importing an Applications database instance. The patch includes a template for the export and import parameter files and a perl script which creates an AD patch driver.
3.2 On Source:
On the source administration server node, use SQL*Plus to connect to the database as SYSTEM and run the $AD_TOP/patch/115/sql/adclondb.sql script. It creates adcrdb.sql and adpostcrdb.sql in the current directory.
sqlplus system/<system password>  @$AD_TOP/patch/115/sql/adclondb.sql 10

3.3 On Source:
Record Advanced Queue settings
Advanced Queue settings are not propagated in the target database instance during the export/import process. Therefore, you must record them beforehand and enable them in the target database instance afterwards. Patch 4872830 contains auque1.sql, which generates a script called auque2.sql. You can use auque2.sql to enable the settings in the target database instance.
Copy the auque1.sql script from the $AU_TOP/patch/115/sql directory on the source administration server node to the source database server node. It does not matter which directory you use. Then, on the source database server node, as the owner of the source database server file system and database instance, use SQL*Plus to connect to the source database as sysdba and run the auque1.sql script. It generates auque2.sql in the current directory.

sqlplus  "/ as sysdba"  @<source database server node directory>auque1.sql
Copy auque2.sql to the Target Server

3.4  On Target:
Copy the adcrdb.sql script, generated in Section 1, from the source administration server node to the target database server node. Then update the script on the target database server node with any necessary changes to the directory structures for the log file(s), data file(s), or tablespaces, reflecting the layout of the target database server node. If the target database server node is running Windows, update the directory structure from UNIX/Linux format to Windows format.
Make sure that the environment of your session on the target database server node is set up properly for the target database instance, especially the ORACLE_HOME, ORACLE_SID, and ORA_NLS10 environment settings. (ORACLE_SID must be set to the same value as the db_name parameter in the init[SID].ora file.) Then, use the following commands to run adcrdb.sql and create the target database instance:

sqlplus  "/ as sysdba"
spool adcrdb.log;
startup nomount;
@adcrdb.sql
exit;

Add the parameters undo_tablespace and undo_management to the initialization parameter file.
When the target database instance has been created, restart the database instance.

3.5 On Source:
cd $APPL_TOP/admin
Copy this 4 files to TARGET instance
addb1020.sql ,adsy1020.sql ,adjv1020.sql , admsc1020.sql

3.6 On Target:
sqlplus "/ as sysdba" @addb1020.sql
sqlplus "/as sysdba"
alter user system identified by <system password>;
create user CTXSYS identified by CTXSYS default tablespace CTXD temporary tablespace TEMP;
sqlplus system/ <system password> @adsy1020.sql
sqlplus system/ <system password> @adjv1020.sql
sqlplus system/ <system password> @admsc1020.sql FALSE SYSAUX TEMP
sqlplus "/ as sysdba" @adpostcrdb.sql

Disable automatic gathering of statistics
Copy $APPL_TOP/admin/adstats.sql from the administration server node to the target database server node. Use SQL*Plus to connect to the database as SYSDBA and use the following commands to restart the database in restricted mode and run adstats.sql:
sqlplus "/ as sysdba"
shutdown immediate;
startup restrict;
@adstats.sql
exit;
shutdown immediate;
startup;

3.7 On Source:
Edit $AU_TOP/patch/115/import/auexpimp.dat  file
The customizable parameters are: 
Parameter Description Template Value
userid SYS schema and password "sys/change_on_install as sysdba"
buffer size of the data buffer 1MB
file export dump file name(s) dmpfil[1-4]
filesize export dump file size 500MB
log log file name expapps.log

Comment out or remove the toid_novalidate parameter. It is used only for the import process. Do not change the other parameters.
The export process uses as many of the listed file names as necessary to hold the exported data. You must ensure that the number of dump files specified, as well as the size of each dump file, is sufficient to contain all the data in your source database instance.

Export Command:
exp parfile=auexpimp.dat

Typically, export runs for several hours. It is a good idea to run it in a manner that will allows it to continue if the client session is accidentally terminated. On UNIX or Linux, run it in the background or with the nohup utility, redirecting standard output and standard error messages to a log file.

4. Import to target instance (10.2.0.1).

4.1 Copy the export dump files and auexpimp.dat to Target:
Remove the "compress=y" parameter
Add the following parameters:
ignore=y
analyze=n
commit=y
Remove any unused export dump file names from the "file" parameter
Change the name of the log file
Uncomment or add the toid_novalidate parameter
Save the changed file.
and Run:
imp parfile=auexpimp.dat

4.2 On Target:
sqlplus "/ as sysdba" @auque2.sql (file was created on section 3.3)

4.3 On Target:
Start the new database listener

4.4 On Target:
Run adgrants.sql (conditional)
If you have at least AD.I or E-Business Suite release 11.5.10 installed on your system, copy $APPL_TOP/admin/adgrants.sql (adgrants_nt.sql for Windows) from the administration server node to the database server node. Use SQL*Plus to connect to the database as SYSDBA and run the script using the following command:
sqlplus "/ as sysdba" @adgrants.sql APPS

Grant create procedure privilege on CTXSYS
$AD_TOP/patch/115/sql/adctxprv.sql
sqlplus apps/simple4u @adctxprv.sql <system password> CTXSYS

4.5 On Target:
Implement and run AutoConfig
  Migrating to AutoConfig on the Database Tier:
   1.perl $AD_TOP/bin/admkappsutil.pl (with appl user)
   2.Copy appsutil.zip  to $ORACLE_HOME
   3.unzip -o appsutil.zip with oracle user
   4.perl $ORACLE_HOME/appsutil/bin/adbldxml.pl tier=db appsuser=apps
   5.Remove old init.ora files (spfile) from $ORACLE_HOME/dbs
     perl $ORACLE_HOME/nls/data/old/cr9idata.pl
     export ORA_NLS10=/d01/PROD/oracle/10.2.0/nls/data/9idata
   6.$ORACLE_HOME/appsutil/bin/adconfig.sh contextfile=<context file>
   7.Change the utl_dir to right ORACLE_HOME in init.ora file and xml file
   8.Run  autoconfig in DB tier
  
sqlplus apps/<apps password>
exec fnd_conc_clone.setup_clean;
commit;

Compile invalid objects:
sqlplus "/ as sysdba" @$ORACLE_HOME/rdbms/admin/utlrp.sql

Gather statistics for SYS schema:
sqlplus "/ as sysdba"
shutdown immediate;
startup restrict;
@adstats.sql
exit;
shutdown immediate;
startup;

5. Migrate Oracle Application 11i to Linux server.

5.1. On Source:
Maintain snapshot information
Run adadmin to maintain snapshot information on all nodes. Refer to the Oracle Applications

5.2. On Source:
Generate and upload the manifest of customer-specific files
Create the manifest file using the script perl $AD_TOP/bin/adgenpsf.pl
Go to https://updates.oracle.com/PlatformMigration (use your OracleMetaLink username and password) and follow the instructions on the screen to upload the manifest file previously generated:
[APPL_TOP]/admin/[TWO_TASK]/out/adgenpsf.txt

5.3 On Target:
Create the Target System APPL_TOP
Copy the middle tier file system from the Source Applications System to the Target Node by executing the following steps in the order listed. Ensure that the application tier files copied to the Target System are owned by the Target APPLMGR user.
APPL_TOP
OA_HTML
OA_JAVA
COMMON_TOP/clone
COMMON_TOP/util
COMMON_TOP/_pages (when that directory exists)

Attention: Copy only the directories listed, not the full COMMON_TOP

5.4 On Target:
Copy the security file for JInitiator
If you wish to preserve the Source System digital signature on the migrated System, copy the identitydb.obj file from the Source System to the Target System. This file is located in the APPLMGR user's home directory on UNIX .
If you want the migrated System to have a new digital signature, remove the following file from the Target System:
         rm $APPL_TOP/admin/appltop.cer

5.5 On Target:
Clone the AutoConfig XML context file on the Target System
cd /d01/PROD/apps/prodcomn/clone/bin
perl adclonectx.pl migrate java=<JDK HOME> \
                  contextfile=<SOURCE SYSTEM CONTEXT FILE>

where:
JDK HOME complete path where the JDK is installed.
SOURCE SYSTEM CONTEXT FILE Full Path to the Source System Applications XML context file located in APPL_TOP/admin on the Target System.

5.6 On Target:
Install the Middle Tier Technology Stack
Run the Rapid Install Wizard with the -techstack option to install the iAS technology stack. Use the Target System context file created in the previous step.
         cd [Stage11i]/startCD/Disk1/rapidwiz
      ./rapidwiz -techstack
Follow the instructions in the "Installation Tasks" section of Installing Oracle9i Application Server 1.0.2.2.2 with Oracle Applications 11i"  (document 146468.1).

5.7 On Target:
Run AutoConfig setup phase on the Target System
Change the java path in xml file to new java or take a fikle from upgrade directory
$AD_TOP/bin/adgetlnxver.sh :change LD_ASSUME_KERNEL with XD_ASSUME_KERNEL
cd $AD_TOP/bin
./adconfig.sh run=INSTE8_SETUP contextfile=[TARGET SYSTEM CONTEXT FILE]
Note: This command does not require the environment to be sourced.

5.8 On Target:
Download and apply the customer-specific update with AutoPatch
See the readme for patch that was created in section 5.2

5.9 On Target:
 Regenerate the file system objects
Source the APPL_TOP environment file and perform the following tasks to regenerate the platform dependent files on the Target System:
If migrating the Forms node, run the following script:
$AD_TOP/patch/115/bin/adgensgn.sh [Apps User]/[Apps Password]
Run adadmin to generate messages, forms, reports, graphics and jar files.

5.10 On Target:
Run AutoConfig to complete the Target System configuration
$AD_TOP/bin/adconfig.sh contextfile=[TARGET SYSTEM CONTEXT FILE]

6. Upgrade to 10.2.0.5.

6.1. download patch 8202632
6.2. Shutdown DB, listener  and APPL.
6.3.  Unzip  patch to temp directory and run ./runInstaller
6.4.  start listener.
6.5. sqlplus "/as sysdba"
   STARTUP UPGRADE;
  @$ORACLE_HOME/rdbms/admin/utlu102i.sql
   SPOOL OFF.
  @$ORACLE_HOME/rdbms/admin/catupgrd.sql
  shutdown immediate;
  startup.
  @$ORACLE_HOME/rdbms/admin/utlrp.sql
 
After the upgrade:
1. sqlplus "/as sysdba" @$ORACLE_HOME/ctx/sample/script/drkorean.sql;
2. Recreate grants and synonyms with adadmin
3. Run Autoconfig in DB and Appl tier
4. Start the application services

Used Documentation:
Note: 362205.1 - 10g Release 2 Export/Import Process for Oracle Applications Release 11i
Note: 230627.1 - 9i Export/Import Process for Oracle Applications Release 11i
Note: 238276.1 - Migrating to Linux with Oracle Applications Release 11i
Note: 567703.1 - Debugging Platform Migration Issues in Oracle Applications 11i

No comments:

Post a Comment