2008年9月27日星期六

Migrating Oracle EBS R12 from linux 32-bit to 64-bit

1. Prerequisites
Section 1: Prerequisites of the Cloning Oracle Applications Release 12 with Rapid Clone document details the prerequisite steps to clone an Oracle E-Business Suite system. The platform migration process in this document requires cloning the application tier components from the Linux 32-bit environment to the Linux 64-bit environment. Perform all steps in Section 1: Prerequisites to prepare both the source and target systems for the migration of the Oracle E-Business Suite system.
# Verify OS requirements on Target System
Before cloning to a new server, ensure the Target System meets all the requirements for Oracle Applications Release 12 stated on the Oracle Applications Release Notes and on the Oracle Applications Installation and Upgrade Notes for each Platform. For the latest installation guidelines refer to OracleMetaLink Document 405565.1.
# Verify source and target nodes software versions
In addition to the Oracle Applications software requirements (see Oracle Applications Installation Guide: Using Rapid Install, Release 12), the following software component versions must exist on the source and/or target nodes. The location column indicates the node where the software component must be present.
# Apply the latest AD patch
Apply patch 6510214 (R12.AD.A.DELTA.4) or higher. Refer to OracleMetaLink to obtain the latest AD patch available.
# Apply the latest AutoConfig Template patch
Update the Oracle Applications file system with the latest AutoConfig template files by applying the TXK AutoConfig Template rollup patch to all application tier server nodes. Refer to Document 387859.1 in OracleMetaLink for details of the latest AutoConfig Template rollup patch.
# Apply the latest Rapid Clone patches
Update the Oracle Applications file system with the latest Rapid Clone files by applying the following patches to all Applications nodes:
* 5484000 : Oracle E-Business Suite 12.0.2 Release Update Pack (RUP2)
* 6776948 : R12 RAPIDCLONE CONSOLIDATED FIXES JUL/2008
Warning: If new Rapid Clone or AutoConfig updates are applied to the system, steps 6, 7 and 8 below must be executed again in order to apply the new files into the Database Node.
# Run AutoConfig on the Application Tiers
Follow the steps under section " Run AutoConfig on the Application Tiers " in OracleMetaLink Document 387859.1 to Run AutoConfig on all application tier nodes.
# Synchronize appsutil on the Database Tier Nodes
Follow the steps under section "Copy AutoConfig to the RDBMS ORACLE_HOME" in OracleMetaLink Document 387859.1 to copy AutoConfig and Rapid Clone files to each database node via the admkappsutil.pl utility.

# Run AutoConfig on the Database Tier
Follow the steps under section "Run AutoConfig on the Database Tier" in OracleMetaLink Document 387859.1 to Run AutoConfig on the database tier nodes.

# Maintain Snapshot information
Log in to each Applications Node as the APPLMGR user, and run "Maintain Snapshot information" in AD Administration.
See Oracle Applications Maintenance Utilities for more information.

Use the R12 Rapid Install to install the 10.2.0 database Oracle home on the target Linux 64-bit machine. See the Installing Technology Stack Components chapter of the Oracle Applications Installation Guide: Using Rapid Install.
$ rapidwiz -techstack
select the 'Database Technology Stack (10gR2 RDBMS)' option

2.Migration
The migration of the E-Business Suite system from the 32-bit environment to the 64-bit environment is a two steps process of migrating the database using the process documented in Using Oracle E-Business Suite Release 12 with a Database Tier Only Platform on Oracle 10g Release 2 and migrating the application tier using the process documented in Cloning Oracle Applications Release 12 with Rapid Clone.
Migrate the Database
# Shut down the application tier services
Log on to each machine in the application tier and stop the Oracle E-Business Suite services.
$ cd /admin/scripts/
$ adstpall.sh apps/

# De-register the original database
De-register the original database server machine from the AutoConfig repository in the Applications database.
As the ORACLE user, log on to the machine with the existing database and run the following commands:
$ cd /appsutil/bin
$ perl adgentns.pl appspass= contextfile= -removeserver

# Migrate OLAP analytical workspaces
To migrate from a 32bit installation to a 64bit installation of Oracle OLAP, the basic steps are:
1) On the original 32-bit installation, export user created AWs and then delete these AWs.
2) Remove OLAP from the 32bit installation using the Oracle Universal Installer.
OLAP delete and reinstall,metalink:386990.1
3) For the new 64-bit installation make certain Oracle OLAP is installed.
4) Import all AWs from the 32bit installation.

Detailed steps:
--export user created AWs and then delete these AWs.
declare
ex_dir varchar2(200) := '/home/oracle/aw';
begin
for x in (select owner#||'.'||awname fullaw from sys.aw$ where owner# != 0) loop:
dbms_aw.execute('aw attach '||x.fullaw||' rw');
dbms_aw.execute('allstat');
dbms_aw.execute('export all to eif file '''||ex_dir||'/'||x.fullaw||'.eif ''');
dbms_aw.execute('aw detach '||x.fullaw);
dbms_aw.execute('aw delete '||x.fullaw);
end loop;
end;


--import each of the exported AWs
begin
for x in (select fullaw, eif from ?TAB) loop:
dbms_aw.execute('aw attach '||x.fullaw||' rw');
dbms_aw.execute('import all from eif file '''||x.eif||''' data dfns');
dbms_aw.execute('update');
commit;
dbms_aw.execute('aw detach '||x.fullaw);
end loop;
end;

# Create a .trc file to use as template to recreate the control files on the target machine
$ sqlplus/nolog
SQL> connect / as sysdba
SQL> alter database backup controlfile to trace

# Shut down the original (source) database
Perform a SHUTDOWN NORMAL on the source database, and stop the database listener.

# (Option A) Migrate Linux 32-bit database to Linux Itanium
Perform the following steps to move the Linux 32-bit database to Linux Itanium:
1. Copy the database (.dbf) files from the source machine to the target machine
2. Copy the database configuration files init.ora and ifilecbo.ora
3. Modify configuration files on target machine to reflect the new environment. Also, set _system_trig_enabled=false
4. Start up the database in nomount mode
5. Recreate the database control files
copy $ORACLE_HOME/admin/$SID/udump/orcl_ora_xxxx.trc to the target machine, Edit the file to point the path of the datafiles and redologfiles.
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 14
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 '$ORACLE_HOME\ORADATA\VIS\REDO01.LOG' SIZE 100M,
...
DATAFILE
'$ORACLE_HOME\ORADATA\VIS\SYSTEM01.DBF',
...
CHARACTER SET WE8MSWIN1252
;
and rename it to ctl.sql
Then startup the database in nomount mode and run the ctl.sql file as sys as sysdba user
SQL> startup nomount
SQL> @ctl.sql
create temporary tablespace TEMP2 TEMPFILE '/home2/oracle/oradata/sysmon/temp02.dbf'
6. Upgrade the database from 32-bit to 64-bit (recompile pl/sql modules and change the word size) by running
and utlrp.sql (in ORACLE_HOME/rdbms/admin/). Refer to the usage and notes sections in each of these scripts for instructions on how to run them.

1. Query returning the number of invalid objects remaining. This
number should decrease with time.
SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);

2. Query returning the number of objects compiled so far. This number
should increase with time.
SELECT COUNT(*) FROM UTL_RECOMP_COMPILED

在utlrp.sql执行过程中出现错误_intel_fast_memcpy.A()+10, 是由于32bit的OLAP没有删除引起的。
1. Remove OLAP:
At the system prompt 'cd' to the ORACLE_HOME/olap/admin directory then:
SQL> @?/olap/admin/catnoamd.sql
SQL> @?/olap/admin/catnoaps.sql
SQL> @?/olap/admin/catnoxoq.sql
SQL> @?/olap/admin/olapidrp.plb

2. Add OLAP

Add the OLAP option to an existing Enterprise Edition Database
Assuming that you created your database manually or via DBCA, Enterprise
Edition in Oracle Database 10g:
SQL> connect SYS as SYSDBA
SQL> @?/olap/admin/olap.sql SYSAUX TEMP;

3. Recompile any invalid objects:
SQL> @?/rdbms/admin/utlrp

4. Check for any invalid OLAPSYS objects:
SQL> select owner, object_name, object_type, status from dba_objects where status = 'INVALID' and OWNER = 'OLAPSYS' ;

5. Check OLAP components in the DBA_REGISTRY.
SQL> column comp_name format a35
SQL> SELECT comp_name, status, substr(version,1,10) as version from dba_registry;

7. Remove _system_trig_enabled=false from init.ora


8. Shutdown and restart the database normally

Migrate the Application Tier
# Prepare the source system
* Prepare the source system application tier for cloning
# Copy the source system to the target system
* Copy the application tier file system
Update the Target System
# Update environment variable
On the target system, set the environment variable LDEMULATION to elf_i386.
# Update CTXORIG.xml
Update the the value of the s_platform parameter in CTXORIG.xml from Linux to LINUX_X86-64. The CTXORIG.xml file is located in the /clone/context/apps directory of the target system. A sample entry is shown below:
LINUX_X86-64

Post-Migration
执行下列步骤配置目标系统并同步应用层和数据层
Database Tier
Refer to Section 4: Post-Migration tasks of Using Oracle E-Business Suite Release 12 with a Database Tier Only Platform on Oracle 10g Release 2 and perform the following steps.
1. Natively recompile PL/SQL code
Setting up Initialization Parameters for PL/SQL Native Compilation
This section describes the initialization parameters that are used to set PL/SQL native compilation.
* PLSQL_NATIVE_LIBRARY_DIR
* PLSQL_NATIVE_LIBRARY_SUBDIR_COUNT
* PLSQL_CODE_TYPE, ALTER SYSTEM SET PLSQL_CODE_TYPE=NATIVE

$ORACLE_HOME/plsql/spnc_commands
Run the $ORACLE_HOME/rdbms/admin/dbmsupgnv.sql script as the user SYS to update the plsql_code_type setting to NATIVE
This update must be done when the database is in UPGRADE mode
Shut down the database and restart in NORMAL mode.
ALTER SYSTEM ENABLE RESTRICTED SESSION;
$ORACLE_HOME/rdbms/admin/utlrp.sql
If for any reason the script is abnormally terminated, rerun the utlrp.sql script to recompile any remaining invalid PL/SQL modules.

Checking for PLSQL Compilation Type
SELECT TYPE, PLSQL_CODE_TYPE, COUNT(*) FROM DBA_PLSQL_OBJECT_SETTINGS
WHERE PLSQL_CODE_TYPE IS NOT NULL
GROUP BY TYPE, PLSQL_CODE_TYPE
ORDER BY TYPE, PLSQL_CODE_TYPE;
Any objects with a NULL plsql_code_type are special internal objects and can be ignored.

2. Start the new database listener
3. Implement and run AutoConfig on the database server node
cd /appsutil/scripts/.
./adautocfg.sh
4. Re-create custom database links
Application Tier
Refer to Section 2: Clone Oracle Applications Release 12 of Cloning Oracle Applications Release 12 with Rapid Clone and perform the following steps.
* Configure the target system
o Configure the target system application tier server nodes
cd /clone/bin
perl adcfgclone.pl appsTier
Refer to Oracle Applications Maintenance Procedures and perform the following steps using AD Administration.

1. Relink AD executables (Use AD Relink for this step)
cd /d01/oracle/VIS/apps/apps_st/appl
. APPSVIS_demo2.env
adrelink.sh force=y backup_mode=all "ad adadmin" "ad adadminnew" "ad adadmin_wrapper" "ad adaimgr" "ad adchkdig" "ad adctrl" "ad adctrlnew" "ad adctrl_wrapper" "ad addefgen" "ad addmimp" "ad adgenhnm" "ad adgetreg" "ad adident" "ad adjava" "ad adjkey" "ad admrgpch" "ad adncnv" "ad adodfcmp" "ad adpatch" "ad adpatchnew" "ad adpatch_wrapper" "ad adprmkey" "ad adpwmask" "ad adrebase" "ad adregenv" "ad adsplice" "ad adsplicenew" "ad adsplice_wrapper" "ad adsstart" "ad adurs" "ad adwait" "ad adworker" "ad adxerr.pl"
2. Relink Applications programs
adadmin
'Shut down servers
'go to the Maintain Applications Files
'menu. Then, choose the "Relink Applications programs" task
Product library for product "izu" not found
3. Generate message files

4. Generate form files
5. Generate report files
6. Generate product JAR files

Refer to Section 3: Finishing Tasks of Cloning Oracle Applications Release 12 with Rapid Clone and perform the following steps.

1. Update profile options
2. Update printer settings
3. Update Workflow configuration settings
if the following error is received
ORA-04063: rule set "APPLSYS.WF_DEFERRED_R" has errors
ORA-06512: at ""
solution:
sqlplus applsys/
declare
lagent sys.aq$_agent;
subscriber_exist exception;
pragma EXCEPTION_INIT(subscriber_exist, -24034);
begin
lagent := sys.aq$_agent('WF_DEFERRED',null,0);
dbms_aqadm.add_subscriber(queue_name=>'APPLSYS.WF_DEFERRED',subscriber=>lagent,rule=>'1=1');
exception
when subscriber_exist then
-- just add the rule if subscriber exists
dbms_aqadm.alter_subscriber(queue_name=>'APPLSYS.WF_DEFERRED',subscriber=>lagent,rule=>'1=1');
end;
/
4. Verify APPLCSF variable setting
5. Update the SESSION_COOKIE_DOMAIN value in ICX_PARAMETERS