PUBLIC
Database Upgrade Guide
Upgrade to Oracle Database 10g Release 2 (10.2): UNIX Target Audience
n Technology Consultants n System Administrators Document version: 2.11 ‒ 02/21/2007
Document History
Caution
Before you start the implementation, make sure you have the latest version of this document. You can find the latest version at the following location: service.sap.com/instguides Other Documentation Database Upgrades Oracle The following table provides an overview of the most important document changes. Version
Date
Description
2.11
2/21/2007
Error correction in section Disabling Database User Locking Mechanism For Failed Logins: command line connect / as sysdba inserted
2.1
8/28/2006
Various changes including new section Disabling Database User Locking Mechanism for Failed Logins
2.0
8/1/2006
Various changes including new section Installing Oracle Critical Patch Updates
2/50
PUBLIC
02/21/2007
Table of Contents
Chapter 1 1.1 1.2 1.3
Introduction . . . . . . . . . . . . New Features . . . . . . . . . . . . . SAP Notes for the Upgrade . . . . . . . . More Information on SAP Service Marketplace
. . . .
. . . .
. . . .
. . . .
. . . .
5 6 6 8
Chapter 2 2.1 2.2 2.3 2.4
Planning . . . . . . . . . . . . . . . . . . . . . Checking the Original Version of Your Database . . . . . . . Checking Hardware and Software Requirements . . . . . . . Reviewing the Oracle-Specified Kernel Parameters and Shell Limits Checking Additional Requirements for the Upgrade . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
9 9 10 11 11
Chapter 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10
Preparation . . . . . . . . . . . . . . . . . . . Checking the Correct UNIX Users, Groups, and Authorizations Checking the Directory Structure . . . . . . . . . . . Running the Pre-Upgrade Script . . . . . . . . . . . . Checking the Prerequisites for the Oracle Universal Installer . . Checking the SAP System Prerequisites . . . . . . . . . Migrating to Automatic Undo Management . . . . . . . Stopping Statspack Reports . . . . . . . . . . . . . . Checking the SYSTEM and SYSAUX Tablespace for Freespace . Checking for Invalid Database Objects . . . . . . . . . . Installing the Oracle Instant Client . . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
13 13 14 15 16 17 18 18 19 20 20
Chapter 4 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2
Oracle Database Upgrade . . . . . . . . . . . Database Software Installation . . . . . . . . . . . Checking and Setting the Environment Variables . . . . Backing Up the Oracle Inventory . . . . . . . . . . Performing Steps for the AIX Operating System . . . . Running the Oracle Universal Installer . . . . . . . Installing the Current Patch Set . . . . . . . . . . Installing Required Interim Patches . . . . . . . . . Copying and Adapting the SQL*Net Files . . . . . . . Backing Up the Oracle Database . . . . . . . . . . Shutting Down the SAP System and Oracle Listener Process Database Structure Upgrade . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
21 21 22 24 24 25 26 27 28 28 29 29
02/21/2007
PUBLIC
. . . .
. . . .
. . . .
. . . .
. . . .
. . . . . . . . . . . .
. . . .
. . . . . . . . . . . .
3/50
4.2.1 4.2.2
Checking the oratab Entry . . . . . . . . . . . . . . . . . . . Starting the Database Upgrade Assistant . . . . . . . . . . . . . .
30 30
Chapter 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 5.13 5.14 5.15 5.16
Post-Upgrade Steps . . . . . . . . . . . . . . . . . . Finalizing the Environment of the ora
User . . . . . . . Checking the Upgraded Database . . . . . . . . . . . . . Updating BR*Tools . . . . . . . . . . . . . . . . . . . Backing Up the Database . . . . . . . . . . . . . . . . . Performing Post-Upgrade Tasks . . . . . . . . . . . . . . Installing Oracle Critical Patch Updates . . . . . . . . . . . Checking the oratab entry . . . . . . . . . . . . . . . . Starting the Listener Process . . . . . . . . . . . . . . . Renaming the Old $ORACLE_HOME/bin Directory . . . . . . Checking the Read Authorization of the <sapsid>adm User . . . Changing the Environment for the <sapsid>adm user . . . . . . Checking SAP Profile Parameters . . . . . . . . . . . . . . Changing the Location of the JDBC Driver . . . . . . . . . . Starting the SAP System . . . . . . . . . . . . . . . . . Disabling Database User Locking Mechanism For Failed Logins . . . Configuring the New Features for Oracle Database 10g Release 2 (10.2)
33 33 34 35 36 36 38 39 39 40 40 40 41 41 44 44 44
4/50
PUBLIC
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
02/21/2007
1
Introduction
1 Introduction
This documentation explains how to upgrade the Oracle database for the SAP system on the UNIX operating system: n From Oracle version 9.2.0 or Oracle Database 10g Release 1 (10.1.0.4) n To Oracle Database 10g Release 2 (10.2) Caution
SAP certifies Oracle 10.2 only from release 10.2.0.2. SAP does not certify nor support Oracle 10.2.0.1. Make sure that your target release is Oracle 10.2.0.2 or later. This documentation only covers the upgrade from Oracle 9.2.0.4 or later ‒ including Oracle 10.1.0.4 ‒ to Oracle Database 10g Release 2 (10.2). Note
Oracle offers and supports direct database upgrades from Oracle 8.1.7 to Oracle 10.2, but SAP does not recommend this. We do not describe direct upgrades in this documentation. SAP has not tested and validated the direct upgrade path from Oracle 8.1.7 to Oracle 10.2. If you intend to perform a direct upgrade from Oracle 8.1.7 to Oracle 10.2, see the Oracle Database 10g Release 2 (10.2) upgrade documentation. You can obtain the Oracle documentation after registering at the Oracle Technology Network (OTN) website, www.oracle.com/technology. You use the tools Oracle Universal Installer (OUI), Oracle SQL*Plus, and Oracle Database Upgrade Assistant (DBUA) to perform the upgrade. Caution
Make sure you have the latest version of this document. You can always find this as follows: service.sap.com/instguides Other Documentation Database Upgrades Oracle .
02/21/2007
PUBLIC
5/50
1 1.1
Introduction New Features
Note
In this document we use for the database instance identifier and <SAPSID> for the SAP system identifier. These can be different if your: n Database system uses Oracle Real Application Cluster (RAC) n SAP system uses Multiple Components in One Database (MCOD) Implementation Considerations Implementation Considerations
n For more information on implementation considerations, including the most important SAP Notes for the upgrade, see Planning [page 9]. n Be sure to read the relevant SAP Notes before beginning the upgrade. These notes contain the most recent information about the upgrade, as well as corrections to the documentation. You can find the most recent version of the SAP Notes: service.sap.com/notes
n Make sure you are using the Oracle Universal Installer (OUI) shipped with the installation CDs for Oracle Database 10g Release 2 (10.2).
1.1 New Features For the complete list of new features of the Oracle Database 10g Release 2 (10.2), see the New Features documentation from Oracle. You can access the complete Oracle documentation as a member of the Oracle Technology Network (OTN) at: www.oracle.com/documentation
For more information on joining OTN, see: www.oracle.com/technology
Recommendation
We recommend that you check the most important new features in the Oracle documentation since some new features might affect the operation of your production system.
1.2 SAP Notes for the Upgrade Make sure that you read the following SAP Notes, which you can find at service.sap.com/notes:
6/50
PUBLIC
02/21/2007
1 1.2
Introduction SAP Notes for the Upgrade
Number
Title
Remarks
819830
Oracle Database 10g: Additional Information on upgrade: UNIX
Required late-breaking information
720886
Oracle Database 10g: Integration into the SAP environment
Provides information about integration of Oracle Database 10g products / options within SAP
828268
Oracle Database 10g: New Functions
Provides information about the Oracle Database 10g features which can be used within an SAP environment. Also contains links to notes describing the procedure to activate some of the new Oracle Database 10g features.
830576
Oracle Database 10g: Default / Obsolete Parameters
Provides information about Oracle initialization parameters which need to be reset to their default values or which need to be removed
841728
Oracle Database 10g: Software Installation Problems
Describes known software installation problems and solutions or workarounds
871735
Oracle Database 10g: Current Patch Set
Describes the current Oracle patch set
871096
Oracle Database 10g: Patch Sets and Patches
Lists the status of Oracle patch sets and interim patches for 10.2
850306
Oracle Critical Patch Update Program
Describes the current Oracle security fixes
134592
Update SAPDBA Role
Describes how to update the SAPDBA role after the upgrade
834917
SAPCONN Role
Describes the new SAPCONN role, which replaces the native CONNECT role from Oracle
819829
Installation of Oracle 10.x Client software
Required for upgrading Oracle client software to Oracle Database 10g Release 2 (10.2)
839182
Oracle Database 10g: OPatch
Describes how to use OPatch with Oracle Database 10g Release 2 (10.2)
02/21/2007
PUBLIC
7/50
1 1.3
Introduction More Information on SAP Service Marketplace
Number
Title
Remarks
306408
OPatch Patch Installation
Describes how to install an interim patch (this was previously called a one-off patch)
868681
Oracle Database 10g: Database release check
Describes some additional transports to be applied to SAP systems 640 and below before upgrade to Oracle database 10g
1.3 More Information on SAP Service Marketplace You can find more information as following on SAP Service Marketplace: Description
SAP Notes Oracle Database Administration
Internet Address
Oracle Database Upgrade Guide (that is, the guide you are now reading)
8/50
None
service.sap.com/notes service.sap.com/dbaora
Library SAP Software Distribution Center
Title
Media SAP Database Guide: Oracle
General
service.sap.com/swdc
None
service.sap.com/insguides
Upgrade to Oracle Database : UNIX
Other Documentation Upgrades Oracle
Database
PUBLIC
02/21/2007
2
Planning
2 Planning
1. 2. 3. 4.
You check the original version of your database [page 9]. You check the hardware and software requirements [page 10]. You review the Oracle-specified kernel parameters and shell limits [page 11]. You check additional requirements for the upgrade [page 11].
2.1 Checking the Original Version of Your Database You need to check the original version of the database you want to upgrade. Caution
This SAP upgrade documentation only covers the standard upgrade from Oracle 9.2.0.4 or later to Oracle Database 10g Release 2 (10.2) using the Oracle Database Upgrade Assistant (DBUA). Process
In the following special cases you need to get more information: n If you are upgrading from Oracle 8.1.7 or an earlier release, read the Oracle Database 10g Release 2 (10.2) upgrade documentation for information on the special steps required. Although Oracle supports direct upgrades from Oracle 8.1.7 to Oracle 10.2.0, SAP recommends customers running Oracle 8.1.7 to first upgrade to Oracle 9.2.0 and then to Oracle 10.2.0. n If you are upgrading from Oracle 9.2.0 to Oracle Database 10g Release 2 (10.2) in manual mode. n If the source database runs Oracle 9.2.0.3, 9.2.0.2, or 9.2.0.1, you need to update the source database to patchset 9.2.0.4 or later. The DBUA checks for the source release of the Oracle 9.2 database. If the source database runs on a lower version than Oracle 9.2.0.4 you cannot proceed. For more information in these special cases, see the Oracle Database 10g Release 2 (10.2) upgrade documentation at: www.oracle.com/technology/documentation
Select the appropriate documentation for Oracle Database 10g Release 2 (10.2). Recommendation
If the source database is Oracle 10.1 we strongly recommend that it is at least version Oracle 10.1.0.4.
02/21/2007
PUBLIC
9/50
2 2.2
Planning Checking Hardware and Software Requirements
2.2 Checking Hardware and Software Requirements You need to check that you meet the hardware and software requirements for running the new Oracle release. The complete list of hardware and software requirements for every platform is included in the Oracle documentation. Caution
To make sure that the checks complete successfully, you must complete this procedure before running the Oracle Universal Installer [page 25]. Prerequisites
You can access the complete Oracle documentation referred to below as a member of the Oracle Technology Network (OTN) at: www.oracle.com/documentation
For more information on joining OTN, see: www.oracle.com/technology
Procedure
1. Note the following general hardware requirements: n At least 1024 MB of physical RAM n About 500 MB free space in the /tmp directory n Between 2 GB and 3.5 GB of disk space for the Oracle software 2. Check that your operating system meets the software requirements for running the new Oracle release, including all required patches. You might need to upgrade your operating system before you start. The complete list of software requirements for every operating system is included in the Oracle documentation. Recommendation
If you have access to Oracle Metalink we strongly recommend that you read document 169706.1. This document provides information on all operating system prerequisites and is regularly updated. 3. Get the full and updated list of hardware and software requirements from the relevant Oracle database installation guide for your operating system, which you can find at one of the following: www.oracle.com/technology/documentation
Select the appropriate documentation for Oracle Database 10g Release 2 (10.2).
10/50
PUBLIC
02/21/2007
2 2.3
Planning Reviewing the Oracle-Specified Kernel Parameters and Shell Limits
Caution
If your database resides on Network Attached Storage (NAS) you need to review and implement the Oracle NAS guidelines. You need to mount network file systems with specific mount options, which you can find in the Oracle installation guide.
2.3 Reviewing the Oracle-Specified Kernel Parameters and Shell Limits You need to review the Oracle-recommended kernel parameters and shell limits for your operating system with Oracle Database 10g Release 2 (10.2). These are only recommendations from Oracle for optimizing the system performance in production environments. If the recommended settings are not suitable for your system you must tune the kernel parameters accordingly. Procedure
Get the recommended shell limits and kernel parameters from the relevant Oracle database installation guide for your operating system, which you can find at: www.oracle.com/technology/documentation
Select the appropriate documentation for Oracle Database 10g Release 2 (10.2).
2.4 Checking Additional Requirements for the Upgrade You need to check the additional requirements for the Oracle database upgrade as described in this section. Procedure
1. Make sure you have read the SAP Notes for the upgrade [page 6], which you can find at service.sap.com/notes: 2. Make sure your operating system and initial database version meets SAP requirements. We approve specific combinations of operating system version, database version, SAP Release, and SAP kernel release: n SAP Release 4.6x, see SAP Note 156548 n SAP Release 6.x, see SAP Note 407314 3. To upgrade from a remote PC, you need X-Windows software on the PC, as described in SAP Note 432861.
02/21/2007
PUBLIC
11/50
2 2.4
Planning Checking Additional Requirements for the Upgrade
Recommendation
In some situations the OUI and DBUA screens are not displayed correctly when invoked remotely. In such cases we recommend you to start the OUI and the DBUA directly from the console. 4. Get the Oracle Database 10g Release 2 (10.2) installation guide for your operating system from the Oracle Technology Network at: www.oracle.com/technology
You need this document to review the hardware and software requirements and to configure the kernel parameters and shell limits. Recommendation
If you have access to Oracle Metalink we strongly recommend that you read document 169706.1. This document provides information on all operating system prerequisites and is regularly updated. 5. Get the Oracle Database 10g Release 2 (10.2) software and the latest patch sets and required patches. The list of one-off patches is described in SAP Note 871096. You can download the patches from SAP Service Marketplace at: service.sap.com/swcenter-3pmain
Caution
n The one-off patches listed in SAP Note 871096 are mandatory. To avoid severe database problems, make sure that you install all these one-off patches. n SAP certifies Oracle 10.2 only from release 10.2.0.2. SAP does not certify nor support Oracle 10.2.0.1. Make sure that your target release is Oracle 10.2.0.2 or later. 6. Get the latest version of the Oracle 10.2 Instant Client software from SAP Service Marketplace at: service.sap.com/swcenter-3pmain
7. Get the latest version of the DBATOOLS (BR*Tools) Release 7.00 to be used immediately after the database upgrade from SAP Service Marketplace at: service.sap.com/swdc
12/50
PUBLIC
02/21/2007
3
Preparation
3 Preparation
Note
You have already planned the database upgrade [page 9]. You have to complete the following preparations: 1. You check the correct UNIX users, groups, and authorizations [page 13]. 2. You check the directory structure [page 14]. 3. You run the pre-upgrade script [page 15]. 4. You check the prerequisites for the Oracle Universal Installer [page 16]. 5. You check the SAP System prerequisites [page 17]. 6. If required, you migrate to automatic undo management [page 18]. 7. If required, you stop Statspack reports [page 18]. 8. You check the SYSTEM and SYSAUX tablespace for freespace [page 19]. 9. If required, you check for invalid database objects [page 20]. 10. You install the Oracle Instant Client [page 20].
3.1 Checking the Correct UNIX Users, Groups, and Authorizations You need to check that the ora user has write authorization for the /oracle directory, since the ora user performs the database installation. Procedure
1. Enter the following commands: touch /oracle/write_test rm /oracle/write_test
If the user ora does not have write authorization, log on to your system with the user root and enter the command: chgrp dba /oracle chmod 775 /oracle
Check if you are able to start an Xterm as the Oracle user since this is the user who invokes the OUI. 2. Enter the following command with the user ora: umask 022
02/21/2007
PUBLIC
13/50
3 3.2
Preparation Checking the Directory Structure
3.2 Checking the Directory Structure You need to verify the availability and correctness of the following Oracle directories: n stage directory n Oracle inventory directory n Home directory Procedure
1. Check the Oracle stage directory, usually called /oracle/stage. If this directory does not exist, create it manually. If it already exists it might contain software stages from previous installations or upgrades. a) For the upgrade to Oracle Database 10g Release 2 (10.2) create the staging directory /oracle/stage/102_64. b) Make sure that you have around 2 GB free space for the SAR files. To extract all RDBMS SAR files requires around 5 GB of free space in the staging directory but for this upgrade you only require the SAR file containing the database component, which is contained in OR110264.SAR for 64-bit platforms or OR110232.SAR for 32-bit platforms. If there is not enough space you can delete previous stage directories. c) When the RDBMS CDs have been mounted, use the SAP tool SAPCAR to extract all the RDBMS CDs to /oracle/stage/102_64 as user ora<sid>. For example, the following command extracts one CD: SAPCAR –xvf OR110264.SAR
After you have finished the extraction of all the RDBMS CDs, the following sub-directories exist under /oracle/stage/102_64: n database n client n clusterware n companion n gateways Note
For some platforms Disk1 and Disk2 might be created as sub-directories of database, client, clusterware, companion, and gateways. The gateways sub-directory is not created for the following platforms: n Linux on Power n HP_UX on Itanium n Solaris x86_64 d) After extraction of the Oracle software to /oracle/stage/102_64 do the following: A) Rename the original SAP folder by performing one of the following:
14/50
PUBLIC
02/21/2007
3 3.3
Preparation Running the Pre-Upgrade Script
n
mv /oracle/stage/102_64/database/SAP /oracle/stage/102_64/database/SAP_ORIG
n
mv /oracle/stage/102_64/database//Disk1/SAP /oracle/stage/102_64/database//Disk1/SAP_ORIG
B) Download the file RDBMS_SAP_32.zip (for 32-bit platforms) or RDBMS_SAP_64.zip (for 64-bit platforms) attached to SAP Note 819830 and copy it to a temporary location such as /tmp. C) Extract the zip file by performing one of the following: n cd /oracle/stage/102_64/database unzip /tmp/RDBMS_SAP.zip
n
cd /oracle/stage/102_64/database/Disk1 unzip /tmp/RDBMS_SAP.zip
You should now see the directory SAP extracted with the updated version of SAP-specific files. 2. Check the Oracle inventory directory. The Oracle inventory directory maintains the inventory of all Oracle software installed on the system. The path to the Oracle inventory directory is mentioned in the file oraInst.loc, which you can find under /var/opt/oracle or under /etc. One of the entries of oraInst.loc or inventory_location points to the location of the Oracle inventory. When you execute the OUI for the first time on the system, the OUI prompts you for the path to the inventory directory. The default location for the Oracle inventory is $ORACLE_BASE/oraInventory. Note
This applies only to systems where the OUI has been executed for the first time. The OUI automatically creates theoraInst.loc and the inventory directory. You do not need to create these directories manually. 3. Create the empty Oracle home directory before starting the OUI. You need to create the Oracle home directory before you can start the Oracle software installation. The Oracle Home directory is normally /oracle//102_64.
3.3 Running the Pre-Upgrade Script You run the Oracle pre-upgrade information tool. This tool provides information on the existing pre-upgrade database. It also suggests any changes that you need to make before you start the upgrade. Note
You always execute this script as the ora user connected to the database as sysdba in the Oracle 9i environment.
02/21/2007
PUBLIC
15/50
3 3.4
Preparation Checking the Prerequisites for the Oracle Universal Installer
Prerequisites
You are logged on as user ora in the Oracle 9i environment with the database also started up. Procedure
Execute the following commands: sqlplus /nolog SQL> connect / as sysdba SQL> spool /tmp/pre_upgrade.log SQL> @/oracle/stage/102_64/database/SAP/utlu102i.sql
or: SQL> @/oracle/stage/102_64/database/Disk1/SAP/utlu102i.sql SQL> spool off SQL> exit
Result
You can check the results of the pre-upgrade script by looking at the log file /tmp/pre_upgrade.log. Caution
Make the changes listed in the log file, otherwise you might have problems during the upgrade.
3.4 Checking the Prerequisites for the Oracle Universal Installer You must check the prerequisites for the Oracle Universal Installer (OUI). Procedure
1. Log in as the Oracle user ora. 2. Execute the following commands: n 32-bit platforms: cd /oracle/stage/102_32/database ./runInstaller –executeSysPrereqs
n 64-bit platforms, one of the following: l cd /oracle/stage/102_64/database ./runInstaller –executeSysPrereqs
l
cd /oracle/stage/102_64/database/Disk1 ./runInstaller –executeSysPrereqs
If the OUI complains that the operating system version is not certified or supported, you can ignore this. If OUI reports missing OS patches, you need to apply these before you can continue.
16/50
PUBLIC
02/21/2007
3 3.5
Preparation Checking the SAP System Prerequisites
3.5 Checking the SAP System Prerequisites You must check the prerequisites for the SAP system (ABAP) release 6.40 and lower. You need to: 1. Update the database library (dbsl) to the latest patch level 2. Apply a correction to the ABAP system This is necessary to make the SAP system compatible for the Oracle Database 10g release checks. 3. If the SAP kernel uses the Oracle 9.2 client software (this is the case if you use the 640 or EXT kernels), you also need to update the Oracle client software to at least release 9.2.0.7. If you do not update the Oracle 9.2 client software you might get core dumps in the SAP system after the upgrade to Oracle Database 10g. 4. You need to execute an SQL script that creates a new role on the database. This is necessary due to changes to the Oracle CONNECT role in Oracle 10.2. 5. You must upgrade Java systems to at least Service Pack 13 before you can upgrade to Oracle Database 10g. Procedure
1. Download the latest version of dbsl (dboraslib.so, dboraslib.sl, or dboraslib.o) for your release from the SAP Service Marketplace at: service.sap.com/swdc
2. Check the level of your Basis support package using this table: SAP Release (SAP_BASIS)
Basis Support Package Level
46B
SAPKB46B57
46C
SAPKB46C48
46D
SAPKB46D38
6.10
SAPKB61041
6.20
SAPKB62044
6.40
SAPKB64009
n If the level of your Basis support package is higher than or equal to that shown above, no additional corrections are necessary. n If the level of your Basis support Package is lower than the one shown in the table above, you need to apply an additional transport correction to your system as described in SAP Note 868681. 3. Download the latest version of the Oracle Client software ‒ OCL92064.SAR or OCL92032.SAR ‒ from SAP Service Marketplace at: service.sap.com/swcenter-3pmain
This is described in SAP Note 886783.
02/21/2007
PUBLIC
17/50
3 3.6
Preparation Migrating to Automatic Undo Management
Make sure that you install the newest version of the Oracle client software on all application servers, including the database server if there is an SAP application running on the database server. Note
If you cannot update the client software because there are several other application servers running on the same host, see SAP Note 964783. 4. Execute the SQL script sapconn_role.sql as follows: cp /oracle/stage/102_64/database/SAP/sapconn_role.sql $ORACLE_HOME/dbs
or: cp /oracle/stage/102_64/database/Disk1/SAP/sapconn_role.sql $ORACLE_HOME/dbs cd $ORACLE_HOME/dbs sqlplus /nolog @sapconn_role
3.6 Migrating to Automatic Undo Management This step is only relevant if your database still uses manual undo management (rollback tablespace and rollback segments). If your database still uses rollback segments for undo management we strongly recommend you to migrate to automatic undo management before starting the database update to Oracle database 10g. Otherwise you might run into errors. Procedure
1. Read SAP Note 600141, which is the central note describing automatic undo management. This note also gives you an overview of the concepts involved. 2. Follow the step-by-step instructions in the note to migrate to automatic undo management.
3.7 Stopping Statspack Reports This step deletes the Statspack jobs with DBMS_JOB.REMOVE. Prerequisites
This step is only relevant if the Statspack package has been activated on the database for monitoring purposes. For more information on Statspack, see SAP Note 717484. Procedure
1. Log on as the user under which the statspack jobs run (usually PERFSTAT): SQL> connect PERFSTAT/
18/50
PUBLIC
02/21/2007
3 3.8
Preparation Checking the SYSTEM and SYSAUX Tablespace for Freespace SQL> select job, what from user_jobs;
This displays a list of the jobs that are currently entered under the user PERFSTAT. 2. Delete all jobs with the print job number <jobnr>: SQL> connect PERFSTAT/ SQL> execute dbms_job.remove( <jobnr> );
3.8 Checking the SYSTEM and SYSAUX Tablespace for Freespace You need to make sure that the SYSTEM and SYSAUX tablespaces have at least 750 MB freespace. This is necessary due to a bug in the Oracle database that can cause the Oracle Database Upgrade Assistant (DBUA) to underestimate the required freespace. Note
The SYSAUX tablespace is available only if the source database is already Oracle 10.1. If your source database is Oracle 9.2, there is no SYSAUX tablespace. In this case you can ignore references to the SYSAUX tablespace in this section. Procedure
Check if the SYSTEM or SYSAUX tablespace have enough freespace. You can check this by executing one of the following commands as the ora user: n n
brspace –f dbshow –c tsinfo –s SYSTEM brspace –f dbshow –c tsinfo –s SYSAUX
If the free space is less than 750 MB, use your preferred database administration tool to increase the size by using one of the following options: n Setting the AUTOEXTEND option for the existing datafile to ON. n Adding an additional datafile. n Resizing the existing datafile. Note
For systems that use raw devices for the datafiles, the AUTOEXTEND option might not work because of the fixed size of the raw devices. In this case you might need to add another datafile by adding a new volume or partition on the operating system.
02/21/2007
PUBLIC
19/50
3 3.9
Preparation Checking for Invalid Database Objects
3.9 Checking for Invalid Database Objects This optional step lets you check if there are any invalid database objects before the database upgrade to Oracle database 10g starts. After the upgrade it helps you distinguish database objects that have become invalid due to the upgrade process from those that were already invalid to start with. Procedure
1. Execute the following commands: SQL> spool invalid_objects SQL> select unique object_name, object_type, owner from dba_objects where status = 'INVALID'; SQL> @?/rdbms/admin/utlrp.sql SQL> select unique object_name, object_type, owner from dba_objects where status = 'INVALID'; SQL> spool off
A list of invalid objects before the upgrade is now generated. 2. Check the list of invalid objects after the upgrade. If any objects in the list from before the upgrade are also in the list of invalid objects after the upgrade, you can be sure that this is not due to the upgrade process.
3.10 Installing the Oracle Instant Client You have to extract the Oracle Instant Client software. This is necessary if the JDBC driver location [page 41] refers to the Oracle Instant Client directory, rather than to the Oracle home directory. The Instant Client is also needed for BR*TOOLS Release 700, which you install during the post-upgrade phase. Procedure
Install the Oracle Database 10g Instant Client for UNIX as described in SAP Note 819829.
20/50
PUBLIC
02/21/2007
4
Oracle Database Upgrade
4 Oracle Database Upgrade
This section describes how to upgrade the Oracle database. Prerequisites
You have completed the following: n Planning [page 9] n Preparations [page 13] Process Flow
You install the database software [page 21]. You upgrade the database structure [page 29]. Result
You have completed the upgrade. Now perform the post-upgrade steps [page 21].
4.1 Database Software Installation As part of the Oracle database upgrade [page 21] you upgrade the software. Note
You can upgrade the database software while the SAP system is still running with the existing database (that is, Oracle 8.1.7 or Oracle 9.2). Therefore, to reduce downtime you can perform the following steps before you stop your system. The exception to this is for AIX where you need to run an additional script as the root user, as described in Adapting the AIX Kernel (AIX only) [page 24]. You need to shut down all Oracle instances on the host before running this script. Process Flow
1. You check and set the environment variables [page 22]. 2. You back up the Oracle inventory [page 24]. Only valid for: AIX
3. You perform steps for the AIX operating system [page 24]. End of: AIX
4. You run the Oracle Universal Installer [page 25]. 5. You install the current patch set [page 26].
02/21/2007
PUBLIC
21/50
4 4.1
6. 7. 8. 9.
Oracle Database Upgrade Database Software Installation
You install required interim patches [page 27]. You copy and adapt the old Oracle SQL*Net files [page 28]. You back up the Oracle database [page 28]. You shut down the SAP system and Oracle listener process [page 29].
4.1.1 Checking and Setting the Environment Variables To install the database software [page 21], you need to check and set the environment variables of user ora because this user installs the Oracle software. Note
For more information on changes to the environment of the SAP user <sapsid>adm, see Changing the Environment for the <sapsid>adm User [page 40]. Prerequisites
You set the environment variables below by editing the files .dbenv_.sh and .dbenv_.csh in the home directory of ora. Caution
Do not make the changes to the environment permanent as long as the old database is still running. You make them permanent in the post-upgrade phase. We recommend you to back up the old environment files before making the changes permanent. Procedure
1. Make sure the following environment variables are not set: n TWO_TASK n ORA_NLS n ORA_NLS32 n ORA_NLS33 2. Set the following environment variables: Environment Variable
Value
DISPLAY
:0.0
Note
is the host on which the Oracle Universal Installer (OUI) will be displayed. :0.0
ORACLE_BASE
22/50
/oracle
PUBLIC
02/21/2007
4 4.1
Oracle Database Upgrade Database Software Installation
Environment Variable
Value
ORACLE_SID
ORACLE_HOME
One of the following values: /oracle//102_32 /oracle//102_64
Set this to the output of the script CHECKS.SQL, which you can find in one of the following: n 64-bit platforms
NLS_LANG
/oracle/stage/102_64/database/Disk1/SAP
or /oracle/stage/102_64/database/SAP
n 32-bit platforms /oracle/stage/102_32/database/SAP
Note
The database must be open before you execute the script CHECKS.SQL. ORA_NLS10
$ORACLE_HOME/nls/data
SAPDATA_HOME
/oracle/
The setting of the DISPLAY environment variable is described in SAP Note 432861. To make sure that the OUI screen can be displayed correctly on your system, you might have to start an X terminal (xterm) session and run the command: $ xhost +
3. Set the corresponding environment variable for the library path: Operating System
Environment Variable
Value
AIX
LIBPATH
$ORACLE_HOME/lib:$LIBPATH
Solaris, HP Tru64 UNIX, Linux
LD_LIBRARY_PATH
$ORACLE_HOME/lib:$LD_LIBRARY_PATH
HP-UX
SHLIB_PATH
$ORACLE_HOME/lib:$SHLIB_PATH
This makes sure that dynamic libraries are loaded first from $ORACLE_HOME/lib. 4. Include $ORACLE_HOME/bin in your PATH or path variable, where $ORACLE_HOME is the variable that you set in step 2 above. Note
Make sure there is only one $ORACLE_HOME/bin in your PATH or path variable. Make sure that the path variable does not contain the old $ORACLE_HOME/bin. 5. Check if the temporary directory (usually /tmp) has at least 400 MB of free space. If not, set up the TEMP or TMPDIR environment variables to specify a temporary directory on the filesystem. 02/21/2007
PUBLIC
23/50
4 4.1
Oracle Database Upgrade Database Software Installation
Recommendation
You can check the correctness of the new environment with the UNIX env command. Or you can run the UNIX umask command and check that the returned value is 22.
4.1.2 Backing Up the Oracle Inventory Before you install the database software [page 21] you need to back up the Oracle inventory. Procedure
1. If the Oracle inventory exists, check its location by looking at the entry in one of the following files: n /var/opt/oracle/oraInst.loc n /etc/oraInst.loc The location is shown as follows: inventory_loc=<path to Oracle inventory>
2. Make a backup of your existing Oracle inventory before you start the Oracle Database 10g Release 2 (10.2) software installation. Only valid for: AIX
4.1.3 Performing Steps for the AIX Operating System To install the database software [page 21] on the AIX operating system, you need to run the rootpre.sh script to adapt the AIX kernel and also execute a command as the root user. Prerequisites
If several Oracle instances run on one computer, you must shut these down before adapting the kernel. Procedure
1. Run the rootpre.sh script as follows: a) Log on to the system with user ora if you are not already logged on. b) Change to the directory /oracle/stage/102_64/database/Disk1/rootpre using the following command: cd /oracle/stage/102_64/database/Disk1/rootpre
c) Make sure that the user root is assigned the environment of ora: su root
d) Call the script
rootpre.sh:
./rootpre.sh
24/50
PUBLIC
02/21/2007
4 4.1
Oracle Database Upgrade Database Software Installation
e) Log off with the user root: exit
2. Remove any currently unused modules in kernel and library memory by entering the following command as user root: # /usr/sbin/slibclean End of: AIX
4.1.4 Running the Oracle Universal Installer To install the database software [page 21] you run the Oracle Universal Installer (OUI). Procedure
1. Start the OUI with the user ora as follows: n For 32-bit systems, enter the following: cd /oracle/stage/102_32/database/SAP ./RUNINSTALLER
n For 64-bit systems, enter one of the following: l cd /oracle/stage/102_64/database/Disk1/SAP ./RUNINSTALLER
l
cd /oracle/stage/102_64/database/SAP ./RUNINSTALLER
You see a message that a response file is being generated. It might take several minutes before you see the OUI screen. 2. Respond to the OUI as follows: Prompt or Condition
Action
When you run the OUI for the first time on this host, Accept the OUI proposal and continue by choosing a dialog box, Specify File Locations Destination..., appears. Next. This dialog box proposes the inventory location as /oracle/oraInventory and the installation group as dba. Available Product Components
Confirm the default selections by choosing Next.
Product-Specific Prerequisite Checks This phase checks if all necessary requirements for installing and running the database have been met.
For items that are flagged as warnings or failed, review the cause for the warning or failure on screen and fix the problem if possible. Alternatively you can verify the items manually and confirm them by clicking the checkbox. You can find details about each check by clicking on the relevant item.
Java Development Kit (JDK)
HP Tru64: Enter the location of the JDK.
02/21/2007
PUBLIC
25/50
4 4.1
Oracle Database Upgrade Database Software Installation
Prompt or Condition
Action
Summary page
Check the information on this page and then start the installation.
When the Install step has completed, a dialog box appears.
Execute the file $ORACLE_HOME/root.sh with the user root, and confirm the dialog box by choosing OK. If this is the first time that the Oracle software has been installed on this host, the OUI also asks you to execute a second script, /oracle/oraInventory/orainstRoot.sh, as the root user. Execute this script as well. Continue by choosing Next.
3. At the end of the installation, in case there are any Configuration Assistants that have been started automatically (for example, Oracle Net) choose Cancel and terminate the Net Config Assistant. You can ignore messages that some of the config assistants failed to complete successfully. The Installer finishes, reporting that the Oracle installation was successful. It also informs you about the services that it started. You can find the port numbers for these services in the $ORACLE_HOME/install/portlist.ini file. 4. To exit the OUI, choose Exit and confirm the dialog box that appears. Note
You can now access the Oracle 10.2 online documentation, which was installed during the last step. You can find the entry point to the Oracle online documentation at $ORACLE_BASE/doc/index.htm.
4.1.5 Installing the Current Patch Set After the database software installation [page 21] , you need to install the current Oracle Database 10g Release 2 (10.2) patch set. Prerequisites
n For more information on the latest patch set available for Oracle 10.2 see SAP Note 871735. n For more information on how to install the patch set, see the patch set README file.
26/50
PUBLIC
02/21/2007
4 4.1
Oracle Database Upgrade Database Software Installation
Caution
Do not perform any of the post-installation steps mentioned in the patchset README file. The post-installation steps are to be performed only on an existing Oracle 10.2 database. At this stage you have only installed the Oracle 10.2 software. The database itself is still not Oracle 10.2. Therefore, make sure that you do not perform the post-installation steps mentioned in the README file. n You only have to install the latest (that is, the current) patch set. Procedure
1. Log on at the operating system level with the ora user. 2. Install the patch set as described on the patch set README file.
4.1.6 Installing Required Interim Patches After the database software installation [page 21], you need to install required interim patches, using the Oracle tool OPatch. You need these interim patches in addition to the current patch set. Prerequisites
n Make sure you have already installed the current patch set [page 26]. n Check SAP Note 871096 to find the list of required patches to be installed. n Check SAP Note 839182 for instructions on how to use OPatch. Procedure
1. Log on at the operating system level as the ora user. 2. Install the patches, following the instructions in SAP Note 839182. Note
You can apply the patches in any order. We recommend that you first copy the patches to a directory called ora_patches in $ORACLE_HOME. 3. After all the patches have been successfully applied, you can query the status with the following command: $ORACLE_HOME/OPatch/opatch lsinventory
This command lists all the patches that have been applied to the software installation.
02/21/2007
PUBLIC
27/50
4 4.1
Oracle Database Upgrade Database Software Installation
4.1.7 Copying and Adapting the SQL*Net Files After the database software installation, you must copy and modify the old SQL*Net files, that is, listener.ora, sqlnet.ora, and tnsnames.ora. Procedure
1. Log on as user ora. 2. If ora has environment variable TNS_ADMIN set, do the following: a) Choose a new location for the new SQL*Net parameter files and set TNS_ADMIN to point to the new location . b) Copy the SQL*Net parameter files from the old location to c) Edit the new SQL*Net files by adapting all file paths for the new directory. Be sure to adapt the value of ORACLE_HOME in the listener.ora file. 3. If ora has not set the TNS_ADMIN environment variable, Oracle first searches in /etc, in $ORACLE_HOME/network/admin for the SQL*Net parameter files. Choose which of the following applies to your installation: n The SQL*Net parameter files are located in directory /etc: a) Make a backup copy of the files. b) Edit the new SQL*Net files by adapting all file paths for the new directory. Be sure to adapt the value of ORACLE_HOME in the listener.ora file. The SQL*Net parameter files are located in /network/admin: n a) Copy the SQL*Net parameter files from to . b) Edit the new SQL*Net files by adapting all file paths for the new directory. Be sure to adapt the value of ORACLE_HOME in the listener.ora file. 4. Since your database is still running in the old environment, do not start the listener with the new listener.ora file at this point.
4.1.8 Backing Up the Oracle Database You must have a complete and usable database backup otherwise you might lose data. We recommend you to back up all your Oracle 9i archive logs before you start the upgrade. The upgrade changes the parameter log_archive_format to 10.2.0. After the upgrade has completed BRARCHIVE cannot back up archive files from before the upgrade (that is, from Oracle 9i or earlier) because of this change to log_archive_format. Procedure
1. Create a complete database backup and back up any archive logs from Oracle 9i.
28/50
PUBLIC
02/21/2007
4 4.2
Oracle Database Upgrade Database Structure Upgrade
Recommendation
Before backing up the archive logs, switch the log files with the following SQL command: alert system switch logfile
Make sure that you do a log file switch for all online redo log files. 2. Check that the backup is usable. If for any reason you have problems during the upgrade you must be able to restore the database from this backup. 3. If you want to separate the alert log file of Oracle 9i from that of Oracle Database 10g Release 2 (10.2), you can move the alert log file to a different name with the following command: cd /oracle//saptrace/background mv alert_<SID>.log alert_<SID>.log-SV-9.2.0
4.1.9 Shutting Down the SAP System and Oracle Listener Process You need to shut down the SAP system and the Oracle listener running process running in the old ORACLE_HOME, for example, in /oracle//920_64. Procedure
1. Stop the SAP application server by entering the following command as user <sapsid>adm: stopsap r3
2. Stop the Oracle listener by entering the following command as user ora: lsnrctl stop
Note
Make sure that processes that log on to the database, such as CRON jobs, are not active during the upgrade. Make sure that you reschedule these processes when the upgrade has finished.
4.2 Database Structure Upgrade As part of the Oracle database upgrade [page 21] you upgrade the database structure. Prerequisites
You have installed the database software [page 21]. Process Flow
1. You check the oratab entry [page 30]. 2. You start the Database Upgrade Assistant to perform the upgrade [page 30].
02/21/2007
PUBLIC
29/50
4 4.2
Oracle Database Upgrade Database Structure Upgrade
Result
Now continue with the Post-Upgrade Steps [page 33].
4.2.1 Checking the oratab Entry To upgrade the database structure [page 29] , you need to check the entry for the oratab file. Prerequisites
You can find the oratab file as follows: Only valid for: AIX;HP Tru64 UNIX;HP-UX;Linux
n
/etc End of: AIX;HP Tru64 UNIX;HP-UX;Linux Only valid for: Solaris
n
/var/opt/oracle End of: Solaris
Procedure
1. Make sure that the oratab file contains the following entry: ::N
Where old_ORACLE_HOME stands for the path to the old oracle software installation. Example
The entry for a system with a equal to C11 is as follows: C11:/oracle/C11/920_64:N. 2. If this entry does not exist, insert it using a text editor.
4.2.2 Starting the Database Upgrade Assistant To upgrade the database structure [page 29] you need to start the Oracle Database Upgrade Assistant (DBUA). The DBUA tool is a graphical tool that leads you step by step through the upgrade. Prerequisites Caution
Make sure that you start the DBUA in the Oracle 10.2 user environment. To do this, carefully check the first point below.
30/50
PUBLIC
02/21/2007
4 4.2
Oracle Database Upgrade Database Structure Upgrade
n Confirm that the following environment variables point to Oracle 10.2 directories: l ORACLE_HOME points to /oracle//102_64 l PATH l ORA_NLS10 l LD_LIBRARY_PATH orSHLIB_PATH or LIBPATH n Before you start the DBUA make sure that the DISPLAY environment variable is correctly set. Procedure
1. You start the DBUA: cd $ORACLE_HOME/bin ./dbua
2. Respond appropriately to the DBUA dialogs: The Welcome screen provides information about the upgrade assistant a) Choose Next to continue. The Databases screen lets you select the database to be upgraded. b) Select the correct database and choose Next. The DBUA now analyzes the database to be upgraded, performs pre-upgrade checks, and issues warnings if necessary. You can ignore warnings about the following: n Stale optimizer statistics n Changes to the Oracle CONNECT role You need to analyze and act on other warnings. Recommendation
We recommend you to resolve warnings other than those listed above. Otherwise you might later have problems during the actual upgrade. The SYSAUX Tablespaces screen lets you modify the attributes for the SYSAUX tablespace, which is added automatically to all new Oracle Database 10g databases. c) Make the following entries: n Datafile Path: $SAPDATA_HOME/sapdata1/sysaux_1/sysaux.data1 Note
Make sure that you substitute the value for $SAPDATA_HOME with the full path name ‒ for example, /oracle/ ‒ in the above command. You cannot use environment variables directly in the input field since the DBUA cannot evaluate SAP-specific environment variables. n Select Reuse Existing File Name.
02/21/2007
PUBLIC
31/50
4 4.2
Oracle Database Upgrade Database Structure Upgrade
Enter 1000 MB in Size. Select AUTOEXTEND ON. Enter 100 MB in Increment. Enter 2000 MB in Maximum Size. The Recompiling Invalid Objects screen lets you choose whether the DBUA has to automatically recompile all PL/SQL modules after the upgrade. If the database server has multiple CPUs, the DBUA automatically proposes the number of parallel processes to be used for the recompilation. The turn off archiving option means that archiving is switched off for the duration of the upgrade so that the upgrade finishes faster. d) Accept the default values, select Recompile invalid objects after the upgrade, turn off archiving for the duration of the upgrade, and choose Next. The Backup screen lets you specify whether you want the DBUA to back up the database. e) Since you have already backed up the database, select I have already backed up my database and choose Next. The Management Options screen lets you set up the database so that it can be managed with the Enterprise Manager. f) Make sure that Configure the database with Enterprise Manager is not selected and choose Next. Before you start it, the DBUA displays a summary of the changes to be made. This includes the warnings that you ignored or did not fix, components to be upgraded, parameters to be added, removed, and changed after the upgrade. 3. Review the summary of changes and choose Back to make any final adjustments, if required. n n n n
Note
For a complete list of obsolete and deprecated parameters, see the documentation for Oracle Database 10g Release 2 (10.2). 4. Start the database upgrade by choosing Finish. The DBUA automatically removes the database initialization parameters that are now obsolete in Oracle Database 10g Release 2 (10.2). The upgrade process itself runs for some time, depending mainly on the size of the database and the capacity of the hardware. When the DBUA has completed successfully the results of the upgrade are displayed 5. Review the changes made and exit the DBUA.
32/50
PUBLIC
02/21/2007
5
Post-Upgrade Steps
5 Post-Upgrade Steps
After the Oracle database upgrade, you need to perform the steps described here. 1. You finalize the environment of the ora user [page 33]. 2. You check the upgraded database [page 34]. 3. You update BR*Tools [page 35]. 4. You back up the database [page 36]. 5. You perform post-upgrade tasks [page 36]. 6. You install Oracle critical patch updates [page 38]. 7. You check the oratab entry [page 39]. 8. You start the listener process [page 39]. 9. You rename the old $ORACLE_HOME/bin directory [page 40]. 10. You check the read authorization of the <sapsid>adm user [page 40]. 11. You change the environment for the <sapsid>adm user [page 40]. 12. You check the SAP profile parameters [page 41]. 13. You change the location of the JDBC driver [page 41]. 14. You restart the SAP system [page 44]. 15. You disable the database user locking mechanism on failed logins [page 44]. 16. You configure the new features for Oracle Database 10g Release 2 (10.2) [page 44].
5.1 Finalizing the Environment of the oraUser You need to make sure that the changes you made to the Oracle user environment are permanently stored in the profiles (.cshrc, .dbenv_.csh, and so on). Procedure
Check the values for the environment variables as described in Checking and Setting the Environment Variables [page 22]. Note
Make sure that the environment does not contain any variables that still refer to the old database release.
02/21/2007
PUBLIC
33/50
5 5.2
Post-Upgrade Steps Checking the Upgraded Database
5.2 Checking the Upgraded Database You need to check the upgraded database. Procedure
1. Check that the database is now running with Oracle Database 10g Release 2 (10.2) software in an Oracle Database 10g Release 2 (10.2) environment by entering the following commands: a) Log onto the database as the ora<sid> user. b) Enter the following command to start SQLPLUS: sqlplus / as sysdba
c) Enter the following SQL commands: A) Enter the following command to determine the release of the installed software: SQL> select version from V$INSTANCE;
Example
This is an example of the output from this command: VERSION 10.2.0.2.0
B) Enter the following command to determine the release and status of the installed database components: SQL> select comp_id, version, status from dba_registry;
Example
This is an example of the output from this command: COMP ID VERSION STATUS CATALOG 10.2.0.2.0 VALID CATPROC 10.2.0.2.0 VALID
Make sure that the command returns the status VALID. C) Check that the version returned in the previous two commands is identical. 2. Check that the value for the version returned from the above command is the same level as the installed patchset. For example, if the installed patchset is Oracle 10.2.0.2, the above command should also report the version for the CATALOG and CATPROC components as 10.2.0.2. 3. After the upgrade check that the following document is created: $ORACLE_HOME/assistants/dbua/doc/help/DefaultBehaviorChangesin10g.html
Note
You need to check this document carefully because it contains information on important changes in the default behavior of the new Oracle 10.2 database. 34/50
PUBLIC
02/21/2007
5 5.3
Post-Upgrade Steps Updating BR*Tools
Recommendation
If the old database used an initialization file init.ora, theDBUA automatically creates an spfile. We recommend that you continue to use the spfile. Do not switch back to the initialization file after the upgrade.
5.3 Updating BR*Tools You update BR*Tools to the latest release, BR*Tools Release 700, with the latest patch level. After extracting BR*Tools Release 700 you need to update the SAPDBA role using the script sapdba_role.sql. This is essential so that the new release of BR*Tools works correctly. The script is automatically extracted when you extract BR*Tools. Procedure
1. Download the most current version of the BR*Tools from SAP Service Marketplace at: service.sap.com/swdc
2. After you have extracted the newest BR*Tools, you also need to copy the BR*Tools configuration files init.sap and init.utl from the old $ORACLE_HOME/dbs directory to the new one (init.utl is only available if you are using a third-party backup solution): cd /dbs cp init.sap $ORACLE_HOME/dbs cp init.utl $ORACLE_HOME/dbs
Note init.dba
is no longer needed because BR*Tools release 6.40 SAPDBA is no longer
available. 3. Execute the following commands as the ora user to update the SAPDBA role: cp /usr/sap/<SAPSID>/SYS/exe/run/sapdba_role.sql $ORACLE_HOME/dbs cd $ORACLE_HOME/dbs Only valid for: ABAP
sqlplus /nolog @sapdba_role <SAPSCHEMA_ID> End of: ABAP Only valid for: Java
sqlplus /nolog @sapdba_role <SAPSCHEMA_ID>DB End of: Java
Note
If you have an ABAP+Java system, you have to enter both commands.
02/21/2007
PUBLIC
35/50
5 5.4
Post-Upgrade Steps Backing Up the Database
Caution
Make sure that you execute this command for every SAPSCHEMA_ID in your database.
5.4 Backing Up the Database You need to back up your upgraded Oracle Database 10g database. Caution
You risk losing data if you do not back up your database. Procedure
Perform a full database backup.
5.5 Performing Post-Upgrade Tasks You need to perform certain post-upgrade tasks. Procedure
1. Change database compatibility by executing the following SQL command as the ora user: SQL> alter system set compatible='10.2.0' scope = spfile;
2. Restart the Oracle database. 3. Deactivate the Oracle recycle bin by executing the following SQL command as the ora user: SQL> purge dba_recyclebin; SQL> alter system set recyclebin = 'off' scope = spfile;
For more information, see SAP Note 838982. 4. Gather Oracle optimizer statistics as follows: a) Execute the following commands as the ora user: SQL> spool $ORACLE_HOME/cfgtoollogs/dbstats.log SQL> execute dbms_scheduler.disable('GATHER_STATS_JOB'); SQL> execute dbms_stats.gather_system_stats; SQL> execute dbms_stats.gather_dictionary_stats (ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO', GRANULARITY => 'ALL', CASCADE => TRUE, OPTIONS => 'GATHER', NO_INVALIDATE => FALSE);
36/50
PUBLIC
02/21/2007
5 5.5
Post-Upgrade Steps Performing Post-Upgrade Tasks SQL> execute dbms_stats.gather_fixed_objects_stats;
b) Check the log file dbstats.log created at $ORACLE_HOME/cfgtoollogs for any errors during the gathering of statistics. 5. Identify the objects that are invalid after the upgrade as follows: a) Execute the following commands as the ora user: SQL> @?/rdbms/admin/utlrp.sql; SQL> spool $ORACLE_HOME/cfgtoollogs/invalid_post.log SQL> select count(*) from dba_objects where status = 'INVALID'; SQL> select substr(owner,1,12) owner, substr(object_name,1,30) object, substr(object_type,1,30) type, status from dba_objects where status <>'VALID' order by owner; SQL> spool off;
b) Check the log file
invalid_post.log.
created at $ORACLE_HOME/ cfgtoollogs/invalid_post.log to compare the invalid objects before the start of the upgrade. 6. Check the Oracle database parameters against SAP Note 830576 and adjust them if necessary. Make sure that the following database parameters, if set, are removed; COMMIT_WRITE CURSOR_SPACE_FOR_TIME DB_FILE_MULTIBLOCK_READ_COUNT HASH_JOIN_ENABLED LOG_ARCHIVE_START OPTIMIZER_INDEX_COST_ADJ OPTIMIZER_MODE STATISTICS_LEVEL TIMED_STATISTICS TRACE_ENABLED
7. Restart the database to activate the changes: a) Log on to the database with SQL*Plus b) Execute the following commands: sqlplus / as sysdba shutdown immediate startup
8. Gather statistics for SAP schemas: a) With Oracle Database 10g all tables have statistics, which means that you need to update some entries in the DBSTATC table before starting BRCONNECT, as follows: n For 32-bit platforms: sqlplus /nolog SQL> connect / as sysdba SQL> @/oracle/stage/102_32/database/SAP/updDBSTATC10.sql
02/21/2007
PUBLIC
37/50
5 5.6
Post-Upgrade Steps Installing Oracle Critical Patch Updates
n For 64-bit platforms, do one of the following: l sqlplus /nolog SQL> connect / as sysdba SQL> @/oracle/stage/102_64/database/SAP/updDBSTATC10.sql
l
sqlplus /nolog SQL> connect / as sysdba SQL> @/oracle/stage/102_64/database/disk1/updDBSTATC10.sql
b) Update the DBCHECKORA control table after the upgrade as follows: n For 32-bit platforms: cd /oracle/stage/102_32/database/SAP sqlplus sap<sid>/ @dbcheckora10upgr
n For 64-bit platforms, do one of the following: l cd /oracle/stage/102_64/database/SAP sqlplus sap<sid>/ @dbcheckora10upgr
l
cd /oracle/stage/102_64/database/Disk1/SAP sqlplus sap<sid>/ @dbcheckora10upgr
Note
Call this script for every SAP ABAP schema on the database c) Update the Oracle database statistics with BRCONNECT as follows: brconnect -c -u / -f stats -t all –f collect -p 4
Note
For more information on update statistics, see the documentation SAP Database Guide: Oracle on SAP Service Marketplace at: http://service.sap.com/dbaora Media Library
5.6 Installing Oracle Critical Patch Updates The Oracle Critical Patch Updates contain a collection of security-related fixes that are released once every quarter. Since these patches contain important fixes to significant security problems, we strongly recommend you to apply these Critical Patch Updates. See central SAP Note 850306 for information about the latest CPU to be installed. Prerequisites
n Make sure you have already installed the current patch set [page 26]. n Make sure that you have installed all the required interim patches described in SAP Note 871096.
38/50
PUBLIC
02/21/2007
5 5.7
Post-Upgrade Steps Checking the oratab entry
n Check SAP Note 850306 to determine which Oracle CPU is needed. Procedure
1. Log on at the operating-system level as the ora user. 2. Install the patches, following the instructions in the README document of the Critical Patch Update. Make sure that you complete the post-installation steps described in the README document.
5.7 Checking the oratab entry You check the entry for the oratab file. Prerequisites
You can find the oratab file as follows: Only valid for: AIX;HP Tru64 UNIX;HP-UX;Linux
/etc End of: AIX;HP Tru64 UNIX;HP-UX;Linux Only valid for: Solaris
/var/opt/oracle End of: Solaris
Procedure
1. Make sure that there is an entry like the following in your oratab file: ::N new_ORACLE_HOME indicates the path to the Oracle Database 10g software.
Example
The entry for a system with equal to C11 is as follows: C11:/oracle/C11/102_64:N. 2. If the entry does not exist, insert it using a text editor.
5.8 Starting the Listener Process You start the listener process.
02/21/2007
PUBLIC
39/50
5 5.9
Post-Upgrade Steps Renaming the Old $ORACLE_HOME/bin Directory
Prerequisites
Make sure that you have copied the SQL*Net configuration files from the old Oracle installation to the location of the Oracle Datbase 10g software, as described in Copying and Adapting the SQL*Net Files [page 28]. Procedure
1. Start the listener: lsnrctl start
2. Check that you can remotely connect to the database through the listener: sqlplus SAP<SAPSCHEMA_ID>/pwd@SID
5.9 Renaming the Old $ORACLE_HOME/bin Directory Once the database is running correctly, you need to rename the bin directory from the old $ORACLE_HOME to prevent accidental usage of the old binaries. Procedure
Rename the old Oracle home directory bin with the following command: mv /bin /bin-old Caution
Do not rename the entire old_oracle_home in case you have SAP systems (SAP kernel release 6.40 and lower) running on the database server. This is because the SAP system running on the database server might still use the Oracle 9i client software.
5.10 Checking the Read Authorization of the <sapsid>adm User You check the read authorization of the <sapsid>adm user. Procedure
1. Make sure that the <sapsid>adm user has read authorization for the directory $ORACLE_HOME. 2. If this is not true, enter the following command as the ora user: chmod 755 $ORACLE_HOME
5.11 Changing the Environment for the <sapsid>adm user You have to change the environment for the <sapsid>adm user, but only on the database server. 40/50
PUBLIC
02/21/2007
5 Post-Upgrade Steps 5.12 Checking SAP Profile Parameters
Note
You do not need to change the environment for <sapsid>adm on application servers because SAP applications still use Oracle9i clients. Procedure
1. On the database server set the ORACLE_HOME environment variable to point to the location of the Oracle Database 10g software installation, for example: /oracle//102_<32>/<64>
2. Make sure that the change to the user environment is permanently stored in the profiles (.cshrc, .dbenv_.csh, and so on). 3. Log out and log on again as the <sapsid>adm user. 4. Check whether R3trans can connect to the database: R3trans –d
5.12 Checking SAP Profile Parameters You have to check the following SAP profile parameters: n n n
DIR_ORAHOME DIR_CLIENT_ORAHOME DIR_SERVER_ORAHOME
Procedure
1. Set DIR_ORAHOME and DIR_CLIENT_ORAHOME in the instance profiles to the corresponding values of the ORACLE_HOME environment variable of the <sapsid>adm user. These variables point to the ORACLE_HOME used by the application server. 2. Set DIR_SERVER_ORAHOME in the default profile to the value of the ORACLE_HOME environment variable of the ora user on the database server. Only valid for: ABAP+Java;Java;Java Add-In
5.13 Changing the Location of the JDBC Driver If you have an SAP system with Java components, you may have to change the location of the JDBC driver after you have upgraded the database. Otherwise the J2EE Engine cannot start because the location of the JDBC driver still points to the path of the old ORACLE HOME. You change the location of the JDBC driver as follows:
02/21/2007
PUBLIC
41/50
5 Post-Upgrade Steps 5.13 Changing the Location of the JDBC Driver
n In files that are located in the database you use the J2EE Engine Config Tool to change the JDBC driver location. n In files that are not located in the database you use Note Pad or another text editor to change the JDBC driver location. Caution
n Make sure when you change the driver location that you use a forward slash "/" or backward slash "\" as appropriate. n Make sure that you replace the old driver location in all locations stated in the following procedure. Procedure
1. Change to the config.properties file, which is located in the following directory: Only valid for: Java
n
/usr/sap/<SAPSID>/JC/j2ee/configtool End of: Java Only valid for: ABAP+Java;Java Add-In
n
/usr/sap/<SAPSID>/DVEBMGS/j2ee/configtool End of: ABAP+Java;Java Add-In
a) Open the file with your text editor and search for the property rdbms.DriverLocation. b) Replace the old driver location with the new one: /oracle/client/10x_<32/64>/instantclient/<java_class_archive>.jar
where <java_class_archive>.jar is classes12.jar or ojdbc14.jar 2. In the same directory as in the first step, start the J2EE Engine - ConfigTool by double-clicking the configtool.sh file. a) Change to Configuration Editor mode. b) Use the Edit mode to replace the driver location in the following property sheets that contain the string rdbms.driverLocation= followed by the driver location: n cluster_data/Propertysheet instance.properties.IDXXXXXXX/IDXXXXXXX.JavaParameters
where XXXXXXX is the instance number Note
Make sure that you change all occurrences. There might be several IDXXXXXX.JavaParameters properties in the property sheet. n n
cluster_data/dispatcher/IDXXXX/kernel/propertysheet ConfigurationManager cluster_data/server/IDXXXX/kernel/propertysheet ConfigurationManager
where XXXX is the instance number
42/50
PUBLIC
02/21/2007
5 Post-Upgrade Steps 5.13 Changing the Location of the JDBC Driver
Note
If you have more than one server or dispatcher you must modify all relevant property sheets. c) Close the J2EE Engine - ConfigTool. 3. Change to the bootstrap.properties file, which is located in the following directory: Only valid for: Java
n
/usr/sap/<SAPSID>/JC/j2ee/cluster/bootstrap End of: Java Only valid for: ABAP+Java;Java Add-In
n
/usr/sap//DVEBMGS/j2ee/ cluster/bootstrap
a) Open the file with your text editor and search for the property rdbms.DriverLocation. b) Replace the old driver location with the new one: /oracle/client/10x_<32/64>/instantclient/<java_class_archive>.jar
Caution
If you have more than one J2EE Engine server installed, you must repeat steps 2 and 3 for all servers. End of: ABAP+Java;Java Add-In
4. Change to the sdmrepository.sdc file, which you can find in the following directory: Only valid for: Java
n
/usr/sap/<SAPSID>/JC/SDM/program/config/ End of: Java Only valid for: ABAP+Java;Java Add-In
n
/usr/sap/<SAPSID>/DVEBMGS/SDM/program/config/
a) Search for the following text: <Param type="String" hide="false" name="jarPaths" encrypted="false" displayName="Driver Paths (separated by ;)">
b) If required, replace the old driver location with the new one, such as one of the following: /oracle//102_64/jdbc/lib/<java_class_archive>.jar /oracle/client/10x_<32/64>/instantclient/<java_class_archive>.jar End of: ABAP+Java;Java Add-In
5. Change to the rdb.properties file, which is located in the following directory: /usr/sap/<SID>//j2ee/deploying
a) Open the file with your text editor and search for the property rdbms.DriverLocation. b) Replace the old driver location with the new one: /oracle/client/10x_<32/64>/instantclient/<java_class_archive>.jar
6. Change to the templateconfigurator.properties file, which is located in the following directory:
02/21/2007
PUBLIC
43/50
5 Post-Upgrade Steps 5.14 Starting the SAP System /usr/sap/<SID>//j2ee
a) Open the file with your text editor and search for the property RDBMS_DRIVER_LOCATION. b) Replace the old driver location with the new one: /oracle/client/10x_<32/64>/instantclient/<java_class_archive>.jar End of: ABAP+Java;Java;Java Add-In
5.14 Starting the SAP System You need to restart the SAP system. Procedure
1. If R3trans connects without problems, start the SAP system: Startsap
2. Check the new Oracle version using SAP transaction ST04.
5.15 Disabling Database User Locking Mechanism For Failed Logins When upgrading an Oracle database to Oracle version 10g, user locking is automatically activated so that, if you repeatedly enter invalid login information, the user is locked. By default, ten invalid login attempts are allowed before the user is locked. Since old SAP systems first try to log in with a standard user (sapr3) and password, this locking mechanism might lock the user when starting the system. For more information, see SAP Note 951167. Procedure
To deactivate user locking after invalid logon attempts, enter the following information in sqlplus: sqlplus /nolog sql>connect / as sysdba sql>ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED; sql>exit
5.16 Configuring the New Features for Oracle Database 10g Release 2 (10.2) You need to configure the new Oracle Database 10g Release 2 (10.2) features.
44/50
PUBLIC
02/21/2007
5 Post-Upgrade Steps 5.16 Configuring the New Features for Oracle Database 10g Release 2 (10.2)
Procedure
For more information about new features with Oracle Database 10g Release 2 (10.2) see SAP Note 828268. This note provides links to other SAP notes that describe how to configure or activate each new feature.
02/21/2007
PUBLIC
45/50
Typographic Conventions
Example
Description
< >
Angle brackets indicate that you replace these words or characters with appropriate entries to make entries in the system, for example, “Enter your <User Name>”. Arrows separating the parts of a navigation path, for example, menu options
Example
Emphasized words or expressions
Example
Words or characters that you enter in the system exactly as they appear in the documentation
Example
Textual cross-references to an internet address, for example, http://www.sap.com
/example
Quicklinks added to the internet address of a homepage to enable quick access to specific content on the Web
123456
Hyperlink to an SAP Note, for example, SAP Note 123456
Example
n Words or characters quoted from the screen. These include field labels, screen titles, pushbutton labels, menu names, and menu options. n Cross-references to other documentation or published works
Example
n Output on the screen following a user action, for example, messages n Source code or syntax quoted directly from a program n File and directory names and their paths, names of variables and parameters, and names of installation, upgrade, and database tools
EXAMPLE
Technical names of system objects. These include report names, program names, transaction codes, database table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE
EXAMPLE
Keys on the keyboard
46/50
PUBLIC
02/21/2007
SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Germany T +49/18 05/34 34 34 F +49/18 05/34 34 20 www.sap.com
© Copyright 2007 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (“SAP Group”) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. This document was created using stylesheet 2006-12-31 (V5.1) and XSLT processor SAXON 6.5.2 from Michael Kay (http://saxon.sf.net/), XSLT version 1. Disclaimer
Some components of this product are based on Java™. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components. Any Java™ Source Code delivered with this product is only to be used by SAP’s Support Services and may not be modified or altered in any way.
02/21/2007
PUBLIC
47/50
Documentation in the SAP Service Marketplace
You can find this document at the following address: https://service.sap.com/instguides
48/50
PUBLIC
02/21/2007
This page is intentionally left blank.
SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Germany T +49/18 05/34 34 34 F +49/18 05/34 34 20 www.sap.com
© Copyright 2007 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.