upgrade to oracle database 11g release 2 (11.2)_windows

56
Database Upgrade Guide Upgrade to Oracle Database 11 Release 2 (11.2): Windows Based on Oracle Patch Set Release 11.2.0.2 and 11.2.0.3 Target Audience Technology Consultants System Administrators Database Administrators Developers PUBLIC Document version: 2.20 – 2012-02-13

Upload: renato-silva

Post on 20-Oct-2015

225 views

Category:

Documents


19 download

TRANSCRIPT

  • Database Upgrade GuideUpgrade to Oracle Database 11 Release 2 (11.2): WindowsBased on Oracle Patch Set Release 11.2.0.2 and 11.2.0.3

    Target Audience Technology Consultants System Administrators Database Administrators Developers

    PUBLICDocument version: 2.20 2012-02-13

  • 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 .ExampleExample

    Arrows separating the parts of a navigation path, for example, menu options

    Example Emphasized words or expressionsExample Words or characters that you enter in the system exactly as they appear in the

    documentationhttp://www.sap.com Textual cross-references to an internet address/example Quicklinks added to the internet address of a homepage to enable quick access to specific

    content on the Web123456 Hyperlink to an SAP Note, for example, SAP Note 123456Example Words or characters quoted from the screen. These include field labels, screen titles,

    pushbutton labels, menu names, and menu options. Cross-references to other documentation or published works

    Example Output on the screen following a user action, for example, messages Source code or syntax quoted directly from a program File and directory names and their paths, names of variables and parameters, and

    names of installation, upgrade, and database toolsEXAMPLE 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

    2/56 PUBLIC 2012-02-13

  • Document History

    CAUTIONBefore you start the implementation, make sure you have the latest version of this document. You can find the latest version on SAP Service Marketplace http://service.sap.com/instguides.

    The following table provides an overview on the most important document changes:Version Date Description2.20 2012-02-13 Major update for patch set release 11.2.0.3

    Version Date Description2.10 2011-12-14 Minor changes in chapters MSCS Only: Setting Up a Shared Database Directory in Oracle

    Home and Changing the Registry Value of Oracle Autostart

    Version Date Description2.00 2011-05-17 Major update for Oracle Patch Set Release 11.2.0.21.00 2010-06-02 Initial Version

    2012-02-13 PUBLIC 3/56

  • Table of Contents

    Chapter 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.1 New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2 SAP Notes for the Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.3 More Information on SAP Service Marketplace . . . . . . . . . . . . . . . . . . . . . . . . 10

    Chapter 2 Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1 Checking the Original Version of Your Database . . . . . . . . . . . . . . . . . . . . . . . 112.2 Checking Hardware and Software Requirements . . . . . . . . . . . . . . . . . . . . . . . 122.3 Checking Additional Requirements for the Upgrade . . . . . . . . . . . . . . . . . . . . 122.4 Using Multiple Oracle Homes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5 Checking the SAP System Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    Chapter 3 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.1 MSCS Only: Removing the Database from the Cluster Group . . . . . . . . . . . . . 153.2 MSCS Only: Upgrading to OFS 3.4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    Chapter 4 Oracle Database Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.1 Installing the Oracle Database Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.1.1 Installing the Oracle 11g Server Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.1.2 Installing Required Patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.3 Updating the Oracle Client Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2 Copying and Adapting the SQL*Net Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.3 Backing Up the Oracle Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.4 Changing the Environment for User adm . . . . . . . . . . . . . . . . . . . . . 244.5 Performing the Database Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Chapter 5 Post-Upgrade Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.1 Changing Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.2 Creating the Oracle TNSListener Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.3 MSCS Only: Setting Up a Shared Database Directory in Oracle

    Home . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.4 Changing the Registry Value of Oracle Autostart . . . . . . . . . . . . . . . . . . . . . . 32

    4/56 PUBLIC 2012-02-13

  • 5.5 Checking the Start Up Type of the Oracle Services . . . . . . . . . . . . . . . . . . . . . 325.6 Updating the SAP Executables and the BR*Tools . . . . . . . . . . . . . . . . . . . . . . . 335.7 Performing Post-Upgrade Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355.8 Deleting the Old Oracle Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365.9 MSCS Only: Adding the Database to the Cluster Group . . . . . . . . . . . . . . . . . 375.10 Backing Up the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395.11 Configuring the New Features for Oracle Database 11g Release 2

    (11.2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    Chapter 6 Common Administration Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416.1 Starting and Stopping the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416.1.1 Starting and Stopping the Database in a Standard Configuration . . . . . . . . . . 416.1.2 Starting and Stopping the Database in an MSCS Configuration . . . . . . . . . . . . 426.2 Checking Oracle Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436.3 Starting and Stopping Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446.4 Changing or Deleting Oracle Database Parameters . . . . . . . . . . . . . . . . . . . . . 456.5 Determining the Value of SAP System Profile Parameters . . . . . . . . . . . . . . . . 466.6 Moving Groups or Services and Applications for MSCS . . . . . . . . . . . . . . . . . . 466.7 Starting and Stopping the SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    Chapter A Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51A.1 Using Powershell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    2012-02-13 PUBLIC 5/56

  • This page is left blank for documents that are printed on both sides.

  • 1 Introduction

    This documentation explains how to upgrade the Oracle database for the SAP system on the Windows operating system: From source release Oracle Database 10g Release 2 (10.2.0.4 or 10.2.0.5), or Oracle Database 11g

    Release 2 (11.2.0.1, or 11.2.0.2) To target release Oracle Database 11g Release 2 (11.2) (11.2.0.2 or 11.2.0.3 or higher)This guide is suitable for both major release upgrades (for example, from Oracle 9.2.0.8 or Oracle 10.2.0.5 to Oracle 11.2.0.2 or Oracle 11.2.03) and for patch set upgrades (for example, from Oracle 11.2.0.1 to 11.2.0.2 or 11.2.0.3). In both cases, the upgrade target release is the current 11.2 patch set release.This guide does not cover upgrades of Oracle databases with Real Application Clusters (RAC) Automatic Storage Management (ASM), or Exadata. We plan to document these at a later date.

    CAUTIONOracle 11.2 is only supported for SAP systems with an EX2 kernel or higher.

    This documentation only covers the standard upgrade from Oracle 10.2.0.4 or higher to Oracle Database 11g Release 2 (11.2) using the Oracle Database Upgrade Assistant.

    NOTEOracle offers and supports direct database upgrades from Oracle 9.2.0.8 to Oracle 11.2, but we do not describe this in this document. For more information, see Checking the Original Version of Your Database [page 11].

    CAUTIONUser Account Control on Windows: As of Windows Server 2008, the Windows standard security settings only grant administrative privileges to an account being a member of the local administrators group, if the process was started elevated (Run as Administrator). This means that during the installation and upgrade process of an Oracle database software, most of the statements must be executed with administrative privileges. Therefore, when you are asked to open a command prompt (cmd.exe) or a Powershell prompt (powershell.exe), or other tools like the Oracle Failsafe Manager, you have to open it in elevated mode (right-click on cmd.exe, and choose Run as Administrator). For more information about User Account Control (UAC), see the Windows documentation.

    1 Introduction

    2012-02-13 PUBLIC 7/56

  • Implementation Considerations For more information about implementation considerations, including the most important SAP

    Notes for the upgrade, see Planning [page 11]. 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 at http://service.sap.com/notes

    You might find useful information for the upgrade in the following Oracle documentation:Oracle 11gR2 Upgrade Companion [ID 785351.1]

    You use the tools Oracle Universal Installer (OUI), Opatch, Oracle SQL*Plus, and Oracle Database Upgrade Assistant (DBUA) to perform the upgrade.

    MSCS only: If your system is configured to run with Microsoft Cluster Service (MSCS) you have to perform additional steps. These are necessary to include the additional MSCS nodes of the system in the upgrade procedure and to deal with cluster-specific features. Steps that must be performed for an MSCS configuration are marked with MSCS only in this documentation.The cluster nodes that a particular step has to be executed on can be the: First node, which is the primary node where the database server is located Additional node for any secondary MSCS node

    The database server and database client must be in the same Windows domain. For information on permitted domain names see SAP Note 314671.

    Terminology and Naming Conventions We use for the database instance identifier and for the SAP system identifier.

    These can be different if your SAP system uses Multiple Components in One Database (MCOD). To have a common documentation layout for UNIX and Windows in this documentation, we

    use / (slash) in SQL commands. Do not use / (slash) in command prompts for path separation. We use the terms central instance and dialog instance in this document. As of SAP NetWeaver

    7.1, these terms have been replaced by primary application server instance and additional application server instance.

    MSCS only: As of Windows Server 2008 there are the following terminology changes for a cluster configuration: The cluster feature is now called Failover Clustering. For practical reasons we are continuing to

    use the previous terminology Microsoft Cluster Service and abbreviation MSCS in this guide. Cluster groups are now called services and applications.

    In some sections that are also valid for Windows Server 2008 (R2) in a high-availability environment we are continuing to use only the old term. In this case, cluster group also means service and application.

    The Cluster Administrator is now called Failover Cluster Manager.

    1 Introduction

    8/56 PUBLIC 2012-02-13

  • 1.1 New FeaturesFor the complete list of new features of the Oracle Database 11g Release 2 (11.2), see the New Features documentation from Oracle.

    RECOMMENDATIONEspecially when you are performing a major release upgrade that is, when when you upgrade from 9i or 10g we recommend that you check the most important new features in the Oracle documentation.

    You can access the complete Oracle documentation at the Oracle Technology Network (OTN) website at www.oracle.com/technology.

    More InformationConfiguring the New Features for Oracle Database 11g Release 2 (11.2) [page 39]

    1.2 SAP Notes for the UpgradeMake sure that you read the following SAP Notes:Number Title Remarks1431800 Oracle 11.2.0: Central Technical

    NoteProvides a starting point for information about Oracle 11g with multiple links to notes on Oracle 11g.

    1458580 Oracle Upgrade to 11g Release 2 (11.2) on Windows

    Information about the upgrade and corrections to this guide.

    1398634 Oracle Database 11g: Integration into the SAP environment

    Provides information about integration of Oracle 11g products and options within SAP

    1431798 Oracle 11.2.0: Database Parameter Settings

    Provides information about Oracle initialization parameters that need to be reset to their default values or that need to be removed

    1431796 Oracle 11.2.0: Troubleshooting the Software Installation

    Describes software installation problems and solutions or workarounds

    1431797 Oracle 11.2.0: Troubleshooting the Database Upgrade

    Describes database upgrade problems and solutions or workarounds

    1431799 Oracle 11.2.0: Current Patch Set Describes the current Oracle patch set1503709 Oracle 11.2.0: Patches / Patch

    collections for 11.2.0.2Lists the status of Oracle patches and bundle patches for 11.2.0.2

    1631931 Oracle 11.2.0: Patches / Patch collections for 11.2.0.3

    Lists the status of Oracle patches and bundle patches for 11.2.0.3

    1431793 Oracle 11.2.0 Upgrade Scripts Describes the shell and SQL upgrade scripts for 11.2.0998004 Update the Oracle Instant Client on

    WindowsRequired for upgrading Oracle client software to Oracle 11g Release 2 (11.2)

    850306 Oracle Critical Patch Update Program

    Describes the current Oracle security fixes

    1 Introduction1.1 New Features

    2012-02-13 PUBLIC 9/56

  • Number Title Remarks134592 Importing the SAPDBA role

    (sapdba_role.sql)Describes how to update the SAPDBA role after the upgrade

    834917 Oracle Database 10g: New database role SAPCONN

    Describes the new SAPCONN role, which replaces the native CONNECT role from Oracle

    839182 Using OPatch to install Oracle patches

    Describes how to use OPatch with Oracle Windows only

    1027012 MOPatch Install Multiple Oracle Patches in One Run

    Describes how to use MOPatch with Oracle UNIX only

    1430669 BR*Tools Support for Oracle 11g Describes the support offered by BR*Tools for Oracle 11g1519872 SAP Database User Profile

    SAPUPROFDescribes the configuration of an SAP installation with the SAP-specific database user profile SAPUPROF

    1.3 More Information on SAP Service MarketplaceYou can find more information as following on SAP Service Marketplace:Description Internet Address TitleSAP Notes http://service.sap.com/notes NoneOracle Database Administration

    www.sdn.sap.com/irj/sdn /ora SAP ON ORACLE KNOWLEDGE CENTER SAP Documentation

    SAP Database Guide: Oracle

    SAP Software Distribution Center

    http://service.sap.com/swdc None

    Oracle Database Upgrade Guide that is, the guide you are now reading

    http://service.sap.com /instguides Database Upgrades

    Oracle

    Upgrade to Oracle Database : Windows

    Oracle download area for patches and software

    https://service.sap.comoracle-download

    Oracle Download Area

    1 Introduction1.3 More Information on SAP Service Marketplace

    10/56 PUBLIC 2012-02-13

  • 2 Planning

    RECOMMENDATIONBefore the production upgrade, make sure that you perform a test upgrade on your backup system.

    1. You check the original version of your database [page 11].2. You check the hardware and software requirements [page 12].3. You check additional requirements for the upgrade [page 12].4. You decide whether you want to use multiple Oracle homes [page 13].5. You check the SAP System prerequisites [page 13].

    2.1 Checking the Original Version of Your DatabaseYou need to check the original version of the database you want to upgrade and, if necessary, obtain more information.

    PrerequisitesIn the following special cases you need to obtain more information: If you are upgrading from Oracle 10.2 to Oracle Database 11g Release 2 (11.2) in manual mode (in

    this guide we only describe the database upgrade using the DBUA) If the source database runs Oracle 10.2.0.2, you need to first upgrade the source database to at

    least patch set 10.2.0.5.

    Process1. 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 Enter the following commands:

    sqlplus / as sysdbaSQL> select version from v$instance;

    2. For more information in the special cases mentioned above, see the documentation for the Oracle Database 11g Release 2 (11.2) upgrade at the Oracle Technology Network (OTN) website.

    2 Planning2.1 Checking the Original Version of Your Database

    2012-02-13 PUBLIC 11/56

  • 2.2 Checking Hardware and Software RequirementsProcedureYou 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.You can access the complete Oracle documentation as a member of the Oracle Technology Network (OTN).

    2.3 Checking Additional Requirements for the UpgradeYou need to check the additional requirements for the Oracle database upgrade as described in this section.

    Procedure1. Make sure you have read the SAP Notes for the upgrade [page 9], which you can find at

    http://service.sap.com/notesDownload the recommended documents from My Oracle Support (formerly Oracle Metalink) at https://support.oracle.com. For access to My Oracle Support, see SAP Note 758563.

    2. 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. To check for your application or product, see the Product Availability Matrix (PAM) at http://service.sap.com/pam.

    NOTEThere is no general release provided for older SAP releases 3.1I up to and including 4.6C. For these older releases, only an upgrade certification is provided for valid upgrade paths for more information, see SAP Note 1398634. For upgrade certification, the SAP kernel needs to be EXT kernel (for releases 3.1 up to and including 4.5B) or EX2 kernel (for release 4.6C).If you have a 640_REL kernel, you need to switch to the 640_EX2 kernel immediately after the database upgrade to Oracle 11.2. We do not support running a 640_REL kernel with the Oracle 11.2 database.

    3. Download the Oracle Database 11g Release 2 (11.2) installation guide for your operating system from the Oracle Technology Network (OTN).You need this document to review the hardware and software requirements.

    4. Download the Oracle Database 11g Release 2 (11.2) software and the latest patch sets and required patches or patch collection.The SAP Note with the list of patches is referenced in SAP Note 1431800. You can download the patches from:http://service.sap.com/oracle-download

    2 Planning2.2 Checking Hardware and Software Requirements

    12/56 PUBLIC 2012-02-13

  • CAUTIONThe patches listed in the SAP Note referenced in SAP Note 1431800 are mandatory. To avoid severe database problems, make sure that you install all these patches.

    5. Download the latest version of the Oracle 11.2 Instant Client software from:http://service.sap.com/oracle-download

    6. Download the latest version of the DBATOOLS (BR*Tools) to be used immediately after the database upgrade from:http://service.sap.com/swdcBR*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) . For more information, see SAP Note 1430669.

    2.4 Using Multiple Oracle HomesBefore the upgrade or migration, you need to decide whether you want to set up multiple Oracle Homes as this influences the procedure.Oracle allows multiple Oracle Homes for specific database versions. This means that more than one version of the database software can exist in different Oracle Home directories on the same host.

    NOTEMSCS only:Multiple Oracle Homes are not supported in a MSCS configuration. During the upgrade or migration there are temporarily two Oracle Homes. However, the old Oracle Home is deleted at the end of the migration or upgrade procedure. Note however that the Oracle Fail Safe software is installed in its own Oracle Home.

    Multiple Oracle Homes are necessary: If two different databases are installed on the same computer and use different Oracle releases Temporarily, while a migration or an upgrade to Oracle 11g is being performed. The new Oracle

    software must be installed in a new Oracle Home directory.

    2.5 Checking the SAP System PrerequisitesProcedure1. For SAP systems 7.XX when you are performing a major release upgrade, apply SAP Notes

    1416108, 1414733, and 1433301 if you are running any of the following support packages: SAP_BASIS 7.00 SP21 SAP_BASIS 7.01 SP06 SAP_BASIS 7.02 SP02 SAP_BASIS 7.10 SP10

    2 Planning2.4 Using Multiple Oracle Homes

    2012-02-13 PUBLIC 13/56

  • SAP_BASIS 7.11 SP05 SAP_BASIS 7.20 SP02This resolves an error in an ABAP program that causes it to report problems during the consistency checks within transaction SE14. This error is seen only after the database has been upgraded to Oracle 11.2.The error is fixed in later support packages.

    2. If your SAP system is SAP BASIS 7xx, apply the advanced correction from SAP Note 1417124This correction resolves an Oracle issue that results in an ABAP short dump during statistics updates.

    3. If your SAP system uses SAP Kernel 711, you need to use DBSL (dboraslib.so) patch level 81 or higher.For more information, see SAP Note 1456323.

    2 Planning2.5 Checking the SAP System Prerequisites

    14/56 PUBLIC 2012-02-13

  • 3 Preparation

    You have to complete the following preparations:1. MSCS only: You remove the database from the cluster group [page 15].2. MSCS only: You upgrade to Oracle Fail Safe 3.4.2 [page 16].

    3.1 MSCS Only: Removing the Database from the Cluster Group

    In an MSCS configuration, you have to remove the SAP database from the Oracle cluster group before you begin the upgrade.

    ProcedureNOTEPerform the steps on the first MSCS node only. The database must be located on the first MSCS node.

    1. Stop all application servers connecting to the database.2. In the Cluster Administrator (Windows Server 2003) or Failover Cluster Manager (Windows Server 2008

    (R2), take the SAP instances in the SAP resource group offline.3. In the Cluster Administrator (Windows Server 2003) or Failover Cluster Manager (Windows Server 2008

    (R2), move all groups to the first MSCS node.4. Start the Oracle Fail Safe Manager as the user under which the Cluster Service is running.5. Choose Groups Oracle Cluster Resources and right-click .world

    NOTESometimes the name of cluster resource is only.

    6. Choose Remove from Group.7. In the dialog box Confirm Remove Database from Group, choose Yes.

    The Clusterwide operation window displays the steps that are executed to remove the database from the cluster group. The last line informs you that The clusterwide operation completed successfully.

    8. In the Clusterwide operation window, choose Close.9. Exit the Fail Safe Manager.

    3 Preparation3.1 MSCS Only: Removing the Database from the Cluster Group

    2012-02-13 PUBLIC 15/56

  • 3.2 MSCS Only: Upgrading to OFS 3.4.2If the MSCS configuration is still running with Oracle Fail Safe Software (OFS) version lower than 3.4.2, you must upgrade to version 3.4.2To do this, you first have to deinstall the old Oracle Fail Safe software on all MSCS nodes and then install the Oracle Fail Safe 3.4.2 software on a local disk on all nodes.

    CAUTIONMake sure that you install the Oracle Fail Safe 3.4.2 software in the same Oracle Home on all MSCS nodes.

    Prerequisites You are logged on as user adm The Cluster Service is started on all MSCS nodes.

    For more information, see Starting and Stopping Services for MSCS [page 44].

    ProcedureDeinstalling the Old Oracle Fail Safe Software1. Make sure that the Oracle Fail Safe Manager is closed.2. Uninstall the old OFS software on all MSCS nodes, as follows:

    NOTEWhile you are uninstalling the software on a particular MSCS node, do not reboot the other node.

    1. Start the Oracle Universal Installer from the Oracle RDBMS DVD. If you use the Start menu, double-click the following file:

    :\OFS3.4.2\SAP\sapofs.cmd If you use a Powershell [page 51] script, enter the following command:

    :\OFS3.4.2\SAP\sapofs.ps12. In the Welcome screen, choose Installed Products.3. In the Inventory window, expand and select Oracle Fail Safe .4. Choose Remove.5. In the Confirmation dialog box, confirm that you wish to delete the selected products.6. Click Exit to close the Oracle Universal Installer.

    3. If you use a 64-bit system, you also have to deinstall the old Oracle Fail Safe client software on all nodes, using the .32-bit Oracle Universal Installer from the Oracle RDBMS DVD:1. Start the Oracle Universal Installer from the Oracle RDBMS DVD.

    If you use the Start menu, double-click the following file::\OFS3.4.2\SAP\sapofs.cmd

    3 Preparation3.2 MSCS Only: Upgrading to OFS 3.4.2

    16/56 PUBLIC 2012-02-13

  • If you use a Powershell [page 51] script, enter the following command::\OFS3.4.2\SAP\sapofs.ps1

    2. In the Welcome screen, choose Installed Products.3. In the Inventory window, select OFSCLI and choose Remove.4. In the Confirmation dialog box, confirm that you wish to delete the selected product.

    Installing the Oracle Fail Safe Software1. In the Cluster Administrator, make sure that the:

    Other MSCS nodes are not set to Pause. SAP group is offline on the node where you are installing.

    2. Make sure that the Cluster Server service is started on all MSCS nodes.3. Start the Oracle Universal Installer from the Oracle RDBMS DVD.

    If you use the Start menu, double-click the following file::\OFS3.4.2\SAP\sapofs.cmd

    If you use a Powershell [page 51] script, enter the following command::\OFS3.4.2\SAP\sapofs.ps1

    The installer opens and guides you through the installation process.NOTEIf the installer aborts and an error is displayed in an Application Error window with the text The exception unknown software exception ..., check the TMP and TEMP variables. In the user environment of adm, make sure that these refer to existing files. If not, reset them.

    Screen EntryWelcome Choose Next.Select Installation Type Choose Typical, and then Next.Specify Home Details For Name:

    Enter the name of the Oracle Home for the Oracle Fail Safe software.The Fail Safe software must be installed in a separate Oracle Home directory, for example, OFS

    NOTEIf Oracle Fail Safe version 3.3.2 or 3.3.4 was previously installed, we strongly recommend that you use the old Oracle Fail Safe Home for 3.4.2.

    For Path:Enter the path of the Oracle Home directory for the Oracle Fail Safe software. It must be on a local disk, for example:F:\Oracle\OFS

    Reboot Needed After Installation Choose Next.Summary View the information and choose Install.Install Wait while the software is installed.Configuration Tools In the dialog box Oracle Fail Safe Account/Password, enter the account

    and password under which the Oracle Fail Safe software is to run.

    3 Preparation3.2 MSCS Only: Upgrading to OFS 3.4.2

    2012-02-13 PUBLIC 17/56

  • Screen EntryThe account has to be a member of the local administrators and the ora__dba groups on both cluster nodes.The adm user fulfills these requirements.If you choose to use adm, you have to update the account information for the Oracle Services for MSCS Service after every password change of the adm user. To do this, choose Start

    All Programs Oracle OFS Oracle Service for MSCS Security Setup on all cluster nodes.

    End of Installation Click Exit to leave the installer.4. Reboot and log on again.

    CAUTIONDo not reboot an MSCS node, if the installation of the OFS software or the deinstallation of earlier releases is in progress on another node.

    3 Preparation3.2 MSCS Only: Upgrading to OFS 3.4.2

    18/56 PUBLIC 2012-02-13

  • 4 Oracle Database Upgrade

    This section describes how to upgrade the Oracle database.1. You install the Oracle 11.2 software [page 19].2. You copy and adapt the old Oracle SQL*Net files [page 22].3. You run the pre-upgrade scripts.4. You back up the Oracle database [page 23].5. You change the environment for user adm [page 24].6. You upgrade the Oracle database [page 24].

    NOTEIf you have problems during the upgrade, see SAP Note 1431797.

    4.1 Installing the Oracle Database SoftwareThe following sections describe how to install the Oracle server software, and update the Oracle instant client software. It also includes information about the current patches to install.

    4.1.1 Installing the Oracle 11g Server SoftwareAs of Oracle 11.2.0.2, Oracle database patch sets are full installations of the Oracle database software. For more information about identifying and installing the correct Oracle database software version, see SAP note 1431799.

    PrerequisitesYou have stopped the SAP system (not the database instance) with the SAP MMC. For more information, see Starting and Stopping the SAP System [page 47].

    ProcedureCAUTIONIf you copy the files from the RDBMS media to a local disk, do not use directory names containing blanks.

    NOTE You need 5-10 GB disk space for the Oracle server software.

    4 Oracle Database Upgrade4.1 Installing the Oracle Database Software

    2012-02-13 PUBLIC 19/56

  • Make sure that you have enough space for the Oracle inventory and that you have full access to the directories (inventory, installation location, temp directory). Otherwise, the Oracle Universal Installer cannot perform installation prerequisite checks.

    MSCS only: You have to install the Oracle database server software on all MSCS nodes.

    1. Log on as adm user.2. On the database server, make the Oracle RDBMS media available change to the directory:

    :\database\SAP\3. Start the Oracle Universal Installer (OUI) by double-clicking the file sapserver.cmd.

    NOTE You cannot directly invoke sapserver.cmd, if you use UNC paths (\\

    \\sapserver.cmd). Instead, you must map a drive letter to the shared directory and start sapserver.cmd via the drive letter.

    You can also use the Powershell script sapserver.ps1 which you can also use with UNC paths to start the OUI. To run the script, do not double-click on it, since this by default in the Windows explorer opens the edit mode. Instead, right-click on it and execute it with Powershell.For more information about Powershell, see Using Powershell [page 51].

    For support reasons, do not use the setup.exe file in the directory :\database\. Using sapserver.cmd or sapserver.ps1 guarantees a unique setup of the ORACLE_HOME that is common to SAP systems.

    Windows Server 2008 (R2) with activated UAC: If you have drive letters that were created in unelevated mode, you cannot access them in elevated mode. Therefore, if you want to double-click sapserver.cmd, you have to copy the Oracle RDBMS media to a local disk. If you want to invoke sapserver.cmd from within a command prompt or Powershell window, you have to elevate (run as administrator) the command prompt or Powershell window before you create the network drive.

    If a command prompt window appears, specify the drive letter of the local disk where you want to install the Oracle software, and the . The command prompt window only appears if you perform a new installation (under a different user), or if the ORACLE_HOME and are not set.

    4. In the Oracle Universal Installer, enter the information as shown in the following table:Installing the Oracle 11.2.0 Database SoftwareWindow TaskConfigure Security Updates Do not select the check box I wish to receive security updates via My Oracle

    Support.Choose Next.The installer issues a warning.Choose Yes.

    4 Oracle Database Upgrade4.1 Installing the Oracle Database Software

    20/56 PUBLIC 2012-02-13

  • Window TaskDownload Software Updates Select Skip software updates, and then Next.Select Installation Option Confirm the default selection Install database software only and then choose

    Next.Grid Installation Options Confirm the default selection Single instance database installation and then

    choose Next.Select Product Languages Confirm the default option English and then choose Next.Select Database Edition Confirm the default option Enterprise Edition and then choose Next.Specify Installation Location This window displays the value for ORACLE_BASE, which must be set in

    the environment to :\oracle.It also displays the value for ORACLE_HOME, which is\oracle\\1120 (where 1120 is the Oracle version number, for example, 11202 for Oracle 11.2.0.2, 11203 for Oracle 11.2.0.3, and so on).Choose Next.

    Perform Prerequisite Checks This window checks if all the required system prerequisites for the installation of the database software have been met. If some of the checks are displayed as Failed, you can fix these problems and run the check again by choosing Check Again.

    RECOMMENDATIONWe strongly recommend you to make sure that there are no failed checks before starting the software installation.

    Summary Review the information displayed in this window and choose Finish or Install.

    Install Product This window shows the progress of the installation.You can monitor the installation progress details in an additional window.

    Finish After the installation has finished successfully, choose Finish and close the Oracle Universal Installer.

    5. Install the required Oracle patches [page 21] (if available).NOTEMSCS only:You have to install the Oracle patches on all MSCS nodes.

    4.1.2 Installing Required PatchesAfter the database software installation, you need to install all required Oracle database patches, which on Windows include one patch collections and one or more additional (generic) patches.For Oracle 11.2.0.2, check SAP Note 1503709 for the patches to be installed.For Oracle 11.2.0.3, check SAP Note 1631931 for the patches to be installed.You can download the patches from:http://service.sap.com/oracle-download Oracle 11.2.0.

    4 Oracle Database Upgrade4.1 Installing the Oracle Database Software

    2012-02-13 PUBLIC 21/56

  • PrerequisitesUse an up-to-date version of OPatch to install the patches. Check SAP Note 839182 for instructions on how to use OPatch.

    Procedure1. Log on as adm user.2. Install the patches, following the instructions in the relevant README file.

    NOTE The patch collection README file uses the term bundle patch instead of patch

    collection. MSCS only: You have to install the patches on all MSCS nodes.

    4.1.3 Updating the Oracle Client SoftwareYou have to update the Oracle Instant Client software to the current version of your release (11.2.0.x).

    Procedure1. Stop the central instance and dialog instance (if available)2. Apply SAP Note 998004 on the central instance and dialog instance host.3. Do not restart the central instance and dialog instance (if available).

    4.2 Copying and Adapting the SQL*Net FilesAfter the database software installation, you must copy and modify the old SQL*Net files, that is, listener.ora, sqlnet.ora, and tnsnames.ora.

    ProcedureNOTEIf you have multiple instances in the old Oracle_Home, you have to perform steps 1 to 4 only once before you upgrade the first database instance.

    1. Log on as user adm.2. Copy the profiles of SAP BR*Tools:

    copy /database/init.sap to /database/init.sapcopy /database/init.utl to /database/init.utl

    3. Copy the SQL*Net parameter files from the directory \network\admin to the directory \network\admin.

    4 Oracle Database Upgrade4.2 Copying and Adapting the SQL*Net Files

    22/56 PUBLIC 2012-02-13

  • 4. Edit the file listener.ora in the \network\admin directory.Identify the parameter ORACLE_HOME that belongs to the database you want to upgrade (SID_NAME in section SID_LIST) and change the value of the parameter ORACLE_HOME to point to the new ORACLE_HOME.

    5. If not available, add the following entry to the file listener.ora:ADR_BASE_ = Note that this is the same value as set in the database profile parameter diagnostic_dest.Since your database is still running in the old environment, do not start the listener with the new listener.ora file at this point.

    6. Multiple Oracle Homes: This step is only necessary, if you want to continue using after the database upgrade the old Oracle Home for another database instance that is still running the old Oracle version.If you have two or more co-existing Oracle Homes, each has its own Listener and its own corresponding configuration. Make sure that you do not use the same port number for more than one listener.You can check existing numbers in the Net Manager as follows:1. Start the Net Manager that guides you through the Network configuration process.

    Choose Start All Programs Oracle - Configuration and Migration Tools Net Manager .

    2. Choose File Open Oracle Net Configuration .3. Navigate to the\network\admin folder or specify its path in the Directory

    field.4. Select the Listener.

    The port number for the Listener is displayed.NOTEKeep in mind that when you remove or change port numbers for a Listener, you must also change the port number in the Oracle Net Configuration window. To do so, navigate to Service Naming, and select .world.Under Address Configuration on the right-hand side, you find the port number.If you have multiple Oracle database instances in one Oracle Home, you find more .world entries below Service Naming.

    5. Carry out the previous steps for each active Oracle Home and make sure that you do not use the same port number for more than one listener.

    4.3 Backing Up the Oracle DatabaseYou must have a complete and usable database backup otherwise you might lose data.

    4 Oracle Database Upgrade4.3 Backing Up the Oracle Database

    2012-02-13 PUBLIC 23/56

  • Procedure1. Create a complete database and operating system backup, and back up any archive logs from Oracle

    10g.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.

    4.4 Changing the Environment for User admProcedure1. In the user environment of adm, rename the following variables:

    ORACLE_HOME TNS_ADMIN (if it exists)

    EXAMPLERrename ORACLE_HOME into ORACLE_HOME_before_upgrade, and TNS_ADMIN into TNS_ADMIN_before_upgrade.NOTEMSCS only: rename the variables on all nodes.

    2. Multiple Oracle Homes only: Remove from the system environment variable PATH all parts referring to the Oracle executables (%ORACLE_HOME%\bin) as follows:1. Start the Oracle Universal Installer with Start All Programs Oracle - Oracle

    Installation Products Universal Installer .2. On the Welcome screen, choose Installed Products.3. On the Inventory screen, choose the Environment tab.4. Deselect all components and choose Apply.

    3. Multiple Oracle Homes only: Update or, if not available, create the user environment PATH of all users using the Oracle software to refer to the correct %ORACLE_HOME% as follows:1. Choose My Computer Properties Advanced Environment Variables .2. If the environment variable PATH already exists, append

  • NOTEWhenever you decide to use the BACK button in the DBUA, we recommend stopping the DBUA and restarting it again. Otherwise, the DBUA might loose some context information (for example, upgrade time zone).

    Prerequisites If not yet stopped, stop the SAP system.

    Do not stop the database instance. The database instance must be running in the current (old) environment.

    Change the registry entry of ORA__AUTOSTART by entering the command:\bin\oradim -edit sid startmode manual

    MSCS only: Follow the instructions on the first cluster node only, where the database is located.In the Cluster Administrator make sure that the database disks are online on the first cluster node.

    Procedure1. Start the Oracle Database Upgrade Assistant using one of the following options:

    You use a Powershell script (recommended).To start the Oracle Database Upgrade Assistant (DBUA) with a Powershell script, proceed as described in SAP note 1431793, section 5.2 Using the DBUA wrapper on Windows.The advantage of using a Powershell script is that all required parameters are already specified in the DBUA, and manual post-installation tasks are reduced to a minimum.For more information about Powershell, see Using Powershell [page 51].

    You use the Start menu:Choose Start All Programs Oracle - Configuration and Migration Tools Database Upgrade Assistant .

    NOTENote that if you use this method, you do not automatically run the SAP-specific DBUA upgrade scripts, and you have to run them after the upgrade manually.

    2. Proceed as shown in the following table:Screen InputDBUA: Welcome Choose Next.DBUA: Select Database 1. Select the database that you want to upgrade.

    2. Choose Next.The DBUA analyzes the database to be upgraded and performs pre-upgrade checks.

    3. If the DBUA warns you of issues that need to be fixed before the upgrade, you need to analyze and act on these warnings.The most common warning or information messages are as follows: Database is using an old timezone file version

    Upgrade of TSTZ data is done automatically if the DBUA was started using dbua.sap.ps1.

    4 Oracle Database Upgrade4.5 Performing the Database Upgrade

    2012-02-13 PUBLIC 25/56

  • Screen Input Database contains schemas with stale optimizer statistics

    See SAP Note 1431793, section 4. Running the Pre-Upgrade Scripts. Database contains INVALID objects prior to upgrade

    See SAP Note 1431793, section 4. Running the Pre-Upgrade Scripts. If there is not enough space for the SYSTEM tablespace, increase

    the space. If you are prompted to resize the rollback segment SYSTEM,

    choose Continue.4. Choose Yes to continue with the upgrade.

    DBUA: Upgrade Options The following options are available: Recompile invalid objects at the end of the upgrade

    Leave this selection unchanged.The option 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.

    Backup databaseSince you have already performed the Oracle database backup [page 23], you do not need to select this option.

    Choose Next.DBUA: Move Database Files Leave the default setting Do Not Move Database Files as Part of Upgrade and choose

    Next.DBUA: Recovery and Diagnostic Location

    1. Do not select Specify Flash Recovery Area.2. If you opened the DBUA with the Start menu, in the Diagnostic

    Destination field you have to specify the location of the saptrace directory using the Browse button.

    3. Choose Next.DBUA: Management Options Deselect Configure the Database with Enterprise Manager, if selected, and choose

    Next.DBUA: Summary Review the summary of 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.Choose Back to make any final adjustments, if required. Otherwise, leave the default settings and choose Finish to start the upgrade.The upgrade process itself runs for some time, depending mainly on the size of the database and the capacity of the hardware.You can ignore the warning ORA-32004 obsolete or deprecated parameter(s) specified for RDBMS instance.When the DBUA has completed successfully, the results of the upgrade are displayed. Review the changes made and close the DBUA.

    3. If you started the DBUA from the Start menu, you must perform additional steps to perform the post-upgrade script (see below).

    Additional Steps When Starting the DBUA from the Start MenuIf you started the DBUA from the Start menu, you have to check the upgraded database and perform the post-upgrade script manually.

    4 Oracle Database Upgrade4.5 Performing the Database Upgrade

    26/56 PUBLIC 2012-02-13

  • To do this perform the following steps of SAP note 1431793:6.1 Checking the upgraded database 6.2 Running post-upgrade scripts manually

    4 Oracle Database Upgrade4.5 Performing the Database Upgrade

    2012-02-13 PUBLIC 27/56

  • This page is left blank for documents that are printed on both sides.

  • 5 Post-Upgrade Steps

    After the Oracle database upgrade, you need to perform the steps described here.1. You set the user environment variables [page 29].2. You create the Oracle TNSListener service [page 30].3. MSCS only: You set up a shared database directory in the Oracle home [page 30].4. You change the registry value of Oracle Autostart [page 32].5. You check the start up type of the Oracle services [page 32].6. You update BR*Tools and the SAP executables [page 33].7. You perform post-upgrade tasks [page 35].8. You delete the old Oracle software [page 36].9. MSCS only: You add the database to the cluster group [page 37].10. You back up the database [page 39].11. You configure the new features for Oracle Database 11g Release 2 (11.2) [page 39].

    5.1 Changing Environment VariablesProcedure

    NOTEMSCS only: Edit the variables on all MSCS nodes.

    1. In the user environment and system environment adm, check the PATH variable and, if required, remove all parts referring to the old Oracle version.

    CAUTIONWhen you modify the user environment, you must be logged on as the corresponding adm user.

    2. In the user environment of adm, set the ORACLE_HOME variable to the correct value for Oracle 11g, for example to: :\ORACLE\\11203.

    3. If you have two or more Oracle Homes, make sure that the user environment variable PATH of the adm user points to the corresponding %Oracle_Home%\bin directory.

    4. Copy tnsnames.ora and sqlnet.ora from %ORACLE_HOME%\network\admin to \\\sapmnt\\SYS\profile\oracle.

    5 Post-Upgrade Steps5.1 Changing Environment Variables

    2012-02-13 PUBLIC 29/56

  • NOTEThis information is required for all ABAP application servers you install on a separate host to find the correct location of these files.

    5. Set the user environment variable TNS_ADMIN to point to the directory \\\sapmnt\\SYS\profile\oracle.

    NOTESet TNS_ADMIN on all ABAP application servers.

    6. Log off and log on again to activate the environment changes in your user session.

    5.2 Creating the Oracle TNSListener ServicePrerequisitesStop the old Oracle listener before you create the Oracle TNSListener Service.

    ProcedureOpen a command prompt and enter the following command:\bin\lsnrctl start

    NOTEThis will start the listener from the new Oracle home. As the listener service does not yet exist, you will get the following error message: Failed to open service , error 1060. Then the service will be created and started.

    5.3 MSCS Only: Setting Up a Shared Database Directory in Oracle Home

    The following describes how to set up a shared Oracle Home\database-directory with a link or junction if your database is configured for using a spfileA central Oracle Home\database-directory has the following advantages: You can also use sqlplus remotely to make changes to your profile parameters You have to make the changes in the parameter files only once in the shared Oracle Home\database-

    directory.If your database is not configured for using a spfile, you have to apply all changes in the init.ora file in the Oracle Home\database-directories on all MSCS nodes.To check the configuration of your database, see Changing or Deleting Oracle database parameters [page 45].

    5 Post-Upgrade Steps5.2 Creating the Oracle TNSListener Service

    30/56 PUBLIC 2012-02-13

  • NOTEOracle Fail Safe does not support the direct use of an spfile. Therefore, you have to create a Fail Safe-specific init_OFS.ora file, and specify it when adding the database to the cluster resource group [page 37].

    PrerequisitesWindows Server 2003 only: You have one of the following executables available: linkd.exe

    This executable is part of the Microsoft Windows 2003 Server Resource Kit.You can download the resource kit from www.microsoft.com.Search for Microsoft Windows 2003 Server Resource Kit.

    NOTEAfter you have installed the resource kit, you can copy linkd.exe to any directory.

    junction.exeYou can download this file from www.sysinternals.com.Search for junction.

    Procedure1. Stop the Oracle database and the Oracle Service.2. In the sapdata1 directory, create the directory database.

    The sapdata1 directory is located on a shared disk in the cluster.3. On the first MSCS node, change to the Oracle Home directory, and enter the following command:

    If you use a command prompt, enter:move /y database\* \database

    If you use a Powershell, enter:move -force database\* \database

    4. Delete the Oracle Home\database-directory with the command:rd /q /s database

    NOTEYou can also use the Windows Explorer to delete the directory.

    5. If you use Windows Server 2003, create the junction or link with the following commands: For junction, open a command prompt and enter:

    %Oracle_Home%\database \database

    For linkd, open a command prompt and enter: %Oracle_Home%\database \database

    5 Post-Upgrade Steps5.3 MSCS Only: Setting Up a Shared Database Directory in Oracle Home

    2012-02-13 PUBLIC 31/56

  • NOTEYou can also use the 32-bit junction.exe or linkd.exe in a 64-bit Windows operating system.

    As of Windows Server 2008, you create the link as follows: If you use a command prompt, enter:

    mklink /j %oracle_home%\database \database If you use a Powershell script, enter:

    cmd.exe "/c" mklink "/j" $env:oracle_home\database \database

    EXAMPLEThe following example shows how to create links with a Powershell:C:\oracle\xxi\11202> cmd.exe "/c" mklink "/j" c:\oracle\XXI\11203\database G:\oracle\XXI\sapdata1\databaseThe junction created for c:\oracle\XXI\11202\database is G:\oracle\XXI\sapdata1\database

    6. Move the disk where the \sapdata1\database directory is located to another MSCS node.7. Repeat step 4 and step 5 on the other MSCS nodes.8. Edit or create the file init_OFS.ora in the database directory, and enter the following

    line:spfile = \database\spfile.ora

    5.4 Changing the Registry Value of Oracle AutostartProcedureChange the registry value of ORA__AUTOSTART. Open a command prompt and enter the following command:\bin\oradim -edit -sid -startmode manualIgnore the error message: Unable to start service, OS Error 1056.Alternatively, use regedit.exe to change the registry key to value FALSE. The registry key is available at HKLM:\Sofware\Oracle\KEY_11202.

    5.5 Checking the Start Up Type of the Oracle ServicesProcedureStart the Oracle services (Database and Listener), if not yet started.Also, if not yet started, start the Distributed Transaction Coordinator Service.In a standard configuration, set the startup type of OracleService and OracleTNSListener to automatic to ensure that they are automatically restarted

    5 Post-Upgrade Steps5.4 Changing the Registry Value of Oracle Autostart

    32/56 PUBLIC 2012-02-13

  • after booting. For more information about how to start services, see Starting or Stopping Services [page 44].

    CAUTIONMSCS only:Set the startup type of OracleService and OracleTNSListener to manual to ensure that they are not automatically restarted after booting.

    5.6 Updating the SAP Executables and the BR*ToolsYou need to update the SAP executables and the BR*Tools to the latest version.

    NOTEMake sure that you first extract and update the SAP executables before you extract and update the BR*Tools.

    PrerequisitesThe BR*Tools of Version 7.20 require the Microsoft Visual Studio 2005 Redistributables. For more information about and how to install them, see SAP Note 684106.

    ProcedureUpdating the SAP ExecutablesApply the following latest available packages for the SAP executables in the following sequence for: SAPEXE dw_xxx SAPEXEDB lib_dbslExecutable Download LocationSAPEXEDB and lib_dbsl http://service.sap.com/swdc Download Support Packages and Patches Support

    Packages and Patches - Entry by Application Group Additional Components SAP KernelSAP Kernel SAP Kernel Windows Server on

    Oracle SAPEXE and dw_xxx http://service.sap.com/swdc Download Support Packages and Patches Support

    Packages and Patches - Entry by Application Group Additional Components SAP KernelSAP Kernel SAP Kernel Windows Server on

    #Database Independent

    CAUTION In an MCOD system, you have to update the executables of all SAP systems connecting to

    the database. For Web AS 6.40 systems, Oracle 11.2 is only supported with 640 EXT_2 Kernel.

    5 Post-Upgrade Steps5.6 Updating the SAP Executables and the BR*Tools

    2012-02-13 PUBLIC 33/56

  • Updating BR*ToolsYou update BR*Tools to the latest release with the latest patch level. After extracting the latest BR*Tools release, 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.1. Download the most current version of the BR*Tools from:

    http://service.sap.com/swdc Download Support Packages and Patches Support Packages and Patches - Entry by Application Group Additional Components SAP Kernel SAP Kernel SAP Kernel 7.20 Windows Server on Oracle Oracle DBATLxxxx.sar DBATLxxxx.sar

    2. Unpack BR*Tools to the DIR_CT_RUN [page 46] directory.NOTEMSCS only: Install BR*Tools in the following directories: DIR_CT_RUN [page 46] on one MSCS node only %windir%\SapCluster on all MSCS nodes

    3. 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 \database directory to the new one:cd \databasecopy init.sap %ORACLE_HOME%\databasecopy init.utl %ORACLE_HOME%\database (this file is only available if you use a third-party backup solution)

    NOTE The \database directory is not available if you already deleted the

    old ORACLE_Home. init.dba is no longer needed because BR*Tools release 6.40 SAPDBA is no longer

    available. The init.utl file is only available if you use external backup software based on

    a backint interface.4. Update the SAPDBA role as adm user as follows:

    1. Go to the %ORACLE_HOME%\database directory:cd %ORACLE_HOME%\database

    2. Copy sapdba_role.sql from the DIR_CT_RUN directory to the %ORACLE_HOME%\database directory.

    3. Determine the SAPSCHEMA_ID by entering the following commands:sqlplus /nologSQL> connect / as sysdba SQL> select username from dba_users where username like 'SAP%'; USERNAME

    5 Post-Upgrade Steps5.6 Updating the SAP Executables and the BR*Tools

    34/56 PUBLIC 2012-02-13

  • For the schema ID, you have to use the names beginning with SAP, for example:SAPW41SAPSR3SAPSR4SAPSR3DBIn these examples, the SAPSCHEMA_ID that is required for sapdba_role.sql is W41, SR3, SR4, or SR3DB without the leading SAP.Close sqlplus with this command:SQL>exit

    4. Execute the following SQL commands:sqlplus /nolog @sapdba_role sqlplus /nolog @sapdba_role DB

    CAUTIONMake sure that you execute the commands for every SAPSCHEMA_ID in your database.

    5.7 Performing Post-Upgrade TasksYou need to perform certain post-upgrade tasks.

    Procedure1. If your source database is Oracle 9.2.0.8, perform the following tasks before gathering the Oracle

    optimizer statistics using brconnect:1. Apply script dbstatc11.sql from SAP note 403704.2. Apply script dbcheckora11_olap.sql or dbcheckora11_oltp.sql from the same note3. Implement SAP delivered statistics from SAP Note 1020260.

    2. Gather Oracle optimizer statistics by executing the following commands as the adm 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.You can find an automated script in SAP Note 1171650 to help you check whether your SAP system complies with the database parameter recommendations at any given point in time.

    4. Update the Oracle database statistics with BRCONNECT as follows:brconnect -c -u / -f stats -t all f collect -p 4

    NOTEFor more information about update statistics, see the documentation SAP Database Guide: Oracle at:www.sdn.sap.com/irj/sdn/ora SAP ON ORACLE KNOWLEDGE CENTER SAP

    Documentation

    5 Post-Upgrade Steps5.7 Performing Post-Upgrade Tasks

    2012-02-13 PUBLIC 35/56

  • 5. Run post_ugprade_status.sql.Open a command prompt and change to the directory \sap\ora_upgrade\post_ugprade.From this directory start sqlplus.exe and enter the following commands:SQL>connect / as sysdbaSQL>@post_upgrade_status.sqlThis provides an overview of the status of the upgraded database.

    5.8 Deleting the Old Oracle SoftwareBefore you delete the old Oracle software, you can perform a backup of your database [page 39]. To deinstall the Oracle 10.2 software, you use the Oracle Universal Installer (OUI).

    For more information, see:http://download.oracle.com/docs/cd/B19306_01/em.102/b16227/ oui5_product_install.htm#i1006215

    To deinstall the Oracle 11.2 software, you use the deinstallation tool.For more information, see: SAP Note 1591580 The Oracle Database Installation Guide 11g Release 2 (11.2) for Microsoft Windows, which is available

    at:http://download.oracle.com/docs/cd/E11882_01/ install.112/ e16773/ deinstall.htm#CIHDGGJJ

    CAUTIONDo not delete the old software, if it still has to be accessed by another database instance running with this version.

    Procedure1. MSCS only: Set the Oracle Services for MSCS offline.2. MSCS only: Stop the Cluster Service on all MSCS nodes.3. Stop the service Distributed Transaction Coordinator.4. Stop the services of the old Oracle Home.5. Start the Oracle Universal Installer from your Start menu as follows:

    If you find the Universal Installer under Start All Programs Oracle Installation Products Universal Installer , you must start it from this path.

    Otherwise, start it from Start All Programs Oracle Installation Products Universal Installer .6. Follow the instructions for the Oracle Home you want to remove.

    1. In the Welcome screen, choose Deinstall Products.

    5 Post-Upgrade Steps5.8 Deleting the Old Oracle Software

    36/56 PUBLIC 2012-02-13

  • 2. In the Content tab of the Inventory dialog box, check the node representing your old Oracle Home and press the Remove button.

    3. Confirm the removal of the products in the popup that appearsNOTEIt is not possible to delete all old Oracle products. These are deleted in the following steps.

    7. If available, delete the services in which the name contains the old Oracle Home name.To delete a service, open a command prompt and enter:sc delete

    EXAMPLEC:\Windows\system32>sc delete OracleJobSchedulerXXL [SC] DeleteService SUCCESSNOTE NOTE

    Make sure that you do not delete the services listed under Oracle Services [page 43].

    Multiple Oracle Homes only: On a database server with multiple Oracle Homes, do not delete the service OracleService. If more than one Listener is configured, do not delete these services either.

    8. In the Windows Explorer, delete or rename the old Oracle home directory to prevent that an Oracle process can start again from the old Oracle home.

    9. Delete the entry Oracle , if it exists, in the Windows Start menu, as follows:1. Choose Start All Programs .2. Right-click Oracle and choose Delete.

    CAUTIONOnly delete the registry key for the earlier Oracle version for example:

    HKEY_LOCAL_MACHINE SOFTWARE ORACLEKEY_ if there is only one Oracle client installed.

    Otherwise, do not delete it.

    5.9 MSCS Only: Adding the Database to the Cluster GroupTo enable a database to fail over with all the resources it requires, you must add it to the cluster group.

    PrerequisitesThe Cluster Service is running on all MSCS nodes.

    Procedure1. Copy the file sqlnet.ora from the directory %ORACLE_HOME%\network\admin from the first MSCS

    node to the same directory on the additional MSCS node.

    5 Post-Upgrade Steps5.9 MSCS Only: Adding the Database to the Cluster Group

    2012-02-13 PUBLIC 37/56

  • 2. Start the Cluster Administrator (Windows Server 2003) or Failover Cluster Manager (Windows Server 2008 (R2)) and bring the Oracle Services for MSCS resource online.

    3. Start the Oracle services.4. Start the database.5. Start the Oracle Fail Safe Manager with Start All Programs Oracle - Oracle

    Fail Safe Manager .6. If the Welcome dialog box appears, choose Verify Cluster. Otherwise, right-click the cluster and choose

    Verify Cluster.NOTEAll MSCS nodes must be up and running for this step.

    The window Verifying Cluster shows the steps that are executed to verify the cluster. When you are informed that the operation has completed successfully, close the window.

    7. Add the SAP database to the cluster group Oracle.1. In the tree on the left, choose Nodes Standalone Resources .2. Select the database .world3. Choose Resources Add to Group .

    8. In the dialog box Add Resource to Group Resource:For Resource Type, select Oracle Database.For Group name, select Oracle.

    9. Choose Next.10. In the dialog box Add Resource to Group Database Identity:, enter the following information:

    Service Name .worldInstance Name Database Name Parameter File :\\sapdata1\database

    \init_OFS.ora11. Choose Next.12. In the dialog box Add Resource to Group Database Password:

    Select Yes, create the password file (recommended).Enter and confirm the password.

    13. Choose Finish.14. In the dialog box Finish Adding the Database to the Group, choose OK to add the database resource to the

    group.15. In the dialog box Confirm Add database to Group, choose Yes.

    The Adding resource .world to group window, shows the steps that are executed to add the database to the cluster group.

    16. Copy tnsnames.ora from %ORACLE_HOME%\network\admin to \\\sapmnt\\SYS\profile\oracle.

    5 Post-Upgrade Steps5.9 MSCS Only: Adding the Database to the Cluster Group

    38/56 PUBLIC 2012-02-13

  • 17. On the additional MSCS node, set the user environment variable TNS_ADMIN to point to the directory \\\sapmnt\\SYS\profile\oracle.

    5.10 Backing Up the DatabaseYou need to back up your upgraded Oracle Database 11g database.We also recommend perform a full operating system backup.

    CAUTIONYou risk losing data if you do not back up your database.

    ProcedurePerform a full database and operating system backup.

    5.11 Configuring the New Features for Oracle Database 11g Release 2 (11.2)

    You need to configure the new Oracle Database 11g Release 2 (11.2) features.

    ProcedureFor more information about new features with Oracle Database 11g Release 2 (11.2) see SAP Note 1431800. This note provides links to other SAP notes that describe how to configure or activate each new feature.

    5 Post-Upgrade Steps5.10 Backing Up the Database

    2012-02-13 PUBLIC 39/56

  • This page is left blank for documents that are printed on both sides.

  • 6 Common Administration Tasks

    The following sections provide information on common administration tasks that have to be performed repeatedly during the upgrade procedure. Some of these tasks are standard tasks, others are only relevant for a Microsoft Cluster Service (MSCS) configuration. Starting and stopping the database [page 41] Checking Oracle services [page 43] Starting and stopping services [page 44] Changing or deleting Oracle database parameters [page 45] Determining the value of SAP system profile parameters [page 46] Moving groups for MSCS [page 46] Starting and stopping the SAP system [page 47]

    6.1 Starting and Stopping the DatabaseThe following sections provide information on: Starting and stopping the database in a standard configuration [page 41] Starting and stopping the database in an MSCS configuration [page 42]

    6.1.1 Starting and Stopping the Database in a Standard Configuration

    In a standard configuration you use sqlplus to start or stop the database.

    ProcedureEnter the following commands in sqlplus: To start the database, enter:

    sqlplus /nolog SQL>connect / as sysdbaSQL>startupSQL>exit

    To stop the database, enter:sqlplus /nolog SQL>connect / as sysdbaSQL>shutdown immediate

    6 Common Administration Tasks6.1 Starting and Stopping the Database

    2012-02-13 PUBLIC 41/56

  • SQL>exit

    6.1.2 Starting and Stopping the Database in an MSCS Configuration

    This section describes how to start or stop the database in an MSCS configuration.You have the following options You use sqlplus

    You use this option if: The database disks are online and the OracleService is started. You start the database in a certain mode, for example you use the commands startup

    upgrade or startup migrate during an upgrade or a migration.NOTEIf want to start the database in a certain mode (for example, you use the commands startup migrate, startup upgrade, startup nomount, or if you have installed a patch set or patch collection), perform the following steps:1. In the Oracle Fail Safe Manager, right-click the database .world in the cluster

    group ORACLE.2. Choose Place offline.3. Choose the specific modus.4. On the node, where the Oracle group is partially online, start the service

    OracleService5. Perform administrative tasks including start up or shutdown6. In the Oracle Fail Safe Manager, take the cluster resource .world online.

    For more information on how to start and stop your database with sqlplus, see Starting and Stopping the Database in a Standard Configuration [page 41].

    You use the Oracle Fail Safe ManagerYou use this option, if the database is under control of the Oracle Fail Safe Manager.

    CAUTIONIf the Oracle database resource is online, you must use the Oracle Fail Safe Manager to stop the database. If you do not use the Oracle Fail Safe Manager, the cluster functionality automatically attempts to restart the database.

    PrerequisitesYou are logged on as user adm.

    ProcedureThe following procedure describes how to start and stop the database with the Oracle Fail Safe Manager.

    6 Common Administration Tasks6.1 Starting and Stopping the Database

    42/56 PUBLIC 2012-02-13

  • Starting the database1. In the Oracle Fail Safe Manager, right-click the database .world in the cluster group

    ORACLE.2. Choose Place online.

    Stopping the database1. In the Oracle Fail Safe Manager, right-click the database resource .world in the cluster

    group ORACLE2. Choose Take offline.

    NOTEIf a pop-up appears, asking you how to take the database offline, choose Immediate.

    6.2 Checking Oracle ServicesThis section describes how to check the status of the Oracle services.

    Oracle ServicesThe following services that are available in an Oracle 11g installation and should not be deleted: OracleService OracleTNSListener OracleMTSRecoveryService OracleClrAgent OracleVssWriter MSCS only: OracleMSCSServices MSCS only: OracleTNSListenerFsl

    NOTETo remove the OracleRemExecService (if available) you first have to stop it.

    ProcedureTo check the status of a service, perform the following steps:1. Choose Start All Programs Administrative Tools Services .2. Double-click the required service.

    The Status column shows whether a service has been started. The Startup Type column shows whether a service is started automatically after booting or

    whether it has to be started manually. To change the startup type, right-click Properties, select the General tab, and choose the

    startup type from the dropdown box. To change the user that is assigned to a service, select the Log On tab and make the

    appropriate entries.

    6 Common Administration Tasks6.2 Checking Oracle Services

    2012-02-13 PUBLIC 43/56

  • 6.3 Starting and Stopping ServicesThis section describes how to stop services in a standard configuration and in an MSCS configuration.

    ProcedureStarting and Stopping Services in a Standard Configuration1. Right-click on My Computer and choose Manage.2. Double-click on Services and Applications and select Services.3. Right-click on the service you want to start or stop.4. Choose Start or Stop as required.

    Starting and Stopping Services in an MSCS Configuration Starting or Stopping the Cluster Service with the Cluster Administrator (Windows Server

    2003) or Failover Cluster Manager (Windows Server 2008 (R2))1. Start the Cluster Administrator (Windows Server 2003), or Failover Cluster Manager (Windows Server

    2008 (R2)).2. Select the node where you want to start or stop the Cluster Service.3. To stop the cluster service, choose File Stop Cluster Service.4. To start the service, choose File Start Cluster Service

    Starting and Stopping Services with the Cluster Administrator (Windows Server 2003), or Failover Cluster Manager (Windows Server 2008 (R2)), or Fail Safe ManagerYou can start or stop the services listed in the table below with the Cluster Administrator (Windows Server 2003), or Failover Cluster Manager (Windows Server 2008 (R2)), or Fail Safe Manager.To start a resource, set it online. To stop a resource set it offline.

    CAUTIONIf during the migration process the Cluster Service is stopped, you cannot use the Fail Safe Manager or Cluster Administrator (Windows Server 2003), or Failover Cluster Manager (Windows Server 2008 (R2)) to stop services. In this case, you have to stop them as described above under Starting and Stopping Services in a Standard Configuration.However, when the Cluster Service is running, you must use the Cluster Administrator (Windows Server 2003), or Failover Cluster Manager (Windows Server 2008 (R2)), or Fail Safe Manager, otherwise the cluster functionality automatically attempts to restart the services you have stopped.

    The following table shows how to start the services.Service ResourceSAP_ Set the SAP cluster resource to online. The SAP

    system is started.OracleService Choose one of the following:

    Set the resource .world in the group ORACLE to online.

    6 Common Administration Tasks6.3 Starting and Stopping Services

    44/56 PUBLIC 2012-02-13

  • Service Resource In the Oracle Fail Safe Manager, set the Fail Safe

    Database .world to online.OracleTNSListenerFsl

    Set the corresponding resource in the group ORACLE to online.

    OracleMSCSServices Set the resource Oracle Services for MSCS in the Cluster group to online.

    6.4 Changing or Deleting Oracle Database ParametersDepending on the configuration of the Oracle database, you must use one of the following files to change or delete the Oracle database parameters: If your database is not configured for using a spfile you use the init.ora file. If your database is configured for using a spfile you use the spfile.Procedure1. Check the configuration of your Oracle database with the following sqlplus commands:

    sqlplus /nolog SQL>connect / as sysdbaSQL>show parameter spfile

    2. Check the value of the spfile parameter and perform one of the following steps: If the value of the parameter spfile is empty, your database is not configured for using a spfile.

    Edit the init.ora file to change the parameters. If a value for the parameter spfile is displayed, your database is configured for using a spfile.

    Change the parameters in the spfile as follows: To set the parameter, enter one of the following:

    If consists of a string, for example 11.2.0, enter:SQL> alter system set = scope = spfile;

    Otherwise enter:SQL> alter system set = scope = spfile;

    NOTETo find out if your parameter value is a string or a number, use the command: show parameter

    To delete a parameter, enter:SQL> alter system reset scope = spfile sid = '*';

    6 Common Administration Tasks6.4 Changing or Deleting Oracle Database Parameters

    2012-02-13 PUBLIC 45/56

  • NOTEIf you get an error during the alter system reset command like ORA-32010 : cannot find entry to delete in SPFILE, you can ignore it, as it only indicates that the entry did not exist in the SPFILE.

    6.5 Determining the Value of SAP System Profile ParametersThis section describes how to determine the value of SAP system profile parameters, for example of DIR_CT_RUN and DIR_EXECUTABLE.

    ProcedureThe following procedure shows an example how to determine the value of the DIR_CT_RUN parameter.To find out the value of DIR_CT_RUN, do one of the following: If your SAP system is started, use transaction SE38.

    Run report rsparam and search for the parameter DIR_CT_RUN. If your SAP system is not started, open a command prompt and enter: sappfpar

    pf= DIR_CT_RUN

    6.6 Moving Groups or Services and Applications for MSCSTo move the database, SAP, or disk cluster groups from one MSCS node to the other, you can use the Cluster Administrator (Windows Server 2003), or Failover Cluster Manager (Windows Server 2008 (R2)), or the Fail Safe Manager. This section describes the procedure for all of them.

    NOTEAs of Windows Server 2008 (R2) there are the following terminology changes: Cluster groups are now called services and applications.

    We do not always use both names in this section. The Cluster Administrator is now called Failover Cluster Manager.

    ProcedureWindows Server 2003: Moving Groups with the Cluster AdministratorUse the Cluster Administrator for groups that do not belong to the Oracle database groups:1. Start the Cluster Administrator with Start < Settings> Control Panel Administrative Tools Cluster

    Administrator. 2. On the left-hand pane, under Groups right-click the cluster group you want to move.3. Click Move group on the context menu.

    The group is now moved to another node.4. Repeat this for each group that you want to move.

    6 Common Administration Tasks6.5 Determining the Value of SAP System Profile Parameters

    46/56 PUBLIC 2012-02-13

  • Windows Server 2008 (R2): Moving Services and Applications with the Failover Cluster ManagerYou use the Failover Cluster Manager for groups that do not belong to the database groups.1. Start the Failover Cluster Manager with Start Administrative Tools Failover Cluster Manager .2. In the Failover Cluster Manager, right click the service and application you want to move.3. Choose Move this service or application to another node Move to .4. Repeat the previous step for each service and application that you want to move.

    NOTEYou can only move disks that are assigned to Services and Applications.The disks that are added to the cluster are automatically added to a group named Available Storage. Although the groups Available Storage and Cluster Group exist in an MSCS cluster on Windows Server 2008 (R2), they are not visible under Services and Applications. Therefore you cannot move these groups with the Failover Cluster Manager. To move Cluster Group, open a command prompt and enter:

    cluster group cluster group /move To move Available Storage, open a command prompt and enter:

    cluster group Available Storage /move

    Moving Groups with the Fail Safe ManagerUse the Fail Safe Manager to move the Oracle resources, for example, the database group Oracle:1. Start the Fail Safe Manager 3.4.2 with Start All Programs Oracle Oracle Fail

    Safe Manager2. On the left-hand pane, select the group you want to move.3. Press the right mouse button and click Move to a Different Node on the context menu.

    The group is now moved to another cluster node.

    6.7 Starting and Stopping the SAP SystemThis section describes how to start or stop an SAP system in a: Standard Configuration Microsoft Cluster Service (MSCS) ConfigurationProcedureStarting and Stopping the SAP System in a Standard ConfigurationFor a standard configuration, you use the SAP Microsoft Management Console (SAP MMC) to start or stop your SAP system. With a newly installed MMC you can start or stop installed SAP instances locally on the host that you are logged on to. If the MMC is configured for central system administration, you can start the entire system from a single host. To stop the system, you first have to stop all dialog

    6 Common Administration Tasks6.7 Starting and Stopping the SAP System

    2012-02-13 PUBLIC 47/56

  • instances before you can stop the other instances. For more information on the start or stop order of an SAP system, see SAP Note 897933.

    NOTEWhen you boot the Windows operating system in a standard configuration, the SAP Service SAP_ (for example SAPPRD_00) is always started automatically.

    Perform the following steps:1. Start the SAP MMC on the SAP system host by choosing Start All Programs SAP Management

    Console.2. Right-click the SAP system node and choose Start or Stop.

    All instances listed under the system node, will start or stop in the correct order.3. If the SAP system is installed on multiple hosts (distributed system), you have the following options

    to start or stop your system: You start or stop the SAP instances using the SAP MMC on each host. You add the remote instances to the MMC configuration to start or stop all instances from a

    single MMC.To do so, do one of the following: You configure the SAP MMC manually. For more information, see Changing the Configuration

    of the MMC in the MMC documentation. You use the automatic LDAP registration. For more information, see Configuring MMC

    for Active Directory Service in the MMC documentation.

    Starting and Stopping the SAP System in an MSCS ConfigurationIf you use MSCS, you start or stop your SAP system with one of the following tools:Tool DescriptionOracle Fail Safe Manager You use the Oracle Fail Safe Manager to start or stop the database instance.

    To start or stop the database instance in the Oracle Fail Safe Manager, right-click the database .world in the Fail Safe group ORACLE and choose Place online or Take offline.

    SAP Microsoft Management Console (SAP MMC)

    To start or stop your SAP system with the SAP MMC, see above.

    Cluster Administrator (Windows Server 2003)

    NOTEWith the Cluster Administrator you can only start or stop clustered instances such as the (A)SCS instance. For all other non-clustered instances, such as dialog instances or the central instance, you must use the SAP MMC (see above).

    To start or stop the clustered instance of the SAP system with the Cluster Administrator (Windows Server 2003), open the Cluster Administrator and set the SAP cluster resource in the SAP cluster group online or offline.

    6 Common Administration Tasks6.7 Starting and Stopping the SAP System

    48/56 PUBLIC 2012-02-13

  • Tool DescriptionFailover Cluster Manager (Windows Server 2008 (R2))

    NOTEWith the Failover Cluster Manager you can only start or stop clustered instances such as the (A)SCS instance. For all other non-clustered instances, such as dialog instances or the central instance, you must use the SAP MMC (see above).

    To start or stop the clustered instance of the SAP system with the Failover Cluster Manager (Windows Server 2008 (R2)), select the relevant service and application SAP .In the right-hand pane, under Other Resources, right-click the resource SAP Instance and choose Bring this resource online or Take this resource offline.

    6 Common Administration Tasks6.7 Starting and Stopping the SAP System

    2012-02-13 PUBLIC 49/56

  • This page is left blank for documents that are printed on both sides.

  • A Appendix

    A.1 Using PowershellAs of the Oracle 11.2 upgrade, SAP uses the Windows Powershell script. Windows Powershell is a powerful tool integrated in the Windows operating system. It uses object- oriented methodology, which allows fast and stable script development.In this upgrade procedure, the use of Windows Powershell is optional, although it saves you some manual upgrade steps.For more information about the Windows Powershell, see:http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspxThere you can find links to the Online help, Online documentation, scripting repository, downloads, and blogs. Windows Server 2008

    You have to activate the Powershell feature with Start Administrative Tools Server ManagerFeatures .

    Windows Server 2008 contains Powershell 1.0, which is sufficient for the scripts delivered with the Oracle Upgrade. For more information about Powershell 2.0, see http://support.microsoft.com/kb/968929.

    Windows Server 2008 R2Powershell 2.0 is automatically activated during the Windows operating system installation.

    How To Start PowershellYou have the following options to start Powershell From the command prompt, by entering the command:

    powershell.exe From the Start Menu:

    Powershell 1.0:Choose Start All Programs Windows Poweshell 1.0 Windows Poweshell .

    Powershell 2.0:Choose Start All Programs Windows Powershell Windows Powershell .

    Working with PowershellMost commands that are used in cmd.exe are also available in the Powershell (defined as aliases).You can use well-known commands, such as cd, type, copy, move, mkdir, delete, rmdir. There is also online help available, which you can access by typing the command: help (or help ).

    A AppendixA.1 Using Powershell

    2012-02-13 PUBLIC 51/56

  • This is a list of differences between Powershell and cmd.exe: Before you can run Powershells scripts (text files with the file extension .ps1 that contain

    Powershell statements), you might have to change the default security setting to allow the execution of non-signed scripts as follows:set-executionpolice ("unrestricted")

    By default, when double-clicking Powershell scripts (.PS1 files) in the Windows explorer, this does not execute the script as is the default for .cmd files, but opens the script in an editor. If you want to activate automatic script execution after a double-click, you have to change the value HKEY_CLASSES_ROOT\Microsoft.Powershellscript.1\Shell\Open\Command from notepad.exe to the full path of the Powershell executable. To do this, open a Powershell and execute the following command:get-command powershell.exe

    The output of PIPE commands is not just a stream of characters (strings) but a stream of objects. You can easily access the properties and methods for these objects (see the process list DLL example below).

    The current working directory is not part of the directory search path that the Powershell looks at for scripts and programs. The Powershell only searches directories listed in the environment variable path. Therefore, you might have to run a local program with ./sapcontrol.exe or specify its full path.

    You can use the UNIX-like directory delimiters, such as cd /usr/sap/C11. You can have your current working directory in a UNC path (cd \\sapglobalhost\sapmnt). The shell distinguishes between environment variables and shell variables:

    Use of shell variables:Definition: $x="hello"Reference: write-host $x

    Use of an environment variable:Definition: $env:x="hello"Reference: write-host $env:x

    The Powershell has an interesting container concept called ps-drives. Within ps-drives you can navigate in other objects, such as registry, shell internal lists as you typically navigate in a file system (cd, dir, del, and so on).dir env: to get a list of environment variablesdir variable: to get the list of shell variablesdir HKLM: to get a list of registry keys in HKEY_LOCAL_MACHINEget-psdrive to get a list of available ps-drives

    Windows Powershell has full access to the .NET runtime. You can directly access missing functions in the Powershell via .NET.

    With Windows Powershell, you can create GUI-class user interfaces using Windows forms.

    A AppendixA.1 Using Powershell

    52/56 PUBLIC 2012-02-13

  • Powershell CommandsThe following table lists some Powershell commands.Command Explanationstop-service oracle* Stops all Windows services with service name starting

    with Oracleget-process Lists currently started processes on your systemget-process | sort starttime | select -last 1 Lists the latest process started on your computerget-process | sort starttime | select -last 1 | format-list -proper *

    Lists all properties of the latest started process

    get-process | sort starttime | select -last 1 | get-member

    Lists all process class members (properties and methods) of the latest started process

    get-process | %{$_.name;"-----------";$_.modules}

    Lists all processes, and the executables and DLLs the processes loaded

    $processes = (get-process | sort starttime) Defines a shell variable $processes, which contains an array of process objects

    $processes.length The number of processes in the array (is equivalent to the number of processes on your box)

    $processes[$processes.length-1].kill() Invokes the kill method (terminate process) of the latest started process

    (dir a.txt).set_attribtes("readonly") Sets the file a.txt to Read-Only

    A AppendixA.1 Using Powershell

    2012-02-13 PUBLIC 53/56

  • SAP AGDietmar-Hopp-Allee 16

    69190 WalldorfGermany

    T +49/18 05/34 34 34F +49/18 05/34 34 20

    www.sap.com

    Copyright 2012 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, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of Microsoft Corporation.IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation.Linux is the registered trademark of Linus Torvalds in the United States and other countries.Adobe, the Adobe logo, Acrobat, PostScript, an