HP-UX 11.00 / ORA8.0.6 to RHEL AS 3.0 / ORA9.2.0.5 MIGRATION
Below is the procedure used on Turkey’s first Unix > Linux Migration of a 4.0B R/3 System.
History ha?
This was also my companies and my first Linux Migration. After that, we did lot 🙂
EXPORTING THE SOURCE SYSTEM
PREPARATIONS |
|
|
Copying Installation CDs
Copy the following CDs onto System and chmod them to 777
|
Adjust File Systems
Extent Following file systems so that they have enough free space
|
|
Download the following patches from internet
|
|
ORACLE 8.0.6 to 8.1.7.4 Migration | |
|
Create the following File Systems
|
Unpack the Oracle 817 software into stage as follow: # su – ora<sid> $ cd /oracle/stage $ mkdir 817_64 or 817_32 $ /<cd_dir>/UNIX/UPGRADE.ORA |
|
|
Check the Requirements in Database (user: ora<sid>) $ cd /oracle/stage/817_32/Disk1/SAP or 817_64/Disk1/SAP $ svrmgrl SVRMGRL> connect system/<passwd> SVRMGRL> @CHECKS.SQL |
|
Modify the Oracle Initialization Parameters
Modify the file $ORACLE_HOME/dbs/init<SAPSID>.ora as follows:
1. Replace all question marks with /oracle/<SAPSID>. The following parameters are affected: backround_dump_dest user_dump_dest core_dump_dest log_archive_dest
2. If the parameters listed below are available, delete them. As parameter names can contain upper-case and lower-case letters, you must first deactivate the case-sensitive search function in the editor. optimizer_features_enable optimizer_search_limit _lgwr_async_write
3. Insert the following parameters. If they already exist, modify the values as required: log_checkpoint_interval = 300000 db_file_multiblock_read_count = 8 |
|
Backing Up the Oracle Database
Before you start the upgrade or migration, create a complete backup of your database. |
|
Shutting Down the SAP System
Shut down the SAP System with the user <sapsid>adm. $ stopsap r3 |
|
Calling the Script PREMIG.SQL
Call the script PREMIG.SQL by entering: $ cd /oracle/stage/817_32/Disk1/SAP or 817_64/Disk1/SAP , respectively $ sqlplus system/<password> > @PREMIG.SQL |
|
Shutting Down the Database
To shut down the database, enter the command: $ svrmgrl > connect internal > shutdown immediate > exit |
|
Shutting Down the Listener Process
The listener process must be shut down by the user that started it. This is usually ora<sapsid>. Check this using the command: # ps -ef | grep tnslsnr or ps -axu | grep tnslsnr
To shut down the listener process, enter the command: $ ORACLE_HOME/bin/lsnrctl stop |
|
Check that no processes for sap users running
Determine whether any Oracle processes are still active for this SAPSID by entering the command:
# ps -afe | fgrep <SAPSID> |
|
Checking and Setting the Environment Variables
1. Make sure the following environment variables are not set: TWO_TASK ENV
2. Set the following environment variables: DISPLAY <hostname>:0 ORACLE_BASE /oracle ORACLE_SID <SAPSID> ORACLE_HOME /oracle/<SAPSID>/817_32 or 817_64 NLS_LANG <refer to the output of script CHECKS.SQL> ORA_NLS33 $ORACLE_HOME/ocommon/nls/admin/data SAPDATA_HOME /oracle/<SAPSID>
Set the corresponding environment variable regardless of whether you are importing 32 bit or 64 bit Oracle software. HP-UX SHLIB_PATH $ORACLE_HOME/lib
Enter the command: set path = ($ORACLE_HOME/bin $path)
Make sure that the new variables are permanently set in the profiles of the users <sapsid>adm and ora<sapsid>. You can set these variables by editing the files .dbenv_<host>.sh and .dbenv_<host>.csh in the home directories of <sapsid>adm and ora<sapsid> using any editor. |
|
Start the ORACLE Universal Installer with the user ora<sapsid>
$ cd /oracle/stage/817_32/Disk1/SAP or /oracle/stage/817_64/Disk1/SAP $ ./RUNINSTALLER
When you start the Universal Installer, a series of windows appears: 1. “File Locations Destination…“ Check that the variable $ORACLE_HOME is correctly set. The relevant directory must be empty! Continue by choosing Next. 2. When you run the Universal Installer for the first time, a dialog box appears. Execute the file /tmp/OraInstall/orainstRoot.sh as user root, and confirm the dialog box by choosing Retry. 3. “Available Product Components“ Confirm the default selections by choosing Next. 4. When the Install step has been completed, a dialog box appears. Execute the file $ORACLE_HOME/root.sh with the user root, and confirm the dialog box by choosing Ok. Then continue by choosing Next. 5. Exit the ORACLE Universal Installer by choosing Exit and then Yes. |
|
Migrating the Database
Checking the oratab Entry The file oratab (located in the directory /var/opt/oracle under Solaris and Reliant UNIX or in /etc under AIX, Digital UNIX and HP-UX, respectively) must contain the following entry: <SAPSID>:<ORACLE_HOME>:N
If this entry does not exist, insert it using a text editor. <$ORACLE_HOME> must refer to the old ORACLE_HOME directory and not to the new one!
Call the Oracle Data Migration Assistant with the user ora<sapsid>: $ ORACLE_HOME/bin/odma
When you start the Oracle Data Migration Assistant, a series of windows appears: 1. “Welcome“ Continue by choosing Next. 2. “Before You Migrate or Upgrade“ Check the requirements and continue by choosing Next. 3. “Select a Database Instance“ Select an instance and continue by choosing Next. 4. “Database Password and INIT.ORA File“ Check the entries and continue by choosing Next. 5. “Choose Migration Type“ Select Default and confirm your selection by choosing Next. 6. “Back Up Your Database“ Confirm this window by choosing Next. 7. “Start the Migration or Upgrade“ Continue by choosing Next and confirm the following dialog box by choosing Yes. 8. Confirm all the status dialog boxes that appear by choosing Ok or Yes. 9. “Finish“ If this step does not appear, continue with the next step. Exception: If the dialog box “listener migration” appears, you must choose No. You may encounter the following error message: An error occurred while upgrading your Oracle database.Check the log files to determine if the upgrade was successful. If you encounter this message, then click the OK-Button and click View Summary in the subsequent box. If the errors are similar to the following, you can ignore the messages: ORA-00604: error occurred at eecursive SQL level 1 ORA-00001: unique constraint (SYSTEM.AQ$_QUEUES_CHECK) violated ORA-06512: at “SYS.DBMS_AQADM”, line 2023 ORA-06512: at line 2 When you have checked the log files, confirm the “Finish” window by choosing Finish. |
|
Calling the post migration scripts
Call the script POSTMIG.SQL by entering: $ cd /oracle/stage/817_32/Disk1/SAP or 817_64/Disk1/SAP $ sqlplus internal > @POSTMIG.SQL |
|
Follow-up Tasks
This section describes what you have to to after having migrated the database:
Copying the File init<SAPSID>.sap Copy the files init<SAPSID>.sap and init<SAPSID>.dba from the old $ORACLE_HOME/dbs directory into the new one by entering: $ cd <old ORACLE_HOME>/dbs $ cp init<SAPSID>.sap $ORACLE_HOME/dbs $ cp init<SAPSID>.dba $ORACLE_HOME/dbs
Modifying the Oracle Initialization Parameters Modify the file $ORACLE_HOME/dbs/init<SAPSID>.ora by changing the parameter: compatible = 8.1.0 If this parameter doesn’t exist yet, insert it accordingly.
Copying *.ora Files Copy files with the extension *.ora from the old $ORACLE_HOME/network/admin directory into the new one by entering: $ cd <old ORACLE_HOME>/network/admin $ cp *.ora $ORACLE_HOME/network/admin
Modifying the File listener.ora In the file listener.ora, change the line ORACLE_HOME = /oracle/<SAPSID> to ORACLE_HOME = /oracle/<SAPSID>/817_32 or 817_64. To make this change, enter: $ cd $ORACLE_HOME/network/admin Then call the text editor by entering # vi listener.ora and change the specified line accordingly.
Checking the Read Authorization of the User <sapsid>adm Make sure that the user <sapsid>adm has a read authorization for the files in the directory $ORACLE_HOME/ocommon/nls/admin/data/* and for the directory $ORACLE_HOME. If this is not the case, enter the following commands with the user ora<sapsid>: $ chmod 755 $ORACLE_HOME/ocommon/nls/admin/data/* $ chmod 755 $ORACLE_HOME
Importing the Current Patchset Log on at the operating system level with the user ora<sapsid>. Refer to Note 362060 for the number of the current patchset and the import instructions.
Starting the Listener Process Log on with the user ora<sapsid> and enter the command: $ ORACLE_HOME/bin/lsnrctl start
Importing Oracle Client Software Import the Oracle client software as described in Note 180430.
Importing the Current SAP Tools You will find the current SAP database administration tools on one of the two ORACLE RDBMS 8.1.7 CDs. 1. Make sure this CD is mounted. 2. Log on with the user <sapsid>adm. 3. Change to the R/3 executable directory by entering: $ cd /usr/sap/<SAPSID>/SYS/exe/run Delete the following old programs: sapdba brarchive brbackup brconnect brrestore brtools Unpack the current programs using the call: $ /<CD-Dir>/UNIX/<OS>/SAPCAR -xvf /<CD-Dir>/UNIX/<OS>/DBATOOLS.SAR 4. Change the authorization for all programs except brrestore by entering: $ su root # chown ora<sapsid> sapdba brarchive brbackup # chown ora<sapsid> brconnect brtools # chmod 775 sapdba brarchive brbackup brconnect brtools # exit
Oracle version 8.1.7 is now installed on your database. |
EXPORTING SOURCE SYSTEM |
|
|
Extracting Installation Tools (user: root)
Create an empty directory e.g. /tmp/inst (min. 50 MB freespace) # cd <instdir> # /<kernelcd_patch>/UNIX/INSTTOOL.SH |
|
Stop R3 System During Export
You have to stop R3 System during Export. Run the following command with <sid>adm user; $ stopsap r3 |
|
Start Export Process (user: root)
# cd <instdir> # ./R3SETUP -f DBEXPORT.R3S |
|
Eliminate Export Errors
ERROR1: During export of APPL0, you may get errors for table J_1SMAHNST.
SOLUTION1: Delete the Entries for table J_1SMAHNST in files /<instdir>/SAPAPPL0.EXT /<instdir>/SAPAPPL0.SRT /<exportdir>/DATA/SAPAPPL0.SRT
After migration finished, you will transport this table by request.
ERROR2: If you encounter errors with SAPSSEXC, check the SAPSSEXC.log file if the following lines exists; (EXP) ERROR: DbSlExeRead: rc = 103, table “MACOB” (SQL error 1406) error message returned by DbSl: ORA-01406: fetched column value was truncated
SOLUTION2: Oss note 120601 solves the problem. Edit the file /<instdir>/SAPSSEXC.STR and change the following values;
1. Change MCIDESC value from 4000 to 5000 for MACID. 2. Change MCODESC value from 15000 to 16000 for MACOB. |
IMPORT INTO TARGET SYSTEM
PREPARATIONS |
|
|
Minimum Required Packages for SAP during RedHat Enterprise Installation
|
Check glibc and Kernel Version for certification
[root@msapdb root]# rpm -qa glibc glibc-2.3.2-95.20 [root@msapdb root]# uname -a Linux msapdb 2.4.21-15.ELsmp #1 SMP Thu Apr 22 00:18:24 EDT 2004 i686 i686 i386 GNU/Linux |
|
|
Install Certified glibc
download certified glibc version from ftp://ftp.redhat.de
[root@msapdb glibc-2.3.2-95.6]# ls glibc-2.3.2-95.6.i686.rpm glibc-devel-2.3.2-95.6.i386.rpm glibc-utils-2.3.2-95.6.i386.rpm SRPMS glibc-common-2.3.2-95.6.i386.rpm glibc-headers-2.3.2-95.6.i386.rpm nptl-devel-2.3.2-95.6.i686.rpm glibc-debug-2.3.2-95.6.i386.rpm glibc-profile-2.3.2-95.6.i386.rpm nscd-2.3.2-95.6.i386.rpm
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-common-2.3.2-95.6.i386.rpm –nodeps warning: glibc-common-2.3.2-95.6.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:glibc-common ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-2.3.2-95.6.i686.rpm warning: glibc-2.3.2-95.6.i686.rpm: V3 DSA signature: NOKEY, key ID db42a60e error: Failed dependencies: glibc = 2.3.2-95.20 is needed by (installed) glibc-utils-2.3.2-95.20
[root@msapdb glibc-2.3.2-95.6]# rpm -e glibc-debug glibc-utils nptl-devel error: package glibc-debug is not installed
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-2.3.2-95.6.i686.rpm warning: glibc-2.3.2-95.6.i686.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:glibc ########################################### [100%] Stopping sshd:[ OK ] Starting sshd:[ OK ]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-devel-2.3.2-95.6.i386.rpm warning: glibc-devel-2.3.2-95.6.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:glibc-devel ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-debug-2.3.2-95.6.i386.rpm warning: glibc-debug-2.3.2-95.6.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:glibc-debug ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-headers-2.3.2-95.6.i386.rpm warning: glibc-headers-2.3.2-95.6.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:glibc-headers ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-profile-2.3.2-95.6.i386.rpm warning: glibc-profile-2.3.2-95.6.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:glibc-profile ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force glibc-utils-2.3.2-95.6.i386.rpm warning: glibc-utils-2.3.2-95.6.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:glibc-utils ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force nptl-devel-2.3.2-95.6.i686.rpm warning: nptl-devel-2.3.2-95.6.i686.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:nptl-devel ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -Uvh –force nscd-2.3.2-95.6.i386.rpm warning: nscd-2.3.2-95.6.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing… ########################################### [100%] 1:nscd ########################################### [100%]
[root@msapdb glibc-2.3.2-95.6]# rpm -qa glibc glibc-2.3.2-95.6 [root@msapdb inst]# rpm -Uvh –force /work/saplocales-2.3.2-1.i386.rpm Preparing… ########################################### [100%] 1:saplocales ########################################### [100%] Adding /usr/lib/locale/tr_TR.ISO-8859-9 Stopping sshd:[ OK ] Starting sshd:[ OK ] [root@msapdb inst]# |
|
Adjust Linux Kernel Parameters
Some Linux kernel parameters have to be adjusted to meet the requirements of mySAP software.
To do this append the following lines to /etc/sysctl.conf as follows (or change them accordingly): # SAP settings kernel.shmmax=2313682943 kernel.msgmni=1024 kernel.sem=1250 256000 100 1024 fs.file-max=8192
Activate these settings with the command # sysctl -p |
|
Create Necessary Directories
# mkdir -p /usr/sap/trans # mkdir -p /oracle/SBP/920_32 # mkdir -p /oracle/client/92x_32 |
|
Setting Environment for Installation
# export LD_LIBRARY_PATH=/oracle/client/92x_32/lib:/sapmnt/<SID>/exe |
|
Start Installation Start installation with user root;
# mkdir <instdir> # cd <instdir> # /<cddir>/UNIX/INSTTOOL.SH # ./R3SETUP -f CENTRAL.R3S
During installation select “database migration of file system” as next installation. Continue with installation CENTRL.R3S and DBMIG.R3S until you reached Oracle Software Installation Step. |
ORACLE 9.2.x SOFTWARE and PATCH INSTALLATION |
|
|
Give Password to ora<sid>
# passwd ora<sid> |
|
Relinking gcc
Relink gcc so that the older gcc will be used during the Oracle installation (see Oracle Note:252217.1 for more information):
# mv /usr/bin/gcc /usr/bin/gcc323 # mv /usr/bin/g++ /usr/bin/g++323 # ln -sf /usr/bin/gcc296 /usr/bin/gcc # ln -sf /usr/bin/g++296 /usr/bin/g++ |
|
Starting XWindows
login system with ora<sid> user and start XWindows with # xstart command. |
|
Setting Environment
$ export LD_ASSUME_KERNEL=2.4.1 # for ora<sid> user |
|
Starting Oracle Universal Installer
run the following commands with ora<sid> user;
$ cd /oracle/stage/920_32/Disk1/SAP $ ./RUNINSTALLER
If you get the following error during execution of RUNINSTALLER;
Error occurred during initialization of VM Unable to load native library: /tmp/OraInstall2003-10-25_03-14-57PM/jre/lib/i386/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
You have to apply Patch for Oracle bug 3006854. download the patch p3006854_9205_LINUX.zip from http://metalink.oracle.com/ and apply as follow; $ su – root # cd 3006854 Then start RUNINSTALLER again.
This installer is preconfigured by SAP, so install with default settings. |
|
Solving Relinking Errors
Following errors are expected during Oracle Relinking.
ERROR1: Error in invoking target install of makefile /opt/oracle/product/9.2.0/network/lib/ins_oemagent.mk.
SOLUTION1: Click ignore. This will be fixed by applying the patch 3119415 after the 9.2.0.5 patchset has been applied. You won’t be able to apply the patch 3119415 at this time since the file /opt/oracle/oraInventory/ContentsXML/comps.xml doesn’t exist yet.
ERROR2: Error in invoking target install of makefile /opt/oracle/product/9.2.0/ctx/lib/ins_ctx.mk.
SOLUTION2: Click ignore. This is fixed by applying the 9.2.0.5 patchset. |
|
Install Oracle 9.2.0.5 Patch
1. Copy the file with extension .cpio under LINUX_32 directory of Oracle Patch CD into a directory. 2. run the following command with user ora<sid> to extract the patch $ cpio -idmv < 9204_lnx32_release.cpio Disk1/stage/locks Disk1/stage/Patches/oracle.apache.isqlplus/9.2.0.4.0/1/DataFiles/bin.1.1.jar Disk1/stage/Patches/oracle.apache.isqlplus/9.2.0.4.0/1/DataFiles/lib.1.1.jar … 3. change directory to Disk1 with ora<sid> user. 4. Change the environment before applying patch. $ export $LD_ASSUME_KERNEL=2.4.1 5. You have to Update Oracle Universal Installer first to be able to apply patch. $ cd /<path>/Disk1/ – Welcome Screen: Click Next 6. To apply Oracle 9.2.0.5 patch; $ cd $ORACLE_HOME/bin – Welcome Screen: Click Next If you get the following error during relinking;
Error in invoking target install of makefile /opt/oracle/product/9.2.0/network/lib/ins_oemagent.mk.
Select “Ignore” and continue installation. |
|
Applying Oracle Patch 3119415
After the 9.2.0.4 patchset has been applied, download the patch p3119415_9204_LINUX.zip from http://metalink.oracle.com/. See bug 3119415 for more information. Also, download the opatch Release 2.2.0 utility from http://metalink.oracle.com/. See bug 2617419 for more information.
To install opatch, run: # su – oracle $ cp p2617419_210_GENERIC.zip /tmp $ cd /tmp $ unzip p2617419_210_GENERIC.zip $ cp -rf OPatch $ORACLE_HOME/. Before you apply the 3119415 patch, you need to make sure the fuser binary can be found by the oracle user, see the PATH environment variable below. Otherwise the patch can’t be applied because the fuser binary is used by opatch.
To apply the 3119415 patch, run; # su – oracle $ unzip p3119415_9204_LINUX.zip $ cd 3119415 $ export PATH=$PATH:$ORACLE_HOME/OPatch $ export PATH=$PATH:/sbin # the patch needs “fuser” which is located in /sbin $ which opatch /oracle/<SID>/920_32/OPatch/opatch $ opatch apply |
CONTINUE INSTALLATION |
|
|
Preparing a New DBSIZE.TPL
1. Get the latest status of Tablespace sizes from Source System. 2. Edit the file DBSIZE.TPL which is under <exportcd_dir>/DB/ORA/ so that tablespaces are created same size with source system. 3. Copy the DBSIZE.TPL file into installation directory. |
|
Continue Installation…
You left the installation right before Oracle Software installation. Now goto installation directory and start installation again with root; # ./R3SETUP -f DBMIG.R3S |
|
Eliminating Import Errors
ERROR1: If you get errors during import for SAPSSEXC, check log file SAPSSEXC.log. If last lines of log says that MACID~0 Primary index cannot be created because of duplicate records solution is;
SOLUTION1: 1. # su – ora<sid> $ sqlplus “/as sysdba” SQLPLUS> delete from sapr3.MACID; SQLPLUS> commit;
2. After migration finished, export the content of table MACID by means of Request or R3trans file and import into Target System. MACID table is a Client-Independant Table.
ERROR2: You will get Error during Import Check Phase (DBDDLOADDCHECK_XT_IND_ORA) bacause of table J_1SMAHNST.
SOLUTION2: 1. Edit the file DBMIG.R3S and set STATUS=OK under section DBDDLOADDCHECK_XT_IND_ORA. 2. After migration finished, export the table structure and content from source system and then import into target system. |
POST-PROCESSING |
|
|