Sei sulla pagina 1di 40
Oracle DB Upgrade from 10.4 to 11.2

Oracle DB Upgrade from 10.4 to 11.2

Oracle DB Upgrade from 10.4 to 11.2 Index 1. Planning 1.1 Checking the Original Version

Oracle DB Upgrade from 10.4 to 11.2

Index

1. Planning

1.1 Checking the Original Version of Your Database

1.2 Checking Hardware and Software Requirements

1.3 Reviewing the Kernel Parameters and Shell Limits

1.4 Checking Additional Requirements for the Upgrade

1.5 Checking the SAP System Prerequisites

2. Preparation

2.1 Checking and Setting the DISPLAY Environment Variable

2.2 Checking UNIX Users, Groups, and Authorizations

2.3 Checking the Directory Structure

2.4 Checking the Software Installation Prerequisites

2.5 Installation of Oracle Database Software

2.5.1 Checking and Setting the Environment Variables

2.5.2 Backing Up the Central Oracle Inventory

2.5.3 Installing the Oracle Database Software

2.5.4 Installing the Required SAP Bundle Patch

2.6 Running the Pre-Upgrade Scripts

3. Database upgrade

3.1

Backing Up the Oracle Database

3.2

Shutting Down the SAP System and Oracle Listener Process

3.3

Database Structure Upgrade

3.4

Copying and Adapting the SQL*Net Files

3.1

Backing Up the Oracle Database

3.2

Shutting Down the SAP System and Oracle Listener Process

3.3

Database Structure Upgrade

3.3.1 Starting the Database Upgrade Assistant

3.4 Copying and Adapting the SQL*Net Files

4. Post upgrade steps

4.1 Finalizing the Environment of the ora<dbsid> User

4.2 Checking the Upgraded Database

4.3 Updating BR*Tools

4.4 Performing Post-Upgrade Tasks

4.5 Backing Up the Database

4.6 Starting the Listener Process

4.7 Checking the Read Authorization of the <sapsid>adm User

4.8 Updating the Oracle Instant Client

4.9 Update latest sap kernel

4.10 Changing the Environment for the <sapsid>adm user

4.11 Updating the SQL*Net Configuration Files for the <sapsid>adm and ora<sid> Users

4.12 Checking SAP Profile Parameters

4.13 Starting the SAP System

1 PLANNING 1.1 Checking the Original Version of Your Database To check the original version

1 PLANNING

1.1 Checking the Original Version of Your Database

To check the original version of your database, do one of the following from the environment of the source database:

Enter the following command:

sqlplus —version —I

Enter the following commands:

sqlplus / as sysdba SQL> select version from v$instance;

Photo

1.2 Checking Hardware and Software Requirements You need to check that you meet the hardware

1.2 Checking Hardware and Software Requirements

1.2 Checking Hardware and Software Requirements You need to check that you meet the hardware and

You need to check that you meet the hardware and software requirements for running the new Oracle release. The com- plete list of hardware and software requirements for every platform is included in the Oracle documentation. The hard- ware and software requirements are also checked in detail during the software installation phase.

1.3Reviewing the Kernel Parameters and Shell Limits

You need to review the Oracle-recommended kernel parameters and shell limits for your operating system with Oracle

Database 11g Release 2 (11.2). The kernel parameters and shell limits are also checked in detail during the software instal-

lation phase.

1.4 Checking Additional Requirements for the Upgrade

1. Oracle 11.2 is only released and certified for SAP products running with SAP BASIS 640 and above, and SAP kernel

release 640_EX2 and above.

2.To upgrade from a remote PC, you need X-Windows software on the PC.

3.Download the Oracle Database 11g Release 2 (11.2) software including the 11.2.0.4 patch sets and required patches or patch collection.

4. Download the latest version of the Oracle 11.2 Instant Client software.

5. Download the latest version of the DBATOOLS (BR*Tools) to be used immediately after the database upgrade.

BR*Tools supports the Oracle Database 11g Release 2 (11.2), as of release 7.10 (patch level 30).or Release 7.20 (patch level 1) .

1.5 Checking the SAP System Prerequisites

If your SAP system is SAP BASIS 7xx, apply the advanced correction from SAP Note 1417124

This correction resolves an Oracle issue that results in an ABAP short dump during statistics updates.

If your SAP system uses SAP Kernel 711, you need to use DBSL (dboraslib.so) patch level 81 or higher.

2. Preparation 2.1 Checking and Setting the DISPLAY Environment Variable You need to check and,

2. Preparation

2.1 Checking and Setting the DISPLAY Environment Variable

You need to check and, if necessary, set the DISPLAY environment variable of the Oracle database software owner, user

<ora_sw_owner>.

Remark Do not make the changes to the environment permanent while the old database is still running. You make them permanent

in the database structure upgrade. We recommend you to back up the old environment files before making the changes

permanent.

Set the DISPLAY environment variable to <host_name>:0.0:

First check your existing shell

#echo $SHELL Cshell To set the parameter #setenv DISPLAY <host_name>:0.0

NOTE :<host_name> is the host on which you want to display the GUI of the Oracle Universal Installer (OUI).

2.2 Checking UNIX Users, Groups, and Authorizations

You need to check that the Oracle database software owner, user <ora_sw_owner>, has write authorization for the $ORA-

CLE_BASE directory, since you perform the database installation as this user.

Enter the following commands:

echo $ORACLE_BASE touch $ORACLE_BASE/write_test rm $ORACLE_BASE/write_test

If the Oracle database software owner, user ora<dbsid>, does not have write authorization, log on to your system with the

user root and enter the command:

chgrp dba $ORACLE_BASEc hmod 775 $ORACLE_BASE

2.3 Checking the Directory Structure

You need to verify the availability and correctness of the following Oracle directories:

Oracle software stage directory Oracle inventory directory

Check the Oracle stage directory, usually called /oracle/stage.

Ensure that the stage directories contain enough freespace prior to extraction of the SAR files. For the database upgrade,

only the software contained within the component database is used.

If there is not enough space, you can delete previous stage directories. When the RDBMS

If there is not enough space, you can delete previous stage directories.

When the RDBMS CDs have been mounted, use the SAP tool SAPCAR to extract all the RDBMS CDs to /oracle/

stage/11204 as user <ora_sw_owner>.

SAPCAR –xvf OR111264.SAR SAPCAR –xvf OR211264.SAR

After you have finished the extraction of all the RDBMS CDs, the following subdirectories exist under /oracle/stage/11204.

database

client

grid

examples

gateways

Deinstall

2.4 Checking the Software Installation Prerequisites

You must check the prerequisites for the Oracle Universal Installer (OUI).

Prerequisites Make sure that the DISPLAY environment variable is set correctly, as described in Checking and Setting the DISPLAY En-

vironment Variable.

Procedure

1. Log on as the Oracle database software owner, user <ora_sw_owner>.

2. Change directory:cd /oracle/stage/11204/database

3. On AIX, call the script rootpre.sh as user root:

./rootpre.sh

4. Execute the following commands to check operating system requirements (release, patches, kernel parameters):

cd SAP

./RUNINSTALLER –check

5. Apply missing OS patches and OS packages and set OS kernel parameters as recommended by the OUI.

2.5 Installation of Oracle Database Software You can install the Oracle 11.2.0.4 database software into

2.5 Installation of Oracle Database Software

You can install the Oracle 11.2.0.4 database software into a new Oracle Home while the SAP system and the database are

still running.

Process Flow

1. You check and set the environment variables

2. You back up the central Oracle inventory

3. You run the Oracle Universal Installer

4. You install the required SAP bundle patch

2.5.1 Checking and Setting the Environment Variables

To install the database software, you need to check and set the environment variables of the Oracle database software own-

er, user <ora_sw_owner>, because this user installs the Oracle software.

Remark:

Do not make the changes to the environment permanent while the old database is still running. You make them permanent

in the database structure upgrade. We recommend you to back up the old environment files before making the changes per-

manent.

1. Make sure that the following environment variables are set as described.

* ORACLE_BASE

Value for Oracle base. The SAP default for single-instance installations is /oracle

* ORACLE_SID

<DBSID>

* ORACLE_HOME

Make sure that it is set to the value of the current runtime Oracle home

* LIBPATH

$ORACLE_HOME/lib:$LIBPATH

* PATH

PATH includes $ORACLE_HOME/bin of the current active ORACLE_HOME. This means that you have to adapt PATH when ORACLE_HOME is changed. PATH can only include one $ORACLE_HOME/bin.

2. Check if the temporary directory (usually /tmp) has at least 1024 MB of free space. If not, set up the TEMP or TMPDIR

environment variables to specify a temporary directory on the filesystem.

2.5.2 Backing Up the Central Oracle Inventory Before you install the new Oracle database patch

2.5.2 Backing Up the Central Oracle Inventory

Before you install the new Oracle database patch set software, you need to back up the central Oracle inventory.

If the Oracle inventory exists, check its location by looking at the entry in one of the following files:

AIX, Linux: /etc/oraInst.loc

Make a backup of your existing Oracle inventory before you start the Oracle Database 11g Release 2 (11.2) software instal-

lation by entering the following commands:

cd <path to Oracle inventory> cp -r oraInventory oraInventory.<date>.SAV

2.5.3 Installing the Oracle Database Software

Starting with the first patch set for Oracle Database 11g Release 2 (11.2.0.2), Oracle Database patch sets are full installa-

tions of the Oracle database software. You only need to install the current Oracle database patch set.

Procedure

1. Log on as the Oracle database software owner <ora_sw_owner>.

If you are already logged on as user root, you can switch to the Oracle database software owner, user <ora_sw_owner>, by

entering the following command:su – <ora_sw_owner>

2. Change to the stage directory:cd /oracle/stage/11204/database/SAP

3. Make sure that the DISPLAY environment variable is set to <host_name>:0.0,

where <host_name> is the host on which you want to display the GUI of the Oracle Universal Installer (OUI).

4. Start the OUI with the Oracle database software owner, user <ora_sw_owner>, as follows:./RUNINSTALLER

5. To exit the OUI, choose Exit and confirm the dialog box that appears.

photo

Photo

Photo

2.5.4 Installing the Required SAP Bundle Patch After the Oracle database software installation, you need

2.5.4 Installing the Required SAP Bundle Patch

After the Oracle database software installation, you need to install the required SAP bundle patch. You only need to install the latest SAP bundle patch because these patches are cumulative.

Procedure

1. Log on at the operating system level as the Oracle database software owner, user <ora_sw_owner>.

2. Install the SAP bundle patch according to the instructions in the SAP bundle patch README file.

3. Change temporary env variable before applying patches - setenv ORACLE_HOME /oracle/<SID>/11204

4. Go to the source of software bundle package of oracle patches and executed that below command $ORACLE_HOME/OPatch/opatch napply

Photo

2.6 Running the Pre - Upgrade Scripts You run the Oracle pre - upgrade scripts,

2.6 Running the Pre-Upgrade Scripts

You run the Oracle pre-upgrade scripts, which automatically perform various tasks and checks on your database. The scripts do the following on your pre-upgrade database

* Provide information on the database

* Suggest any changes that you need to make to the database before you start the upgrade

* Perform some of the pre-upgrade tasks on the database.

Prerequisites The directory where the upgrade scripts are installed is called ora_upgrade. By default, the scripts are installed as part of the SAP bundle patch in the relevant Oracle 11.2 software home directory:

/oracle/<DBSID>/11204/sap/ora_upgrade

Procedure

1. Change to the correct directory by entering the relevant command:

cd /oracle/<DBSID>/11204/sap/ora_upgrade/pre_upgrade

2. Execute the following commands to perform pre-upgrade tasks, which can improve the performance of the upgrade pro-

cess:

sqlplus / as sysdba SQL> spool pre_upgrade_tasks.log SQL> @pre_upgrade_tasks.sql SQL> spool off

3. Execute the following commands to check the pre-upgrade status of your database:

sqlplus / as sysdba SQL> @pre_upgrade_status.sql

Result

You can check the results of the pre-upgrade scripts by looking at the following log files:

pre_upgrade_status.log

pre_upgrade_tasks.log

Photo

Photo

Photo

3 Database Upgrade 3.1 Backing Up the Oracle Database You must have a complete and

3 Database Upgrade

3.1 Backing Up the Oracle Database

You must have a complete and usable database backup otherwise you might lose data if the upgrade fails.

Procedure

1. Create a complete database backup.

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.2 Shutting Down the SAP System and Oracle Listener Process

You need to shut down the SAP system. If there is an Oracle listener process running in the current ORACLE_HOME, shut it down.

Procedure 1.Stop the SAP application instances by entering the following command as user <sapsid>adm:

stopsap r3 You can also stop the SAP application server with the sapcontrol tool.

2. Stop the Oracle listener by entering the following command as the Oracle database software owner, user

<ora_sw_owner>:

lsnrctl stop

3.3 Starting the Database Upgrade Assistant To upgrade the database structure, you need to start

3.3 Starting the Database Upgrade Assistant

To upgrade the database structure, 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 Make sure that the DISPLAY environment variable is correctly set, as described in Checking and Setting the DISPLAY En- vironment Variable Ensure that you have write permissions on /etc/oratab or /var/opt/oracle/oratab, depending on your operating system.

Procedure

Start the DBUA.dbua.sap.sh is a wrapper script to automate most of the post-upgrade tasks.

1. Set ORACLE_HOME_SRC and ORACLE_HOME_TGT.

Enter these commands to upgrade from 10.2.0.x to 11.2.0.4:

setenv ORACLE_HOME_SRC /oracle/<DBSID>/102_64 setenv ORACLE_HOME_TGT /oracle/<DBSID>/11204

2.

Change to the correct directory:

cd

$ORACLE_HOME_TGT/sap/ora_upgrade/post_upgrade

3.Run this script in query mode initially to verify that the environment for the upgrade is correct:

./dbua.sap.sh -q

4. Run this script as follows to perform the upgrade

For interactive mode, enter the following command:

./dbua.sap.sh

5. Respond appropriately to the DBUA dialogs:

The DBUA automatically removes the database initialization parameters that are now obsolete in Oracle Database 11g Re-

lease 2 (11.2). The upgrade process itself runs for some time, depending mainly on the size of the database and the capacity of the hard- ware. When the DBUA has completed successfully the results of the upgrade are displayed.

Photo1 , photo2 and photo3

Photo1 , 2

Photo1 , 2

Photo3

Photo3

3.4 Copying and Adapting the SQL*Net Files After the database software installation, you must copy

3.4 Copying and Adapting the SQL*Net Files

After the database software installation, you must copy the old SQL*Net files, that is, listener.ora, sqlnet.ora, and tns-

names.ora, and adapt them as described below.

Procedure

1. Log on as the Oracle database software owner, user <ora_sw_owner>.

2. copy files from <old_ORACLE_HOME>/network/admin to <new_ORACLE_HOME>/network/admin.

3. Edit the new SQL*Net files by adapting all file paths for the new directory. Be sure to adapt the value of ORA-

CLE_HOME in the listener.ora file.

4. If not available, add the following entry to the file listener.ora:

ADR_BASE_<listener_name> = /oracle/DBSID/saptrace

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 Post - Upgrade Steps 4.1Finalizing the Environment of the ora<dbsid> User You need to

4 Post-Upgrade Steps

4.1Finalizing the Environment of the ora<dbsid> User

You need to make sure that the changes you made to the Oracle user environment are permanently stored in the profiles (.cshrc, .dbenv_<hostname>.csh, .dbenv_<hostname>.sh, dbenv.sh, .dbenv.csh).

Procedure Check the values for the environment variables as below # env

Make sure that the environment does not contain any variables that still refer to the old database release. In particular, make

sure that ORACLE_HOME is set to the runtime Oracle home:/oracle/<DBSID>/112_64.

4.2 Checking the Upgraded Database

You need to check the upgraded database

Procedure Check that the database is now running with Oracle Database 11g Release 2 (11.2) software in an Oracle Database 11g Re- lease 2 (11.2) environment by entering the following commands:

1. Log on to the database as the ora<sid> user.

2. Change to the correct directory:

cd $ORACLE_HOME/sap/ora_upgrade/post_upgrade

3. Enter the following command to start SQL*Plus:

sqlplus / as sysdba

4. Run post_upgrade_status.sql:

SQL> @post_upgrade_status.sql Check the log post_upgrade_status.log.

4.3 Updating BR*Tools

You update BR*Tools to the latest release, with the latest patch level. Download the most current version of the BR*Tools from SAP Service Marketplace at:http://service.sap.com/swdc

4.4 Performing Post - Upgrade Tasks You need to perform certain post - upgrade tasks.

4.4 Performing Post-Upgrade Tasks

You need to perform certain post-upgrade tasks.

1. Check database compatibility by executing the following command:

SQL> show parameter compatible If set to a value less than 11.2.0, change database compatibility by entering the following as the Oracle database software owner, user <ora_sw_owner>:

cd $ORACLE_HOME/sap/ora_upgrade/post_upgrade SQL> conn / as sysdba

SQL> @set_compatible

2. Gather Oracle optimizer statistics by executing the following commands as the <ora_sw_owner> user:

brconnect -u / -c -f stats -t system_statsbrconnect -u / -c -f stats -t oradict_stats.

3. Check the Oracle database parameters against SAP Note 1431798 and adjust them if necessary.

To see the parameter value SQL > show parameter <parameter_name> ;

To set the parameter SQL > alter system set <parameter_name>=value’, scope=spfile;

4. Update the Oracle database statistics with BRCONNECT as follows:

brconnect -u / -c -f stats -t all -f collect -p 4

5. Run post_ugprade_status.sql.

Open a command prompt and change to the directory <new_oracle_home>/sap/ora_upgrade/post_ugprade. From this directory start sqlplus.exe and enter the following commands:

SQL>connect / as sysdba

SQL>@post_upgrade_status.sql

This provides an overview of the status of the upgraded database.

4.5 Backing Up the Database You need to back up your upgraded Oracle Database 11g

4.5 Backing Up the Database

You need to back up your upgraded Oracle Database 11g database.

Procedure Perform a full database backup.

4.6 Starting the Listener Process

Start the listener:

lsnrctl start

4.7 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 Oracle database software owner, user <ora_sw_owner>:

chmod 755 $ORACLE_HOME

4.8 Updating the Oracle Instant Client

You need to ensure that the SAP system runs with at least Instant Client release recommended in SAP Note 819829.

NOTE If you have a SAP 7.XX EXT kernel, you must install the current 11g Instant Client.

Prerequisites For the required Instant Client release, see SAP Note 819829.

Procedure Update the Oracle Database Instant Client for UNIX as described in SAP Note 1431794.

Photo and detail

Oracle client and photo

Oracle client and photo

4.9 Update latest sap kernel

4.9 Update latest sap kernel

SAP kernel

SAP kernel

4.10 Changing the Environment for the <sapsid>adm user You have to change the environment for

4.10 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.

Procedure

1. On the database server, set the ORACLE_HOME environment variable to point to the location of the Oracle Database

11g software installation, for example:/oracle/<DBSID>/112_64

2. Make sure that the change to the user environment is permanently stored in the profiles (.cshrc, .dbenv_<hostname>.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

4.11 Updating the SQL*Net Configuration Files for the <sapsid>adm and ora<sid> Users

You need to update the tnsnames.ora file for the <sapsid>adm and ora<sid> users after the upgrade:

For the ora<sid> user, you need to adapt the SQL*Net files are located in the directory $ORACLE_HOME/network/admin. For the <sapsid>adm user, you need to adapt the SQL*Net files that are located in the directory pointed to by the environ- ment variable TNS_ADMIN.

You do not need to perform this procedure for the Oracle software owner oracle.

Procedure

Add the following entry to the tnsnames.ora file that is used by the <sapsid>adm user:

LISTENER_<DBSSID>.WORLD = (ADDRESS = (COMMUNITY = SAP.WORLD)(PROTOCOL = TCP)(HOST = <hostname>)(PORT = <listener_port>))

4.12 Checking SAP Profile Parameters You have to check the following SAP profile parameters DIR_ORAHOME

4.12 Checking SAP Profile Parameters

You have to check the following SAP profile parameters DIR_ORAHOME DIR_CLIENT_ORAHOM DIR_SERVER_ORAHOME

Procedure

1. Set DIR_ORAHOME and DIR_CLIENT_ORAHOME in the instance profiles to the corresponding values of the ORA-

CLE_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

Oracle database software owner, user <ora_sw_owner>, on the database server.

4.13 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.

photo