Date post: | 05-Apr-2018 |
Category: |
Documents |
Upload: | peruvemba-vaidyanathan-narayanan |
View: | 226 times |
Download: | 1 times |
of 13
7/31/2019 Crossplatform Verygood
1/13
White Paper:
Migrating an Oracle Applications 10gR2
Database from Solaris to Linux
Author: Tim Watson, June 2009
7/31/2019 Crossplatform Verygood
2/13
Overview
This document covers the process of migrating an Oracle 10gR2 database from the Solaris operating system to the
Linux operating system. The database that this process was executed on supported Oracle Applications 11.5.10.2.
There were additional steps required to accommodate the Apps environment, but much of this process can be
applied to any Oracle 10gR2 database. Many of the scripts are provided by patches applied to the Source application
system. These scripts are useful even if not running an Apps database. The patches can be downloaded and
extracted (unzip). Once extracted, directories under the patch number will contain the scripts which can be
leveraged.
Background
There isnt a migration utility (script or DBUA) to perform a cross platform migration. To change platforms require
the database instance be re-built and / or the data moved using one of the following methods:
1. Export/Import or Datapump facilities. All versions support Export/Import but for Datapump, 10.1.0.2 or
higher is required
2. Transportable Tablespaces 10G or Later
3. RMAN Convert Database functions. 10G or Later
The choices available will depend on BOTH the OS and Oracle versions of both the source and destination. The RMAN
Convert Database functions only work when the Endian format of the source and target are the same. Solaris has an Endian format of
Big and Linux has an Endian format of little, so this was not an option. Transportable Tablespaces has a convert function to convert
from one Endian format to another, but there are limitations (metalink note 371556.1). Because of the complexity of the data within an
oracle applications database and because of some of limitations, Transportable Tablespaces was ruled out as a viable option. That
left option 1 and since the database is 10gR2, the datapump utilities will be used.
Environment
Source:
Operating System: SunOS 5.8, 64-bit
Endian Format: Big
Database: 10.2.0.2.0
Apps Version: 11.5.10.2
Size: 90 GB
Storage: DAS
Target:
Operating System: RHEL 5, 2.6.18-53.el5, 64-bit
Endian Format Little
Database: 10.2.0.4
Apps Version: 11.5.10.2
Size: 90GB
Storage: NAS (NetApp)
7/31/2019 Crossplatform Verygood
3/13
1. Prepare the Source System
1.1 Perform the steps in the "Before the Database Installation" subsection of Section 1 of the Oracle Applications
Release 11i with Oracle Database 10g Release 2 (10.2.0) Interoperability Notes.
Do not export the OLAP analytical workspaces.
Verify that you have at least 1.5 GB of free SYSTEM tablespace.Deregister the current database server (didn't execute this until ready to execute autoconfig on the
new linux server)
perl $ORACLE_HOME/appsutil/bin/adgentns.pl appspass=apps
contextfile=$CONTEXT_FILE -removeserver
Update application tier context file with new database listener port number
s_dbhost New database hostname
s_dbdomain New database domain name
s_db_serv_sid New database SID
s_dbport New database listener port
s_apps_jdbc_connect_descriptor NULL
Don't execute autoconfig at this time, only update context file. Autocofig will be executed later.
1.2 Apply the Applications consolidated export/import utility patch (4872830) - adpatch
1.3 Apply latest Applications database preparation scripts patch (7225862) - do not use adpatch, Copy the files
located under $PATCH_TOP/admin directory to your $APPL_TOP/admin directory
1.4 Generate target database instance creation script adcrdb.sql
SQL> sqlplus system/ @$AD_TOP/patch/115/sql/adclondb.sql 10
script generates adcrdb.sql and adpostcrdb.sql
1.5 Record Advanced Queue settings
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
SQL> connect / as sysdba;SQL> @auque1.sql
This will generate auque2.sql in the current directory. Will be used later on target.
1.6 Remove rebuild index parameter in spatial indexes
SQL> select * from dba_indexes where index_type='DOMAIN' and upper(parameters) like
'%REBUILD%';
SQL> alter index rebuild parameters
where is the original parameter set without the rebuild_index parameter
1.7 Purge recycle bin
Apps environments, by nature, create and drop tables during normal processing. Over time, 1000s
of tables can end up in the recyclebin. It is recommened to purge the recyclebin before export to
improve the export/import performance and to reduce required storage.
SQL> purge dba_recyclebin;
1.8 Fix potential import issue
During test import runs, you might find storage issues that can be corrected before export. Below is
an example of one issue that we encountered.
alter table applsys.DR$FND_LOBS_CTX$I storage(maxextents unlimited);
-had to do this step again during import.
7/31/2019 Crossplatform Verygood
4/13
1.9 Datapump Import Errors ORA-39125 in KUPW$WORKER.PUT_DDLS with LPX-00007 (Note: 554701.1)
We encountered an error when importing triggers that turned out to be a bug in 10.2.0.2. The issue
has to be corrected in the source database before export. We applied patch 6026088 for 10.2.0.2
mentioned in note 554701.1. This patch did not fix the issue.
The released patch 6753556 for 10.2.0.3 was confirmed to be valid for a 10.2.0.2 database, so we
applied that patch and it did fix the issue. (Issue was not encountered in a 10.2.0.4 database).
Applied patch 6026088 following steps in the readme
Issue was not fixed
Applied patch 6753556 following steps in the readme
Issue was fixed
Recommendation is to upgrade to 10.2.0.4 before performing export to avoid bugs.
2. Prepare the Target Database System
2.1 Verify RHEL 5 installation requirements for 10gR2 (Metalink note 421308.1)
Physical Memory: minimum 1GB RAM, grep MemTotal /proc/meminfo
Swap Space: 2GB RAM = 1.5 times RAM, 8GB RAM = RAM, >8GB RAM = 0.75 times RAM,
grep SwapTotal /proc/meminfo
Disk: 400 MB of disk space in the /tmp directory, 1.5 GB - 3.5 GB of disk space for Oracle software
Kernel: 2.6.18-8 (or later), uname -r
SELinux: Must be disabled, /usr/sbin/getenforce, /usr/sbin/sestatus, /usr/sbin/selinuxenabled; if [
$? -ne 0 ]; then echo "DISABLED"; else echo "ENABLED"; fi
Change the SELINUX value to "SELINUX=disabled", reboot.
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"
RPM: binutils-2.17.50 (x86_64)
compat-db-4.2.52 (x86_64)compat-libstdc++-296(i386)
compat-libstdc++-33-3.2.3 (x86_64)
compat-libstdc++-33-3.2.3(i386)
control-center-2.16.0 (x86_64)
gcc-4.1.1 (x86_64)
gcc-c++-4.1.1 (x86_64)
glibc-2.5-12 (x86_64)
glibc-2.5-12 (i686)
glibc-common-2.5-12 (x86_64)
glibc-devel-2.5-12 (x86_64)
glibc-devel-2.5-12(i386)
glibc-headers-2.5-12 (x86_64)
ksh-20060214-1.4 (x86_64)
libaio-0.3.96 (x86_64)
libgcc-4.1.1(i386)
libgcc-4.1.1(x86_64)
libgnome-2.16.0 (x86_64)
libgnomeui-2.16.0 (x86_64)
libgomp-4.1.1 (x86_64)
libstdc++-4.1.1 (x86_64)
libstdc++-devel-4.1.1 (x86_64)
7/31/2019 Crossplatform Verygood
5/13
libXp-1.0.0-8 (i386)
make-3.81 (x86_64)
sysstat-7.0.0 (x86_64)
Kernel Parms: /etc/sysctl.conf , sysctl -p
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
fs.file-max = 65536
semmsl 250 /proc/sys/kernel/sem
semmns 32000
semopm 100
semmni 128
shmall 2097152 /proc/sys/kernel/shmall
shmmax Half the size of physical memory (in bytes) /proc/sys/kernel/shmmax
shmmni 4096 /proc/sys/kernel/shmmni
file-max 65536 /proc/sys/fs/file-max
ip_local_port_range Minimum:1024,Maximum: 65000
/proc/sys/net/ipv4/ip_local_port_range
rmem_default 262144 /proc/sys/net/core/rmem_default
rmem_max 262144 /proc/sys/net/core/rmem_max
wmem_default 262144 /proc/sys/net/core/wmem_defaultwmem_max 262144 /proc/sys/net/core/wmem_max
Create Oracle users and groups
Verify mounts and ownership
Limits: /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
/etc/pam.d/login - session required pam_limits.so
/etc/profile
if [ $USER = "oracle" ]; thenulimit -u 16384
ulimit -n 65536
fi
DNS: /etc/nsswitch.conf
verify using files,
check hostname,
check domainname (should return none),
/etc/hosts fully qualified name
7/31/2019 Crossplatform Verygood
6/13
OUI: ./runInstaller -ignoreSysPrereqs
7/31/2019 Crossplatform Verygood
7/13
changed PCTINCREASE 0
changed TEMP location and increase to 6GB
Verify ORACLE_HOME, ORACLE_SID, and ORA_NLS10 are set to target
export ORACLE_HOME=/u01/app/oracle/TEST/product/10.2.0
export ORACLE_SID=TEST
export ORA_NLS10=/u01/app/oracle/TEST/product/10.2.0/nls/data/9idata
export PATH=$ORACLE_HOME/bin:$PATH
. oraenv
SQL> connect / as sysdba;
SQL> spool adcrdb.log;
SQL> startup nomount;
SQL> @adcrdb.sql
SQL> exit;
Add the parameters undo_tablespace and undo_management to the initialization parameter file
Add the parameters that pertain to the native compilation where specified if not already thereBounce database
2.5 Copy database preparation scripts to target Oracle home
Copy from the $APPL_TOP/admin directory on the source to $ORACLE_HOME/appsutil/admin on the
target (can get these directly from patch 7225862)
addb1020.sql
adsy1020.sql
adjv1020.sql
admsc1020.sql
The remarks section at the beginning of each script contains additional information
Each script creates a log file in the current directory
2.6 Set up the SYS schemasqlplus "/ as sysdba" @$ORACLE_HOME/appsutil/admin/addb1020.sql
2.7 Set up the SYSTEM schema
sqlplus system/ @$ORACLE_HOME/appsutil/admin/adsy1020.sql
2.8 Install Java Virtual Machine
sqlplus system/ @$ORACLE_HOME/appsutil/admin/adjv1020.sql
2.9 Install other required components
sqlplus system/ @$ORACLE_HOME/appsutil/admin/admsc1020.sql FALSE
SYSAUX TEMP
2.10 Run adpostcrdb.sql scriptCopy the adpostcrdb.sql script, generated in Section 1, from the source to the target
sqlplus system/ @adpostcrdb.sql
Note: system didn't have rights - had to execute as sysdba
2.11 Disable automatic gathering of statistics
Copy $APPL_TOP/admin/adstats.sql from the source to the target
sqlplus "/ as sysdba"
SQL> shutdown normal;
7/31/2019 Crossplatform Verygood
8/13
SQL> startup restrict;
SQL> @adstats.sql
SQL> exit;
2.12 Back up the target database instance (get a backup before starting import in case you have to start over)
3. Export the Source Database
3.1 Create the export parameter file
Copy $AU_TOP/patch/115/import/auexpdp.dat from the source to the directory on the database
server node where the export dump files are to be created
Modify the file to reflect the source environment and other customized parameters.
Parameter Description Template Value
directory directory where the export dump files will be created dmpdir
dumpfile export dump file name(s) aexp%U.dmp
filesize export dump file size 1GB
log log file name expdpapps.log
interMedia, OLAP, and Data Mining schemas are not exported
Ensure that the schema names in the exclude parameters reflect those in your database.
Create a directory in the system schema that corresponds to the directory specified in the template.
sqlplus system/
SQL> create directory dmpdir as '/patches/linux_migration/export/TEST';
Comment out or remove the transform parameter. It is used only for the import process. Do not
change the other parameters.
3.2 Shut down Applications server processes (stop all application processes but leave database and listener up)
3.3 Back up AZ table data (may need to upgrade to AZ.H.DELTA.1) Note: 402785.1
3.4 Grant exempt access policy privilege to source system schemaSQL> grant EXEMPT ACCESS POLICY to system;
3.5 Export the Applications database instance
expdp system/ parfile=
3.6 Revoke exempt access policy privilege from source system schema
SQL> revoke EXEMPT ACCESS POLICY from system;
4. Import into the Target Database
4.1 Create the import parameter file
Copy the export parameter file you created in Section 1 from the source to target
Remove the exclude parameters.
Remove the filesize parameter.
Change the name of the log file.
Uncomment the transform parameter.
Create a directory in the system schema with the name set to the directory specified in the template
$ sqlplus system/
SQL> create directory dmpdir as '/patches/linux_migration/export/TEST';
4.2 Copy the export dump files (copy from source to target if needed)
7/31/2019 Crossplatform Verygood
9/13
4.3 Import the Applications database instance
$ impdp system/ parfile=
4.4 Issue encountered with import:
ORA-01631: max # extents (505) reached in table APPLSYS.DR$FND_LOBS_CTX$I
alter table applsys.DR$FND_LOBS_CTX$I storage(maxextents unlimited);
ALTER USER "PORTAL30_PUBLIC" GRANT CONNECT THROUGH "PORTAL30"
ALTER USER "PORTAL30_SSO_PUBLIC" GRANT CONNECT THROUGH "PORTAL30_SSO"
KOREAN_LEXER (created but failed)
sqlplus
connect / as sysdba
@?/ctx/sample/script/drkorean.sql
The following domain indexes where still invalid after executed the drkorean.sql script:
"CS"."CS_FORUM_MESSAGES_TL_N3"
"CS"."CS_FORUM_MESSAGES_TL_N4"
"CS"."CS_INCIDENTS_ALL_TL_N1""CS"."CS_KB_ELEMENTS_TL_N2"
"CS"."CS_KB_SETS_TL_N3"
"CS"."CS_KB_SOLN_CAT_TL_N1"
"CS"."SUMMARY_CTX_INDEX"
"ICX"."ICX_QUES_CTX"
Steps to correct invalid domain indexes:
cd $CS_TOP/patch/115/sql
sqlplus apps/
@cskbctxp.sql APPS CS CTXSYS
Login as System Administrator.
Submit the concurrent request "Knowledge Management Forum Messages IndexSynchronization" using mode "DR".
Also submitted the following jobs using mode DR
Knowledge Management Category Index Synchronization
Knowledge Management Solution Index Synchronization
Knowledge Management Statement Index Synchronization
@cssrcrix.sql APPS CS CTXSYS
@cssrctxp.sql APPS CS CTXSYS
@cssrtxtx.sql CS
Can Ignore Errors with triggers below - tables are obsolete and not used.
RA_ADDRESSES_T1_VEH
RA_ADDRESSES_BRIU
5. Finishing Tasks on the Target System
5.1 Reset Advanced Queues
Copy auque2.sql that was generated in Section 1 from the $ORACLE_HOME/appsutil/admin
directory of the source to the target.
$ sqlplus /nolog
7/31/2019 Crossplatform Verygood
10/13
SQL> connect / as sysdba;
SQL> @$ORACLE_HOME/appsutil/admin/auque2.sql
5.2 Perform post-import steps outlined in the Interoperability document (362203.1)x
Start the new database listener if not already started
Run adgrants.sql
copy $APPL_TOP/admin/adgrants.sql from apps tier to the database tier
sqlplus "/ as sysdba" @adgrants.sql
Grant create procedure privilege on CTXSYS
Copy $AD_TOP/patch/115/sql/adctxprv.sql from the apps tier to the database tier
$ sqlplus apps/ @adctxprv.sql CTXSYS
Implement and run AutoConfig
edit context file on apps tier if you haven't already to reflect new linux host
create tnsnames.ora and listener.ora for rdbms and start listner (need to do this until
autoconfig is enabled)
exec FND_NET_SERVICES.REMOVE_SERVER('', '_')
execute autoconfig on the apps tier
adgendbc.sh will fail until autoconfig is executed on the dbtier.
configure autoconfig on the db tierOn the Application Tier (as the APPLMGR user):x
Log in to the APPL_TOP environment (soxurce the environment file)
Create appsutil.zip file
perl /bin/admkappsutil.pl
This will create appsutil.zip in $APPL_TOP/admin/out .
On the Database Tier (as the ORACLE user):
Copy or FTP the appsutil.zip file to the
cd
unzip -o appsutil.zip
Review database context file and make any necessary edits
perl adbldxml.pl tier=db
edit context file
OUTBOUND_DIR/u01/app/oracle/TEST/product/10.2.0/appsutil/outbound/TEST
execute adchkcfg.sh contextfile= if you want a report of what
changes will be made by running autoconfig
execute autoconfig on db tier
cd /appsutil/bin
adconfig.sh contextfile=
edit "s_apps_jdbc_connect_descriptor" with NULL
verify /etc/hosts is correct with domain for database server.
execute autoconfig on the apps tier again and verify adgendbc.sh completed successfully.
Gather statistics for SYS schema
$ sqlplus "/ as sysdba"
SQL> shutdown normal;
SQL> startup restrict;SQL> @adstats.sql
SQL> shutdown normal;
SQL> startup;
SQL> exit;
Re-create custom database links (checks links for changes in host name)
Add test, prod, etc to tnsnames (compare to tnsnames from source system)
Apply Oracle Receivables patch 5753621 (adpatch)
7/31/2019 Crossplatform Verygood
11/13
5.3 Restore AZ table data (Note: 402785.1)
5.4 Create OWA_MATCH package
Create subdirectory $ORACLE_HOME/appsutil/admin/OWS.
Download Patch 3835781 to any patch directory and unzip it.
Copy the following files from this patch directory to $ORACLE_HOME/appsutil/admin/OWS.
patch.sql
modplsql/owa/pubmat.sql
modplsql/owa/privmat.sql
Set the environment to point to ORACLE_HOME on the database server.
From directory $ORACLE_HOME/appsutil/admin/OWS execute the following commands:
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> @patch.sql
5.5 Create ConText and Spatial objects (script generates driver file that you name)
perl $AU_TOP/patch/115/driver/dpost_imp.pl
apply using adpatch5.6 Compile invalid objects
$ sqlplus sys/ @$ORACLE_HOME/rdbms/admin/utlrp.sql
5.7 Maintain Applications database objects
Using adadmin:
Compile flexfield data in AOL tables
Recreate grants and synonyms for APPS schema
5.8 Start Applications server processes
5.9 Create DQM indexes
Create DQM indexes by following these steps:
Log on to Oracle Applications with the "Trading Community Manager" responsibilityClick Control > Request > Run
Select "Single Request" option
Enter "DQM Staging Program" name
Enter the following parameters:
Number of Parallel Staging Workers: 4
Staging Command: CREATE_INDEXES
Continue Previous Execution: NO
Index Creation: SERIAL
Click "Submit"
5.10 Re-create DBMS jobs
A feature of 10gR2 is that during import, all dbms_jobs are created under the user that is used for
the import process. In this case, the system user will own all the jobs.The DBMS_JOB.USER_EXPORT procedure can be used to create a call to DBMS_JOB.ISUBMIT to
recreate the jobs. Below is an example for one job:
set array 1
var job number
var jobstring VARCHAR2(2000)
col jobstring format a1000 word_wrap
col what format a25 word_wrap
7/31/2019 Crossplatform Verygood
12/13
col interval format a20
ALTER SESSION SET NLS_DATE_FORMAT='YYYY:MM:DD:HH24:MI:SS';
BEGIN
DBMS_JOB.USER_EXPORT(2482,:jobstring);
END;
/
print jobstring
connect SYSTEM/
exec dbms_job.remove(2482);
connect /
execute jobstring printed above
5.11 Re-Size Datafiles
The script provided by the application patches that creates the database shell will size the datafiles
exactly as they are on the source system. The import process should tighten up the extents withinthe tablespace, so there may be additional space that can be reclaimed by resizing the datafiles.
The following script will indicate which files can be resized:
set verify off
column file_name format a50 word_wrapped
column smallest format 999,990 heading "Smallest|Size|Poss."
column currsize format 999,990 heading "Current|Size"
column savings format 999,990 heading "Poss.|Savings"
break on report
compute sum of savings on report
column value new_val blksizeselect value from v$parameter where name = 'db_block_size'
/
select file_name,
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) smallest,
ceil( blocks*&&blksize/1024/1024) currsize,
ceil( blocks*&&blksize/1024/1024) -
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) savings
from dba_data_files a,
( select file_id, max(block_id+blocks-1) hwm
from dba_extents
group by file_id ) b
where a.file_id = b.file_id(+)/
column cmd format a75 word_wrapped
select 'alter database datafile '''||file_name||''' resize ' ||
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) || 'm;' cmd
from dba_data_files a,
( select file_id, max(block_id+blocks-1) hwm
7/31/2019 Crossplatform Verygood
13/13
from dba_extents
group by file_id ) b
where a.file_id = b.file_id(+)
and ceil( blocks*&&blksize/1024/1024) -
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) > 0
/
5.12 Unlock stats on AQ tables
select owner, table_name, stattype_locked
from dba_tab_statistics
where stattype_locked is not null;
exec dbms_stats.unlock_table_stats('APPLSYS', 'AQ$_WF_CONTROL_P');
5.13 DB consolse setup:
If you arent using Enterprise Manager Grid Control, you may want to setup the DB console for
monitoring in your new database
$ emca -repos create$ emca -config dbcontrol db
$ emctl start dbconsole
$ emctl stop dbconsole
$ emctl status dbconsole
Summary
Again, many of these steps are specific to an Oracle Applications 11i database, but many of the scripts and
procedures can be leveraged for any 10gR2 database. The important thing to remember is that there are a lot of
little things that need to be verified that might be specific to your environment. Counts of objects and the number of
invalid objects should be compared between the source and target. Also, full functional regression testing should be
performed to verify that the application is functioning properly. For timing purposes, the export of this 90 GBdatabase took 6 hours, while the import took 7 hours.
References
733205.1 - Migration of Oracle Database Instances Across OS Platforms
243304.1 - 10g : Transportable Tablespaces Across Different Platforms
371556.1 How to move tablespaces across platforms using Transportable Tablespaces with RMAN
331221.1 - 10g Export/Import Process for Oracle Applications Release 11i
554701.1 - Datapump Import Errors ORA-39125 in KUPW$WORKER.PUT_DDLS with LPX-00007
About the AuthorTim Watson is Principal Consultant for SageLogix, Inc. He was previously with Oracle Consulting Services. He has
worked with Oracle since version 7, and has been consulting to Oracle clients for over 10 years. His primary
consulting focus is on implementing and maintaining Oracle Applications environments.