SAP Note 1431793 Note Language: English

Oracle 11.2.0: Upgrade Scripts
Version: 31 Validity:
Valid Since 05.07.2011

This note describes the use of additional Shell- and SQL-scripts to perform an Oracle database upgrade to release 11.2.0.X with the Database Upgrade Assistant (DBUA).

What's new
2011-05-09 o New version of upgrade scripts for release available. Available as generic patch and included in SAP Bundle Patch May 2011. Changes/Modifications: upgrade hanging during custom scripts fixed general improvements

Other terms

Reason and Prerequisites Database Upgrade to Oracle Database Release 11.2.0.X
The scripts described in this note are used to automate pre- and post-upgrade tasks and to simplify the database upgrade process of your SAP/Oracle database to release 11.2.0.X.

Added 1. April 2011 If in the past the database views SAP_USER_INDEXES, SAP_USER_IND_COLUMNS and corresponding synonyms have been created and still exist in your database, you need to drop them before you upgrade to release 11.2 (check SAP note 519448). This clean up task is included in the current version of upgrade scripts for release (available April 2011).

08.08.2011 Page 1 of 12

Creating a guaranteed restore point enables you to flashback the database. Overview The following scripts are provided for the database upgrade of an SAP/Oracle database: o Pre-Upgrade-Scripts - create_restore_point.Recompile invalid objects .0: Upgrade Scripts Table of Contents 1.2.sql This script lets you create a guaranteed restore point before the upgrade.sql Oracle Pre-Upgrade Information Utility (My Oracle Support article 884522.sql. pre_upgrade_tasks.1) utlu112i_sap. see SAP note 966117. 4.08.2 database before the upgrade. pre_upgrade_status.sql This script contains database pre-upgrade checks. Page 2 of 12 - - - - - 08. pre_upgrade_checks. Run this script on the 10.2011 . This feature is useful especially during upgrade testing to quickly reset the database.sql This script contains database pre-upgrade tasks to minimize the number of warnings in the pre-upgrade check and to improve the performance of the upgrade like: . For more information about FLASHBACK DATABASE.sql This script runs database pre-upgrade checks and automatically logs the result in a log file. 3. utlu112i. 5.SAP Note 1431793 - Oracle 11.sql Oracle Pre-Upgrade Information Utility for SAP This script is run when running pre_upgrade_checks. 7. Overview Prerequisites Installing Upgrade Scripts Running Pre-Upgrade Scripts DBUA Wrapper Running Post-Upgrade Scripts Troubleshooting Appendix A DBUA Wrapper Script B Upgrade Scripts Version history 1. 2. 6.2 database before the upgrade. Run this script on the 10.2 database before the upgrade.Gathering Oracle Dictionary Statistics Run this script on the 10.sql or pre_upgrade_status.

2.0: Upgrade Scripts o Post-Upgrade-Scripts - post_upgrade_checks.2.0. Run this script on the 11.sql This script sets parameter remote_os_authent=TRUE.2. Run this script on the Check script for DBUA logs for Unix/Linux platforms - The post-upgrade SQL scripts can be used for manual or DBUA upgrade.2.SAP Note 1431793 - Oracle 11.1 Oracle database target release(s): 11. post_upgrade_tasks.sql This script contains database post-upgrade checks.2.2.2011 .sap. Oracle database target release(s): 11. Starting release 11.sql This script runs database post-upgrade checks and automatically logs the result in an log file. Prerequisites The following upgrade scenarios are supported: o Major Release Upgrade Oracle database source release(s): 10.2.2 database after the upgrade. (for SAP installations with ABAP stack on Unix platforms) sapuprof_profile.sql This script contains database post-upgrade This script sets parameter COMPATIBLE to '11.sql This script performs the upgrade of the timestamp with timezone (TSTZ) data.2 database after the upgrade.0'.2.2 database after the upgrade.08. set_remote_os_authent.X Patch Set Release Upgrade Oracle database source release(s): 11.0. set_compatible.0. post_upgrade_status.0.sql Script to create and configure SAPUPROF (SAP note 1519872) Wrapper script for DBUA for Unix/Linux platforms - - - - - - - - dbua. Run this script on the 11. 10. dbua.ps1 Wrapper script for DBUA for Windows platforms check_dbua_logs.X Page 3 of 12 o 08.2 the upgrade of TSTZ data can be performed by DBUA.

SAP Note 1431793 - Oracle 11. 4. download the patch file and run the following commands (see SAP note 1503709): OS> unzip p9584028_112020_Generic. OS> cd <ora_upgrade>/pre_upgrade 08. Log on to the database server as the Oracle database administrator user ('oracle' or 'ora<dbsid>') and change the current directory to the location of the pre-upgrade scripts.0: Upgrade Scripts OS> cd 9584028 OS> $ORACLE_HOME/OPatch/opatch apply For information how to install a patch with OPatch see note 839182. Running the Pre-Upgrade Scripts Running the pre-upgrade scripts is not integrated into the DBUA.2011 Page 4 of 12 . o For Unix/Linux platforms: The current version of the upgrade scripts is automatically installed if the current SAP Bundle Patch is o For Windows platforms: To install the upgrade scripts patch 9584028. Installing Upgrade Scripts The upgrade scripts are delivered as SAP-specific generic Oracle database patch (patch 9584028). Note: o SAP-specific database patches are installed in the Oracle Home in subdirectory '<ORACLE_HOME>/sap'. download the patch and run the following command: OS> $ORACLE_HOME/MOPatch/mopatch. The upgrade scripts are installed in the Oracle Home in directory '<ORACLE_HOME>/sap/ora_upgrade'.08. o The directory '<ORACLE_HOME>/sap/ora_upgrade' is denoted by <ora_upgrade> within the context of this note. No further installation is required. -s \ p9584028_112020_Generic. They can only be run manually outside of DBUA.2. To install a newer version with mopatch.

sql is available via My Oracle Support note 884522.sql Both pre-upgrade information tools utlu112i.sql at least once is mandatory. easy to use Support of Windows and Unix platforms environment check included standard post-ugprade tasks included 08. To check the pre-upgrade status.log SQL> @utlu112i.log'. The latest version of the pre-upgrade information script utlu112i.sql (Oracle-generic) and utlu112i_sap.log SQL> @pre_upgrade_tasks.2011 Page 5 of 12 .sql SQL> spool off Note: o For manual database upgrades. To run the pre-upgrade information scripts one by one: a) Running the generic pre-upgrade information utility utlu112i.sql SQL> spool off 3.1.sql SQL> spool off b) Running the SAP-specific pre-upgrade checks: SQL> spool pre_upgrade_checks. DBUA wrapper scripts DBUA wrapper scripts provide the following benefits: o o o o o The database upgrade is based on DBUA.2.0: Upgrade Scripts 2. running the script utlu112i.sql (SAP-specific) are run in this step. run the following command: OS> sqlplus / as sysdba @pre_upgrade_status.SAP Note 1431793 - Oracle 11. Running pre-upgrade-tasks is recommended to improve the performance of the upgrade process: OS> sqlplus / as sysdba SQL> spool pre_upgrade_tasks.sql: SQL> spool pre_upgrade_info.log SQL> @pre_upgrade_checks.08. o 5. The result is logged in 'pre_upgrade_status.

2. Using the DBUA Wrapper on Unix The dbua wrapper script dbua. required patches).2 is installed (incl. Specify source and target Oracle homes. o The current version of the upgrade scripts is Set required environment variables. Logon to the database server as the Oracle database administrator user ('oracle' or 'ora<dbsid>') and change the current directory to the location of the post-upgrade scripts.SAP Note 1431793 Prerequisites: o Oracle 11.2: OS> setenv ORACLE_HOME_SRC /oracle/C11/102_64 Example for release 11. Example for release 10. OS> env | grep DISPLAY OS> xclock & 3. a) ORACLE_HOME_SRC (mandatory) <ORACLE_HOME_SRC> specifies the location of the source Oracle home. ensure that environment variable DISPLAY is set. For Unix platforms. Example for release 11. OS> . see SAP note 1524205.0./dbua.2: OS> setenv ORACLE_HOME_TGT /oracle/C11/11202 4. 1. For information about the differences between the 'installation location' and the 'run-time location' see SAP note 1524205.08.2011 Page 6 of 12 is used on Unix/Linux platforms to run the DBUA with the correct command line options. OS> cd <ora_upgrade>/post_upgrade 2.0: Upgrade Scripts Oracle Database Software Release 11.1: OS> setenv ORACLE_HOME_SRC /oracle/C11/112_64 b) ORACLE_HOME_TGT (mandatory) <ORACLE_HOME_TGT> specifies the installation location (!) of the source Oracle home.0.2. a) For non-silent database upgrade with DBUA. Run the wrapper script in query -q 08.

2): UNIX. DBUA is not started!! 5. In non-silent mode: OS> .2011 Page 7 of 12 . 08.sql 11. In silent mode: OS> . review the summary of changes and start the database upgrade by choosing 'Finish'.sap. If the configuration is ORA-32004/ORA-32006 are expected and can be safely To check the post-upgrade status. the instance is be stopped. Using the DBUA wrapper on Windows The dbua wrapper script dbua. Based on Oracle Patch Set Release 11.2'./check_dbua_logs.SAP Note 1431793 - Oracle 11. Configure the run-time environment See 'Step 3: Post-Upgrade Steps' in SAP note 1524205. see ' Verify the DBUA logs for unexpected ORA-messages.0. 8. 6. listener. 9. run the following command: OS> sqlplus / as sysdba @post_upgrade_status. Perform Post-Upgrade Tasks There might be additional post-upgrade tasks that need to be performed which are documented in the SAP Database Upgrade Guide 'Upgrade to Oracle Database 11g Release 2 (11.08.0: Upgrade Scripts The following tasks are performed in query mode: environment is checked Certain parameter files (i. Upgrade the database Now the database will be upgraded with DBUA to the new database release./ After DBUA has finished. init<DBSID>.sh -silent 7.ps1 is used on Windows platforms to run the DBUA with the correct command line options. Start the instance from the run-time environment./dbua. If you need to change the configuration. OS> . On the summary On each screen choose 'Next' to go to the next page. -help' for available options of the wrapper are copied from the source Oracle Home to the target Oracle Home.2. go to the next step.

ps1 2. Troubleshooting the Database Upgrade For solutions and workarounds of known upgrade issues. PS> dbua. 7.08. If DBUA seems to hang during the upgrade. Change the directory to '<ora_upgrade>/post_upgrade' and run the scripts from SQL*Plus as SYSDBA: 1.2011 Page 8 of 12 . check whether there is a DBUA warning message that has come up in a window behind the 'Database Upgrade Assistant: Progress' window.log SQL> @upgrade_tstz.sql (Unix/Linux only) SQL> @set_compatible. SQL> @post_upgrade_status.log SQL> @post_upgrade_tasks. 2.sql SQL> spool off Set database parameters SQL> @set_remote_os_authent. Running Post-Upgrade Scripts If necessary.log'.0: Upgrade Scripts 1. When On the summary screen.2. 08. 4. see SAP note 1431797. review the summary of changes and start the database upgrade by choosing 'Finish'. run the post-upgrade scripts after the upgrade. 6. From this Powershell start the Database Upgrade Assistant with the wrapper script. 3. 4.SAP Note 1431793 - Oracle 11. review the DBUA upgrade results and close DBUA. Open a Powershell in elevated mode (run as administrator) and change the working directory to <ora_upgrade>\post_upgrade.sql SQL> spool off Upgrade of timezone file version SQL> spool post_upgrade_tz_upgrade. Post-upgrade tasks SQL> spool post_upgrade_tasks.sql The result of this check is logged in 'post_upgrade_status.sql (Unix + Windows) Perform post-upgrade checks Check whether the database is configured correctly. 3. On each screen choose 'Next' to go to the next page.

sh': Show DBUA wrapper script online help: OS> .sap. PreUpgradeResults. the following log files of DBUA provide relevant information: o $ORACLE_BASE/cfgtoollogs/dbua/$DB_SID For each upgrade run there is a separate directory 'upgrade<n>' created containing the logs and traces of this run.08. PostUpgrade./dbua.SAP Note 1431793 - Oracle -no_scripts Skip changing parameter compatible: 08. After the upgrade and on Unix platforms only you can check the log files of the last DBUA run for error messages that have occurred during the upgrade using the check script check_dbua_logs.0: Upgrade Scripts During the 'Running Custom Scripts' phase you can safely ignore ORA-32004 and ORA-32006 messages and continue with the upgrade./dbua. 11gupgrade_11202. Log file of This is the default way to upgrade the': None Options and flags of the Unix DBUA wrapper script 'dbua.log. Oracle_Server. -silent Skip SAP specific post-upgrade scripts: OS> .log. this directory contains the log file 'silent. Upgrade database with DBUA in silent mode: OS> ./dbua.2011 Page 9 of 12 SpaceUsage. CustomScript.log.log./dbua. OS> cd <ora_upgrade>/post_upgrade OS> /bin/sh check_dbua_logs. Examples of log files are: UpgradeTimezone./dbua. -V|-Version Run DBUA wrapper script in query mode / test mode: OS> .log. o A DBUA Wrapper Script Options and flags of the Windows DBUA wrapper script 'dbua.log) o $ORACLE_BASE/cfgtoollogs/dbua/logs In case of a silent -q|-query Upgrade database with DBUA in interactive mode: OS> .sh -h|-help Show DBUA wrapper script version information: OS> .sh If a detailled analysis of upgrade issues is needed. The messages can be accessed later from the DBUA upgrade summary.log'.

2): OS> .sap.1 Changes / Modifications are: Enhanced pre.0.2.and post-upgrade checks dbua. SAP_USER_IND_COLUMNS).2 available.Updated utlu112i.shipped as 2 patches for release .1: . updated parameter settings - Version -tz_script B Version History 2011-04-08 o New version of upgrade scripts for release 11.1. 002: . automatic instance stop after the upgrade .2011 Page 10 of 12 ./dbua.2./dbua.SAP Note 1431793 OS> .sql updated: version: 08.0.2./dbua.sql script (11.0: Upgrade Scripts Skip timezone file version upgrade in DBUA: OS> .4 and 11.08.2.sql in DBUA: OS> . The upgrade scripts are available as single database patch new environment variable ORACLE_HOME_TGT.Modified: script versioning -no_puc Skip sapuprof_profile.p9584028_102040_Generic./ -no_tz Skip Check for AWR retention could result in ORA-01422 -no_sapuprof Use upgrade_TSTZ.0 build: 003 .sql version: 11.0 build: 002 .several minor changes and bug fixes Version 2.included in SAP Bundle Patch 201008 -no_compatible Oracle 11.sql: automatic clean up of SAP note 519448 (SAP_USER_INDEXES.Added: fix_control 9495669 .zip and in SAP Bundle Patch as of April 2011 (see SAP note 1503709).sql for timezone file version upgrade: OS> .p9584028_112010_Generic.

ora. This patch is also included in the SAP Bundle Patches starting May 2010 (see SAP note 1431795).new: listener. report of warnings Version 2.0: Initial version Header Data Release Status: Released on: RMAN libobk library is copied to new Oracle Home (if it exists) .0: Upgrade Scripts Version 2.08.sql . Added logging to overall enhancements + corrections Version 2.1: README updated Version and init<SID>.new: report of warnings set_compatible.log) Added check for Oracle Net configuration files Added check script '-puc' option to run post-upgrade-checks.0 is shipped as Oracle patch fix_control set for bug 6972291 .2011 Released for Customer (dbua.sql: .new: short syntax is used to set event parameter ADR_BASE_LISTENER is set in sqlnet.0: Released for customers Version init<SID>.sql: .SAP Note 1431793 - Oracle 11.ps1 Added SQL script version info Added several pre-/post-upgrade checks check for existence of TDE encryption wallet .2011 13:58:09 Page 11 of 12 .sap. sqlnet.06.sql: Added parameter _IN_MEMORY_UNDO=FALSE Added check for PLAN_TABLE in SAP schema Version 2.sql is run by default .0: Added support for Windows platforms dbua.ora existing table PLAN_TABLE in SAP schema(s) are recreated pre_upgrade_check.ora are copied to new OH .sql: .utl are copied to new Oracle Home .

2.0: Upgrade Scripts English Recommendations/additional info Consulting BC-DB-ORA Oracle The Note is release-independent Related Notes Number 1431800 1431797 974781 Short Text Oracle 11.2011 Page 12 of 12 .2 Troubleshooting the Database Upgrade Oracle internal maintenance jobs Attributes Attribute Database system Database system Value ORACLE Oracle 11.2.SAP Note 1431793 Master Language: Priority: Category: Primary Component: Oracle 11.0: Central Technical Note Oracle 11.