Complete Checklist to Upgrade the Database to 11gR2 using DBUA [ID 870814.1]
[Thread-105] [ 2013-03-19 09:38:20.323 GMT-05:00 ] [BasicStep.handleNonIgnorableError:430] oracle.sysman.assistants.util.UIMessageHandler@3d3c4c09:messageHandler
[Thread-105] [ 2013-03-19 09:38:20.323 GMT-05:00 ] [BasicStep.handleNonIgnorableError:431] ORA-04063: package body "SYS.DBMS_SQLTUNE" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_SQLTUNE"
ORA-06512: at "SYS.DBMS_STATS", line 20337
ORA-06512: at "SYS.DBMS_STATS", line 20360
ORA-06512: at line 11
The problem is caused by the public synonym XMLCONCAT
Cause
The problem is caused by the public synonym XMLCONCAT
Solution
Start the database (from the 11gR2 home) in upgrade mode as below:
SQL> startup upgrade
1. Drop the synonym:
SQL> drop public synonym XMLCONCAT;
2. Recompile the package
SQL> alter package DBMS_SQLTUNE_INTERNAL compile body;
If the above is successful, then re-run CATUPGRD.SQL again:
In this Document
Purpose |
Ask Questions, Get Help, And Share Your Experiences With This Article |
Scope |
Details |
REQUIRED POST UPGRADE STEPS |
References |
Applies to:
Oracle Server - Enterprise Edition - Version 9.2.0.8 to 11.2.0.3 [Release 9.2 to 11.2]
Oracle Server - Standard Edition - Version 9.2.0.8 to 11.2.0.3 [Release 9.2 to 11.2]
Information in this document applies to any platform.
Purpose
The purpose of this article is to minimize the downtime while upgrading the database using DBUA.
DBUA automates the upgrade process by performing all of the tasks normally performed manually. There are some steps which can be performed when the database is running. If these steps can be done manually before upgrading using DBUA, the downtime can be minimized.
Ask Questions, Get Help, And Share Your Experiences With This Article
Click here to join the discussion where you can ask questions, get help from others, and share your experiences with this specific article.
Discover discussions about other articles and helpful subjects by clicking here to access the main My Oracle Support Community page for Database Install/Upgrade.
Scope
Database Administrators, Support
Details
Database Upgrade Assistant (DBUA)
- It Provides a graphical user interface (GUI) that guides you through the upgrade of a database.
- It is the recommended method for performing a major release upgrade or patch release upgrade.
- It automates the upgrade process by performing all of the tasks.
- It makes appropriate recommendations for configuration options such as tablespaces, redo, optimizer statistics and time zone file, etc. You can then act on these recommendations. This method is very easy and user friendly.
- Hidden parameters which are in the source database are not carried to the target database by DBUA, This is expected behavior. Oracle recommends removing all hidden parameters prior to upgrading.
To view existing hidden parameters execute the following command while connected AS SYSDBA:
Changes will need to be made in the init.ora or spfile if you are manually upgrading the database. If you are using the DBUA then it is taken care by DBUA.
DBUA performs some of the checks before actually starting the database upgrade.
So those steps and recommendations can be performed when the database is in normal startup mode. By performing these steps manually, the down time can be minimized.
DBUA performs the following checks before the upgrade:
=> Invalid user accounts or roles
=> Invalid data types or invalid objects
=> De-supported character sets
=> Adequate resources, including rollback segments, tablespaces, and free disk space
=> Missing SQL scripts needed for the upgrade
=> Listener running (if Oracle Enterprise Manager Database Control upgrade or configuration is requested)
=> Oracle Database software linked with Database Vault option. If Database Vault is enabled, then DBUA will return an error asking you to disable Database Vault prior to upgrade. See "Disable Oracle Database Vault"
=> Stale optimizer statistics
=> Time zone file versions
=> Enterprise Manager Database control Repository exists in the database or not
Recommendations for Source database
1) Ensure that all database components/objects provided by Oracle are VALID in the source database prior to starting the upgrade.
2) Ensure that you do not have duplicate objects in the SYS and SYSTEM schema.
The following objects are permissible duplicate objects:
OBJECT_NAME OBJECT_TYPE
AQ$_SCHEDULES TABLE
AQ$_SCHEDULES_PRIMARY INDEX
DBMS_REPCAT_AUTH PACKAGE
DBMS_REPCAT_AUTH PACKAGE BODY
Please refer to the following article for complete instructions to remove any other duplicates.
NOTE.1030426.6 HOW TO CLEAN UP DUPLICATE OBJECTS OWNED BY SYS AND SYSTEM
3) Disable the custom triggers that would fire before/after DDL and enable them after the upgrade is complete.
Requirements and recommendations for target database
- Download and Install Oracle 11g Release 2 in a new Oracle Home and make sure there are no relinking errors.
- Install the latest available Patchset from Metalink. (If available).
- Install the latest available Critical Patch Update. (If available).
- Either take a Cold or Hot backup of your source database (advisable to have cold backup).
- Check the database server upgrade/downgrade compatibility before upgrading the database.
Compatibility Matrix
Minimum Version of the database that can be directly upgraded to Oracle 11g Release 2
Source Database Target Database
9.2.0.8 or higher 11.2.x
10.1.0.5 or higher 11.2.x
10.2.0.2 or higher 11.2.x
11.1.0.6 or higher 11.2.x
The following database version will require an indirect upgrade path.
Source Database ---> Upgrade Path for Target Database--->Target Database
7.3.3 (or lower)-----> 7.3.4 ---> 9.2.0.8 ---->11.2.x
8.0.5 (or lower)----> 8.0.6 ---> 9.2.0.8 ---->11.2.x
8.1.7 (or lower)----> 8.1.7.4---> 10.2.0.4---->11.2.x
9.0.1.3 (or lower)----> 9.0.1.4-- ->10.2.0.4---->11.2.x
9.2.0.7(or lower)---->9.2.0.8---->11.2.x
For example:
If source database is 8.1.7.0.0, the upgrade path to be followed is as below:
8.1.7.0.0 --> 8.1.7.4 --> 10.2.0.4--> 11.2.x.
NOTE: DBUA throws the following error if not on minimum version:
"The CEP File does not provide the version directive"
Run the Pre-Upgrade Information Tool for Collecting Pre-Upgrade Information
To download and use the latest Pre-Upgrade Information Tool see the following:
Note 884522.1: How to Download and Run Oracle's Database Pre-Upgrade Utility
or
Step 1
-------
- Log in to the system as the owner of the Oracle Database 11g Release 2 (11.2) Oracle Home directory.
- Copy the Pre-Upgrade Information Tool (utlu112i.sql) from the Oracle Database 11g Release 2 (11.2) ORACLE_HOME/rdbms/admin directory to a directory outside of the Oracle Home, such as the temporary directory on your system.
Step 2
-------
- Change to the directory where utlu112i.sql had been copied in the previous step.
- Start SQL*Plus and connect to the database instance as a user with SYSDBA privileges. Then run and spool the utlu112i.sql file. Please note that the database should be started using the Source Oracle Home.
SQL> spool upgrade_info.log
SQL> @utlu112i.sql
SQL> spool off
Check the spool file and examine the output of the Upgrade Information Tool.
The sections which follow describe the output of the Upgrade Information Tool.
For sample output, Click here
Check for INVALID database components and objects in the Source database
Ensure that there are NO INVALID database components/objects in the source database prior to starting the upgrade.
You can execute the following query to check the invalid database components/objects in the source database:
set linesize 100
select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from
dba_registry order by comp_name;
select substr(object_name,1,40) object_name,substr(owner,1,15) owner,object_type from
dba_objects where status='INVALID' order by owner,object_type;
select owner,object_type,count(*) from dba_objects where status='INVALID' group by
owner,object_type order by owner,object_type ;
If you find invalid objects and/or database components then try to VALIDATE the invalid objects and/or database components by executing the following steps:
Run $ORACLE_HOME/rdbms/admin/utlrp.sql to validate the invalid objects in the database. You can execute the utlrp.sql scripts multiple times to validate the invalid objects.
$ sqlplus "/ as sysdba"
SQL> @utlrp.sql
You may get the following warning message if recommended checks are not done prior to upgrade:
Database is using the old time zone file version. After the upgrade ,patch the database timezone file version using the DBMS_DST package to record the latest time zone file Version
Database contains stale optimizer statistic. Refer to the Upgrade Guide for instruction to update statistics prior to upgrade the database
Enterprise manager Database Control Repository exists in the database . Direct downgrade of the Enterprise Manager Control is not supported . Refer to the 11g Upgrade Guide for the instruction to save the Enterprise manager data prior to upgrade
Do you want to continue with upgrade ?
Check for TIMESTAMP WITH TIMEZONE Datatype
The time zone files that are supplied with Oracle Database 11g Release 2 (11.2) have been updated to version 11 (11.2.0.1) and 14 (11.2.0.2/11.2.0.3)to reflect changes in transition rules for some time-zone regions.
The changes might affect existing data of the TIMESTAMP WITH TIME ZONE data type.
Case 1
--------
Output of pre-upgrade utility is showing a statement like :
If the source database is using a timezone file lower or equal to :
- version 11 and target oracle home is 11.2.0.1
or
- version 14 and target oracle home is 11.2.0.2/11.2.0.3
then nothing to do in source home , it is suggested to use DBMS_DST package AFTER the upgrade :
Note 977512.1 : Updating the RDBMS DST version in 11gR2 (11.2.0.1 and up) using DBMS_DST
Case 2
--------
Output of pre-upgrade utility is showing a statement like :
If the source database is using a timezone file greater than :
- version 11 and target oracle home is 11.2.0.1
or
- version 14 and target oracle home is 11.2.0.2/11.2.0.3
then BEFORE upgrading you MUST patch the 11gR2 $ORACLE_HOME with a timezone data file of the SAME version as the one used in the source release database.
For a detailed description of the time zone upgrade, please refer to the following :
Note 815679.1 : Actions For DST Updates When Upgrading To 11.2.0.1 Base Release
Note 1201253.1 : Actions For DST Updates When Upgrading To Or Applying The 11.2.0.2 Patchset
Note 1358166.1 : Actions For DST Updates When Upgrading To Or Applying The 11.2.0.3 Patchset
Once upgrade will be finished if you want to apply the last DST/TZ patch on target home then refer to :
Note 412160.1 : Updated DST transitions and new Time Zones in Oracle Time Zone File patches
Note:
The TIMESTAMP WITH TIME ZONE data stored in the database can become corrupted during the upgrade if there is a time zone file version mismatch.
Audit records From 10gr2 DBUA/catupgrd script can spend an infinite time to process the records in FGA_LOG$ and/or AUD$ if there are too many records.
See Note 1062993.1 : 11.2.0.1 Catupgrd.sql Hangs While Running Procedure POPULATE_DBID_AUDIT
For 10.2 and later source versions there is now a pre-process script available :
Note 1329590.1 : How to Pre-Process SYS.AUD$ Records Pre-Upgrade From 10.1 or later to 11gR1 or later.
If do not want to keep the records collected before 11GR2 then you can just do in source environment :
truncate table sys.aud$;
truncate table sys.fga_log$;
Optimizer Statistics
When upgrading to Oracle Database 11g Release 2 (11.2), optimizer statistics are collected for dictionary tables that lack statistics. This statistics collection can be time consuming for databases with a large number of dictionary tables, but statistics gathering only occurs for those tables that lack statistics or are significantly changed during the upgrade.
To determine the schema's which lack statistics, download and run the script from below MOS article:
To decrease the amount of downtime incurred when collecting statistics, you can collect statistics prior to performing the actual database upgrade. As of Oracle Database 10g Release 1 (10.1), Oracle recommends that you use the DBMS_STATS.GATHER_DICTIONARY_STATS procedure to gather these statistics. For example, you can enter the following:
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
If you are using Oracle Database 9i Release 2 (9.2), then you should use the DBMS_STATS.GATHER_SCHEMA_STATS procedure to gather statistics. To do this, you can run the scripts provided in Appendix D.
Appendix D has sample script, which creates the table, dictstattab, and exports the statistics for the RDBMS component schema into it. The statistics collection might give errors if a particular component schema does not exist in the database, or if a component is not installed or invalid.
Backup the existing statistics to revert / import back the statistics, once the upgrade is successful.
For example, the following PL/SQL subprograms import the statistics for the SYS schema after deleting the existing statistics:
SQL> EXEC DBMS_STATS.IMPORT_SCHEMA_STATS('SYS','dictstattab');
Backing up Enterprise Manager Database Control Data
After upgrading to Oracle Database 11g release 2(11.2), if you want to downgrade Oracle Enterprise Manager Database Control you must save your Database Control files and data before upgrading your database. The emdwgrd utility can be used to keep a copy of your database control files and data before upgrading your database. The emdwgrd utility resides in the ORACLE_HOME/bin directory in the Oracle Database 11g release 2 (11.2) Home.
1. Set ORACLE_HOME to your old Oracle Home.
2. Set ORACLE_SID to the SID of the database being upgraded.
3. Set PATH, LD_LIBRARY_PATH and SHLIB_PATH to point to the Oracle Home from which the database is being upgraded.
4. Change directory to Oracle Database 11g release 2 (11.2) Home.
5. Run the following command:
a. Run the following command for single instance database:
where old_SID is the SID of the database being upgraded and save_directory is the path to the storage place you have chosen for your Database Control files and data.
Please refer to the following article for complete information:
b. For a RAC database, remote copy is required across the cluster nodes. Define an environment variable to indicate which remote copy is configured. For example: setenv EM_REMCP /usr/bin/scp
Note: If 10g Oracle Home is on a shared device, add -shared to the previous command line.
The above command(s) may core dump on HP-UX Itanium platform, which is a known issue. For more information, refer to following MOS article:
6. Enter the SYS password for the database to be upgraded.
Note: On RAC databases you will be prompted to run '/tmp/racdwgrd_dbctl.sh' on each of the nodes.
Disable Oracle Database Vault
When upgrading from Oracle Database Release 10.2, if you have enabled Oracle Database Vault option in your current Oracle Home, then you must disable Oracle Database Vault in the target Oracle home where the new release 11.2 software is installed before upgrading the database, and enable it again when the upgrade is finished. If Database Vault is enabled, then DBUA will return an error asking you to disable Database Vault prior to upgrade.
You must do this before upgrading the database. Enable Oracle Database Vault again once the upgrade is complete.
Please refer to the following Documentation/Articles for complete information to Disable/Enable Oracle Database Vault:
Disabling and Enabling Oracle Database Vault
OR
You can also refer to the following MOS Documents for Disabling Oracle Database Vault before the upgrade and enabling it after the upgrade:
Note 453902.1 - Enabling and Disabling Oracle Database Vault in WINDOWS
Note 1085051.1 - 11gR2 DBUA Errors - Database Vault Option Is Enabled
Check Deprecated CONNECT Role
After upgrading to Oracle Database 11g Release 1 (11.2) from Oracle Database9i Release 2 (9.2) or Oracle Database 10g Release 1 (10.1), the CONNECT role has only the CREATE SESSION privilege; the other privileges granted to the CONNECT role in earlier releases are revoked during the upgrade. To identify which users and roles in your database are granted the CONNECT role, use the following query:
WHERE granted_role = 'CONNECT' and
grantee NOT IN (
'SYS', 'OUTLN', 'SYSTEM', 'CTXSYS', 'DBSNMP',
'LOGSTDBY_ADMINISTRATOR', 'ORDSYS',
'ORDPLUGINS', 'OEM_MONITOR', 'WKSYS', 'WKPROXY',
'WK_TEST', 'WKUSER', 'MDSYS', 'LBACSYS', 'DMSYS',
'WMSYS', 'EXFSYS', 'SYSMAN', 'MDDATA',
'SI_INFORMTN_SCHEMA', 'XDB', 'ODM');
If users or roles require privileges other than CREATE SESSION, then grant the specific required privileges prior to upgrade.
The upgrade scripts adjust the privileges for the Oracle-supplied users.
In Oracle 9.2.x and 10.1.x CONNECT role includes the following privileges:
FROM DBA_SYS_PRIVS
WHERE GRANTEE ='CONNECT'
GRANTEE PRIVILEGE
------- ----------------------
CONNECT CREATE VIEW
CONNECT CREATE TABLE
CONNECT ALTER SESSION
CONNECT CREATE CLUSTER
CONNECT CREATE SESSION
CONNECT CREATE SYNONYM
CONNECT CREATE SEQUENCE
CONNECT CREATE DATABASE LINK
From Oracle 10.2, 'CONNECT' role only includes 'CREATE SESSION' privilege.
Using the Oracle Net Configuration Assistant
a) Stop the listener for the database.
Previous versions of the listener are not supported for use with an Oracle Database 11g Release 2 (11.2) database. However, it is possible to use the new version of the listener with previous versions of Oracle Databases.
If you are upgrading from 9i then run Oracle Net Configuration Assistant before upgrading the Oracle database.
This is a two-step option.
You must first run Oracle Net Configuration Assistant from the old Oracle Home to remove the old listener.
- Invoke the Netca
- Choose the configuration you want to do ==> Choose Listener Configuration
- Select what you want to do ==> Delete
- Select the listener you want to delete .
Then you must run Oracle Net Configuration Assistant again from the new Oracle Database 11g Release 2 (11.2) Home to create a new listener.
- Invoke the Netca
- Choose the configuration you want to do ==> Choose Listener Configuration
- Select what you want to do ==> Add
- Provide the detail that is required to configure the listener.
You must remove the old listener before creating a new one. If you attempt to create a new listener from the new Oracle Home first, and use the same name and port as the old listener, then Oracle Net Configuration Assistant returns an error.
Note: This is your only option if you want to upgrade your Oracle RAC database manually.
b) Stop other executable such as dbconsole, isqlplus, etc.
$ isqlplusctl stop
Password protected rolesIn version 11.2 password protected roles are no longer enabled by default,
if any of your applications relies on such roles being enabled by default and you take no measures to allow
the user to enter the password with the set role command, it is recommended to remove the password
from those roles to allow for existing privileges to remain available, for more information see :
Note 745407.1 : What Roles Can Be Set as Default for a User?
Oracle Database Security Guide 10g Release 2 (10.2) Part Number B14266-07
Oracle Database Security Guide 11g Release 1 (11.1) Part Number B28531-15
Oracle Database Security Guide 11g Release 2 (11.2) Part Number E16543-09
Memory settings
Ensure that the SHARED_POOL_SIZE , LARGE_POOL_SIZE as well as the JAVA_POOL_SIZE are greater than 150MB (At least 250MB if you are running XDB)
else you may hit problems described in :
Note 789779.1 : DBUA Error ORA-04031 unable to allocate 4120 bytes of shared memory, ORA-01034: ORACLE not available, ORA-00600: internal error code, arguments: [504]
Note 1127179.1 ORA-07445 [qmkmgetConfig()+52] During Catupgrd.sql (11.2.0.1).
Starting Upgrade Using DBUA:
On Linux or UNIX platforms, enter the following command at a system prompt in the Oracle Database 11g Release 2 (11.2.0.x) environment:
Make sure that you are invoking the DBUA utility from the target Oracle home only .
You can invoke it directly from the $ORACLE_HOME/bin of the target Oracle home
% ./dbua
OR
Invoke it from any location by setting ORACLE_BASE ,ORACLE_HOME and PATH environment variable pointing to the target Oracle
Note: The dbua executable is usually located in the $ORACLE_HOME/bin directory.
On Windows operating systems, select:
The DBUA Welcome screen appears.
REQUIRED POST UPGRADE STEPS
Please complete the following tasks after you have upgraded your database:
1) Verify that the following environment variables are set to point to 11.2.0.x Installation:
ORACLE_BASE
ORACLE_HOME
PATH
Note: DBUA automatically points oratab to the new Oracle Home. However, client scripts must be checked no matter which method you use to upgrade.
If you are upgrading a cluster database, then perform these checks on all nodes on which this cluster database has instances configured.
2) Upgrade the Recovery Catalog
For complete information about upgrading the recovery catalog and the UPGRADE
CATALOG command, see Oracle Database Backup and Recovery User's Guide for the
topic that describes the procedures.
3) Upgrade the Time Zone File Version
If the Pre-Upgrade Information Tool instructed you to upgrade the time zone files after
completing the database upgrade, then use the DBMS_DST PL/SQL package to
upgrade the time zone file.
4) Upgrade Statistics Tables Created by the DBMS_STATS Package
If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE
procedure, then upgrade these tables by running the following procedure:
In the example, SCOTT is the owner of the statistics table and STAT_TABLE is the
name of the statistics table. Perform this procedure for each statistics table.
5) Upgrade Externally Authenticated SSL Users
If you are upgrading from Oracle9i Release 2 (9.2) or Oracle Database 10g Release 1
(10.1), and you are using externally authenticated SSL users, then you must run the
SSL external users conversion (extusrupgrade) script to upgrade those users. The
script has the following syntax:
Note: If you are upgrading from Oracle Database 10g Release 2 (10.2) or higher, then you are not required to run this command.
6) Enable Database Vault
Refer to the following MOS Documents for enabling Oracle Database Vault:
Note 453902.1 - Enabling and Disabling Oracle Database Vault in WINDOWS
7) Configure Fine-Grained Access to External Network Services
To avoid "ORA-24247: network access denied by access control list (ACL)" when executing UTL packages (Network related Packages), access has to be granted to user using these packages.
The following example first looks for any ACL currently assigned to host_name. If one is found, then the example grants user_name the CONNECT privilege in the ACL only if that user does not already have it. If no ACL exists for host_name, then the example creates a new ACL called ACL_name, grants the CONNECT privilege to user_name, and assigns the ACL to host_name.
acl_path VARCHAR2(4000);
BEGIN
SELECT acl INTO acl_path FROM dba_network_acls
WHERE host = 'host_name' AND lower_port IS NULL AND upper_port IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(acl_path,'principal','privilege') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl_path,'principal', is_grant, 'privilege');
END IF;
EXCEPTION
WHEN no_data_found THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('ACL_name.xml','ACL description', 'principal', is_grant, 'privilege');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('ACL_name.xml','host_name');
END;
COMMIT;
acl_name.xml => Enter a name for the access control list XML file.
ACL description => 'file description',
principal => 'user_or_role',
is_grant => TRUE|FALSE,
privilege => 'connect|resolve',
host_name => host name
Refer to the below note on how to use DBMS_NETWORK_ACL_ADMIN Package and also to avoid ORA-24247: network access denied by access control list (ACL):
8) Change the compatible parameter to the new release after the upgrade.
After upgrading to Oracle Database 11g Release 2 (11.2), you can set the COMPATIBLE initialization parameter to match the release number of the new release. Doing so enables you to use all features of the new release, but prevents you from downgrading to your earlier release.
Oracle recommends increasing the COMPATIBLE parameter only after complete testing of the upgraded database has been performed.
After you increase the COMPATIBLE parameter, the database cannot subsequently be downgraded to earlier releases.
Known Issues
Revision History
03-Sep-2009 Article Created
The window below is a live discussion of this article (not a screenshot). We encourage you to join the discussion by clicking the "Reply" link below for the entry you would like to provide feedback on. If you have questions or implementation issues with the information in the article above, please share that below.