Complete checklist to upgrade the database to 11g R2 using DBUA [ID 870814.1]

Complete checklist to upgrade the database to 11g R2 using DBUA [ID 870814.1]

修改时间 01-AUG-2011 类型 BULLETIN 状态 PUBLISHED

In this Document
Purpose
Scope and Application
Complete checklist to upgrade the database to 11g R2 using DBUA
REQUIRED POST UPGRADE STEPS
References


Applies to:

Oracle Server - Standard Edition - Version: 9.2.0.8 to 11.2.0.2 - Release: 9.2 to 11.2
Oracle Server - Enterprise Edition - Version: 9.2.0.8 to 11.2.0.2 [Release: 9.2 to 11.2]
Information in this document applies to any platform.

Purpose

The purpose of this article 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 this steps can be done manually before upgrading using DBUA, the downtime can be minimized.

Scope and Application

Database Administrators, Support

Complete checklist to upgrade the database to 11g R2 using DBUA

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 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:

SELECT name,description from SYS.V$PARAMETER WHERE name LIKE '_%' ESCAPE ''

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 the actually starting the database upgrade.
So those steps and recommendation can be performed when the database is in normal startup mode.By performing this 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

Requirements 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 ---&gt Upgrade Path for Target Database---&gtTarget Database
7.3.3 (or lower)-----&gt 7.3.4 ---&gt 9.2.0.8 ----&gt11.2.x
8.0.5 (or lower)----&gt 8.0.6 ---&gt 9.2.0.8 ----&gt11.2.x
8.1.7 (or lower)----&gt 8.1.7.4---&gt 10.2.0.4----&gt11.2.x
9.0.1.3 (or lower)----&gt 9.0.1.4-- ->10.2.0.4----&gt11.2.x
9.2.0.7(or lower)----&gt9.2.0.8----&gt11.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 --&gt 8.1.7.4 --&gt 10.2.0.4--&gt 11.2.x.

NOTE : DBUA throws the following error if not on minimum version:
"The CEP File does not provide the version directive"


Check for the INVALID database component 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 pagesize500
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 the invalid objects and database components they try to VALIDATE the invalid objects and 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 .

$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus "/ as sysdba"
SQL> @utlrp.sql

You may get the following warning message if the following thing are not done prior to upgrade

Oracle Corporation strongly recommends that the following issues be resolved in the database "upgrade" before you start the database 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 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.


Case1
=====

If the source database is using a timezone file older than version 11 then the utlu112i.sql (Pre-Upgrade Information Tool) will generate the following warning
Example :

WARNING: --&gtDatabase is using a timezone file older than version 11.
.... After the release migration, it is suggested that DBMS_DST package
.... be used to upgrade the 11.1.0.6.0 database timezone version
.... to the latest version which comes with the new release.

After patching the timezone files to the required Timezone file version, You need to re-run pre-upgrade script utlu112i.sql,
Running the Pre- upgrade script does not always update the TZ version information in the registry .
Please execute the following sql query in the source database to find the Version of existing timezone files:

For 10.1.0.x, 10.2.0.x, 11.1.0.x


SQL> SELECT version FROM v$timezone_file;


For 9.2.0.x, download and run utltzver.sql script here

Example
=======


SQL> @utltzver.sql
Your current 9i Server timezone version is 4!

PL/SQL procedure successfully completed.


Case 2
======
If the source database is using a timezone file greater than version 11 then utlu112i.sql (Pre-Upgrade Information Tool) will generate the following warning .

Example :

WARNING: --&gt Database is using a timezone file greater than version 11.
.... BEFORE upgrading the database, patch the 11gR2
.... $ORACLE_HOME/oracore/zoneinfo/ with a timezone data file of the
.... same version as the one used in the 11.1.0.6.0 release database.

After patching the timezone files to the required Timezone file version, you need to re-run
running the Pre- upgrade script utlu112i.sql

for the latest available time zone files, please refer to


Note 412160.1 Updated DST transitions and new Time Zones in Oracle Time Zone File patches




BEFORE upgrading the database, you MUST patch the 11gR2 $ORACLE_HOME/oracore/zoneinfo/ with a timezone data file of the same version as the one used in the source release database. Apply the patch for each database you will be upgrading. Otherwise, the upgrade script will terminate without upgrading the database.

if the source database is using timezone files higher than version 11 and the Oracle 11gR2 Oracle home is NOT patched with the same version timezone before upgrade then you will get the following error while trying to upgrade the database .

ERROR at line 1:
ORA-01722: invalid number


For a detailed description of time zone upgrade, Please refer the following My Oracle Support (formerly OracleMetalink) notes:


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




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 lacks statistics, download and run the script from below Metalink article

Note 560336.1 Script to Check Schemas with Stale Statistics

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:

$ sqlplus "/as sysdba"
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.DELETE_SCHEMA_STATS('SYS');
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.
a- Run the following command for single instance database
$ emdwgrd -save -sid old_SID -path save_directory


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 the following article for complete information
Note 870877.1 How To Save Oracle Enterprise Manager Database Control Data Before Upgrading The Single Instance Database To Other Release ?


b- For 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

$ emdwgrd -save -cluster -sid old_SID -path save_directory


Note: If 10g Oracle home is on a shared device, add -shared to the previous command line.

The above command(s) may core dump in HP-UX Itanium platform, which is a known issue. For more information, refer to following Metalink article

Note 562980.1 - emdwgrd core dumps : emdwgrd[228]: 10366 Memory fault(coredump)


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 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 Metalink Documents for Disabling Oracle Database Vault before the upgrade and enabling it after the upgrade.
Note 803948.1 - How To Uninstall Or Reinstall Database Vault in 11g (UNIX)
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:

SELECT grantee FROM dba_role_privs
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:
SELECT GRANTEE,PRIVILEGE
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.

Run the Pre-Upgrade Information Tool for Collecting Pre-Upgrade Information


To download and use the latest Pre-Upgrade Information Tool see the following:
How to Download and Run Oracle's Database Pre-Upgrade Utility Note 884522.1

or

Step1

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


$ORACLE_HOME/rdbms/admin/utlu112i.sql

Step 2
  • Change to the directory where utlu112i.sql and utltzuv2.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

$ sqlplus '/ as sysdba'
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

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:
dbua
Note: The dbua executable is usually located in the ORACLE_HOME/bin directory

On Windows operating systems, select
Start > Programs > Oracle - HOME_NAME > Configuration and Migration Tools > Database Upgrade Assistant.


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.


Note 977512.1 Updating the RDBMS DST version in 11gR2 (11.2.0.1 and up) using DBMS_DST

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:


EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('scott', 'stat_table');

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:


ORACLE_HOME/rdbms/bin/extusrupgrade --dbconnectstring
--dbuser --dbuserpassword
-a

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 Metalink Documents for enabling Oracle Database Vault

Note 453903.1 - Enabling and Disabling Oracle Database Vault in UNIX
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.

DECLARE
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 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)

Note 453786.1 ORA-24247 When Executing UTL_HTTP UTL_INADDR Packages

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 releases earlier .

Known Issues

Note 1066828.1 11GR2 DBUA ORA-06550 PLS-00201 IDENTIFIER SYS.DBMS_JAVA MUST BE DECLARED

Revision History
03-Sep-2009 Article Created

References

NOTE:1201253.1 - Actions For DST Updates When Upgrading To Or Applying The 11.2.0.2 Patchset
NOTE:359145.1 - Impact of 2007 USA daylight saving changes on the Oracle database
NOTE:412160.1 - Updated DST transitions and new Time Zones in Oracle Time Zone File patches
NOTE:414590.1 - Time Zone IDs for 7 Time Zones Changed in Time Zone Files Version 3 and Higher, Possible ORA-1882 After Upgrade
NOTE:431437.1 - 10g DBUA Failed To Bring Up 9i Database. ORA-00119 ORA-00132 ORA-01078
NOTE:453902.1 - How To Enable And/Or Disable Oracle Database Vault
NOTE:453903.1 - Enabling and Disabling Oracle Database Vault in UNIX
NOTE:560336.1 - Script to Check Schemas with Stale Statistics
NOTE:562980.1 - emdwgrd core dumps : emdwgrd[228]: 10366 Memory fault(coredump)
NOTE:870877.1 - How To Save Oracle Enterprise Manager Database Control Data Before Upgrading The Single Instance Database To Other Release ?
NOTE:884522.1 - How to Download and Run Oracle's Database Pre-Upgrade Utility
NOTE:975140.1 - 11G DBUA Error: Database Vault option is enabled in Oracle Home:
NOTE:977512.1 - Updating the RDBMS DST version in 11gR2 (11.2.0.1 and up) using DBMS_DST

显示相关信息相关的


产品
  • Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Standard Edition
  • Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
错误
ORA-24247; ORA-1722; ORA-6550; PLS-201
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/161195/viewspace-1053645/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/161195/viewspace-1053645/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值