Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

27
1/27 nav eenkumarsr.w ordpress.com/2011/02/16/upgrad-oracle/ Naveen Kumar S.R. . . . An array of mirror, enjoy the change R SS Upgrading Oracle 10.2.0.1 to 11.1.0.6 16 Feb i 1 Vote Upgrading from Oracle 10.2.0.1 to 11.1.0.6 . What is Oracle Database Upgrade? Oracle Upgrade is a process of changing the environment of the database without modifying the existing data and configurations to avail a robust features in the latest version and releases of the Oracle product, that internally will delivers more automation, new features, and flexibilities so that the data can be secure Technically, Oracle Upgrade means changing the versions or the releases of the Oracle database

Transcript of Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

Page 1: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

1/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

Naveen Kumar S.R.

. . . An array of mirror, enjoy the changeRSS

Upgrading Oracle 10.2.0.1 to 11.1.0.6

16 Feb

i1 Vote

Upgrading from Oracle 10.2.0.1 to 11.1.0.6

.

What is Oracle Database Upgrade?

Oracle Upgrade is a process of changing the environment of the database without modifying the

existing data and configurations to avail a robust features in the latest version and releases of theOracle product, that internally will delivers more automation, new features, and flexibilities so thatthe data can be secure

Technically, Oracle Upgrade means changing the versions or the releases of the Oracle database

Page 2: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

2/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

within the same or in different servers or with different OS platforms (ex: version 9i to 10g, 10g to11g, and also the release 10.1 to 10.2, 11.1 to 11.2) to the higher version/release that intern will

upgrade the existing physical files state to the newer release/version

For upgrading, we will be using startup upgrade command. The startup migrate is deprecatedfrom Oracle 10g for migration (Migration means moving the database from one OS platform toanother, or from lower version/release to higer version/release as like upgrade, but the main

difference here is we are logically extracting the physical files contents of data and we are loading itback to the higer version/release within the same or across the differnt OS servers, here the physcialfiles state doesnot change as like upgrade)

To know more about Version, release, and patch …

(http://naveenkumarsr.files.wordpress.com/2011/02/ver1.png)

If you upgrade/migrate the database, the FIRST number and the SECOND number willchanges. The FOURTH digit indicate the patchset number, this number will change whenever youapply the patchsets to the database.

Why the upgrading is needed?

Upgrading to Oracle Database 11g provides the latest in efficient, reliable, secure data management

for mission-critical on-line transaction processing applications, query-intensive data warehouses, andcontent management and Web2.0 applications. The right planning, preparation, and upgrade stepswill make the upgrade process simpler, faster, and more predictable from start to finish.

Types of upgrading

You can do the upgrading the databases in two methods like

1. Manual Upgrading by running the scripts manually in proper order

Page 3: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

3/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

2. Using Database Upgrade Assistant (DBUA) utility, Oracle recommends to go with this

Compatibility Matrix

Minimum Version of the database that can be directly upgraded to Oracle 11g Release 1

Source Database Target Database

9.2.0.4.0 OR higher 11.1.x

10.1.0.2.0 OR higher 11.1.x

10.2.0.1.0 OR higher 11.1.x

Choosing an upgrade method

The first method is called a manual upgrade. The manual upgrade approach gives you a great dealof control, but it also adds to the level of risk in the upgrade because you must perform the steps inthe proper order.

The second method relies on the Database Upgrade Assistant (DBUA). DBUA is an interactive toolthat guides you through the upgrade process. DBUA evaluates your present database configurationand recommends modifications that can be implemented during the upgrade process. These

recommendations may include the sizing of files and the specifications for the new SYSAUXtablespace (if upgrading from a pre-Oracle 10g database). After you accept the recommendations,DBUA performs the upgrade in the background while a progress panel is displayed. DBUA is verysimilar in approach to Database Configuration Assistant (DBCA).

Selecting the proper upgrade method requires you to evaluate the technical expertise of your team,the data that is to be migrated, and the allowable downtime for the database during the migration.In general, using DBUA will be the method of choice for very large databases, whereas smaller

databases may use an indirect method.

Before upgrading

Prior to beginning the migration, you should back up the existing database and database software. If

Page 4: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

4/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

the upgrades fails for some reason and you are unable to revert the database or software to its earlier

version, you will be able to restore your backup and re-create your database.

You should develop and test scripts that will allow you to evaluate the performance and functionalityof the database following the upgrade. This evaluation may include the performance of specific

database operations or the overall performance of the database under a significant user load.

Prior to executing the upgrade process on a production database, you should attempt the upgradeon a test database so that any missing components (such as operating system patches) can be

identified and the time required for the upgrade can be measured.

Prior to performing a upgrade, you should analyze the data dictionary tables. During the upgrade

process to Oracle Database 11g, the data dictionary will be analyzed if it has not been analyzedalready, so performing this step in advance will aid the performance of the upgrade.

Upgrading from Oracle 10.2.0.1 to 11.1.0.6

Prerequisites

Install the Oracle 11g Release 1 software

Throughout this documentation, we have used the following standards

Source: Oracle 10g (10.2.0.1.0) Target: Oracle 11g (11.1.0.6.0)

OS Platform RHEL AS 4 Update 2 RHEL AS 4 Update 2

OS User oracle oracle

DB_NAME orcl orcl

ORACLE_BASE /u01/app/o10g /u01/app/o11g

ORACLE_HOME /u01/app/o10g/product/10.2.0/db_1 /u01/app/o11g/product/11.1.0/db_1

Manually Upgrading

The manual upgrading the database includes:

1. Run pre-upgrading script ‘utlu111i.sql‘; if found problems, fix them

Page 5: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

5/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

2. Backup of Oracle10g database

3. Bounce the Oracle11g database to ‘startup upgrade‘ and run ‘catupgrd.sql‘ script

4. Run post-upgrade script ‘utlu111s.sql‘

5. Change the database from upgrade mode to normal mode by running ‘catuppst.sql‘

6. Check for invalid objects; if found, run ‘utlrp.sql‘

1. Running the Pre-Upgrade tool

The Pre-Upgrade Information Tool is a SQL script that ships with Oracle Database 11g and must be

copied to and run from the environment of the database being upgraded. Complete the followingsteps to run the Pre-Upgrade Information Tool:

1. Log into the system as the owner of the Oracle Database 11g

2. Copy the Pre-Upgrade Information Tool (utlu111i.sql) from the Oracle 11g’s

ORACLE_HOME/rdbms/admin directory to a directory outside of the Oracle Home, such as the

temporary directory on your system. Make a note of the new location of this file

3. Log into the system as the owner of the Oracle Database 10g, the database to be upgraded

4. Start SQL*Plus with sysdba privilege

5. Bounce the database to open phase

6. Set the system to spool results to a log file for later analysis and to gather the information

SQL> SPOOL pre_upgrade_info.log

7. Run the Pre-Upgrade Information Tool:

SQL> @/tmp/utlu111i.sql

8. Turn off the spooling of script results to the log file:

SQL> SPOOL OFF

Check the output of the Pre-Upgrade Information Tool in pre_upgrade_info.log for any identifiedproblems prior to the upgrade.

9. Edit the pre_upgrade_info.log file to troubleshoot the problems

Page 6: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

6/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

$ cat ~/pre_upgrade_info.log

SQL> @/tmp/utlu111i.sql

Oracle Database 11.1 Pre-Upgrade Information Tool 02-11-2011 16:16:52

.

**********************************************************************

Database:

**********************************************************************

–> name: ORCL

–> version: 10.2.0.1.0

–> compatible: 10.2.0.1.0

–> blocksize: 8192

–> platform: Linux IA (32-bit)

–> timezone file: V2

.

**********************************************************************

Tablespaces: [make adjustments in the current environment]

**********************************************************************

–> SYSTEM tablespace is adequate for the upgrade.

…. minimum required size: 693 MB

…. AUTOEXTEND additional space required: 243 MB

–> UNDOTBS1 tablespace is adequate for the upgrade.

…. minimum required size: 262 MB

…. AUTOEXTEND additional space required: 62 MB

–> SYSAUX tablespace is adequate for the upgrade.

…. minimum required size: 438 MB

Page 7: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

7/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

…. AUTOEXTEND additional space required: 178 MB

–> DEF_TEMP tablespace is adequate for the upgrade.

…. minimum required size: 61 MB

.

**********************************************************************

Update Parameters: [Update Oracle Database 11.1 init.ora or spfile]

**********************************************************************

– No update parameter changes are required.

.

**********************************************************************

Renamed Parameters: [Update Oracle Database 11.1 init.ora or spfile]

**********************************************************************

– No renamed parameters found. No changes are required.

.

**********************************************************************

Obsolete/Deprecated Parameters:[Update Oracle Database11.1 init.ora or spfile]

**********************************************************************

–> “background_dump_dest” replaced by “diagnostic_dest”

–> “user_dump_dest” replaced by “diagnostic_dest”

–> “core_dump_dest” replaced by “diagnostic_dest”

.

**********************************************************************

Components: [The following database components will be upgraded or installed]

**********************************************************************

–> Oracle Catalog Views [upgrade] VALID

Page 8: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

8/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

–> Oracle Packages and Types [upgrade] VALID

–> JServer JAVA Virtual Machine [upgrade] VALID

–> Oracle XDK for Java [upgrade] VALID

–> Oracle Workspace Manager [upgrade] VALID

–> OLAP Analytic Workspace [upgrade] VALID

–> OLAP Catalog [upgrade] VALID

–> EM Repository [upgrade] VALID

–> Oracle Text [upgrade] VALID

–> Oracle XML Database [upgrade] VALID

–> Oracle Java Packages [upgrade] VALID

–> Oracle interMedia [upgrade] VALID

–> Spatial [upgrade] VALID

–> Data Mining [upgrade] VALID

–> Expression Filter [upgrade] VALID

–> Rule Manager [upgrade] VALID

–> Oracle OLAP API [upgrade] VALID

.

**********************************************************************

Miscellaneous Warnings

**********************************************************************

WARNING: –> Database is using an old timezone file version.

…. Patch the 10.2.0.1.0 database to timezone file version 4

…. BEFORE upgrading the database. Re-run utlu111i.sql after

…. patching the database to record the new timezone file version.

WARNING: –> Database contains stale optimizer statistics.

Page 9: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

9/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

…. Refer to the 11g Upgrade Guide for instructions to update

…. statistics prior to upgrading the database.

…. Component Schemas with stale statistics:

…. SYS

…. OLAPSYS

…. SYSMAN

WARNING: –> Database contains schemas with objects dependent on network

packages.

…. Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.

…. USER SYSMAN has dependent objects.

WARNING: –> EM Database Control Repository exists in the database.

…. Direct downgrade of EM Database Control is not supported. Refer to the

…. 11g Upgrade Guide for instructions to save the EM data prior to upgrade.

.

PL/SQL procedure successfully completed.

This scripts will generates to check whether all the properties will match during upgradings,

Tablespaces: Verifies that the tablespaces are suitable to upgrade, if any problems of space, increasethe size of tablespaces

Update parameters: Check the update parameters from 10.2.0.1 to 11.1.0.6

Renamed Parameters: Check the renamed parameters in 11.1.0.6

Obsolete/Deprecated parameters: Remove the parameters which are deprecated in the 11.1.0.6

version. More about the deprecated parameters, refer the Oracle 11g documentation

Components: Verify all the components are VALID, if they show INVALID, run ‘utlrp.sql‘ fromOracle10g’s ORACLE_HOME to make them VALID.

Miscellaneous Warnings: The timezone file version should be upgraded from 2 to 4.

The remaining miscellaneous warnings can be ignored.

Page 10: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

10/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

Upgrading the timezone file version from 2 to 4

Following are the critical steps to be executed based on above warnings. These commands are to beexecuted while connecting to database from 10g Oracle Home

WARNING: –> Database is using an old timezone file version.

…. Patch the 10.2.0.1.0 database to timezone file version 4

…. BEFORE upgrading the database. Re-run utlu111i.sql after

…. patching the database to record the new timezone file version.

Finding the Version of existing timezone files in Oracle 10g:

SQL> select * from v$timezone_file;

FILENAME VERSION

———— ———-

timezlrg.dat 2

For 10.2.0.1, check the metalink note ID 413671.1. The table which defines the patch to be applied to

upgrade the timezone.

If there is no official patchset for the version you are currently having then you can Identify patch fora different patchset, but with same release.

For example if you run 10.2.0.1 and there is no particular patch release. In this case we can make useof patch 5632264 for 10.2.0.2 and 10.2.0.3, and this will be applicable to 10.2.0.1 as well.

Please follow the metalink note ID 396387.1

Once you identify the correct patchset (5632264 for 10.2.X), download the same and unzip it.

1. Unzip the patch file p5632264_10203_Linux-x86-64.zip

$ unzip p5632264_10203_Linux-x86-64.zip

2. Change directory to the 5632264 and list, which will contain the timezone files

3. Backup the existing timezone files in the Oracle10g’s ORACLE_HOME, these will be present

under $ORACLE_HOME/oracore/zoneinfo directory

4. Copy the newly extracted files to the ORACLE_HOME path

Page 11: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

11/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

$ cp -r 5632264/files/oracore/zoneinfo $ORACLE_HOME/oracore/zoneinfo

5. If the new timezone changes has to come to an effect, restart the database and select the timezone

SQL> select * from v$timezone_file;

FILENAME VERSION

———— ———-

timezlrg.dat 4

NOTE:

Do not follow this method of applying the patch for all the patch-sets. That will corrupt the

ORACLE_HOME path and may need to reinstall the software again. For each individual patchinstallation, please refer to the Oracle Patchset Documentation’s

To Solve Stale Optimizer Statistics Warning

WARNING: –> Database contains stale optimizer statistics.

…. Refer to the 11g Upgrade Guide for instructions to update

…. statistics prior to upgrading the database.

…. Component Schemas with stale statistics:

…. SYS

…. OLAPSYS

…. SYSMAN

Gather the dictionary statistics by executing the PL/SQL blocks

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘SYS’);

PL/SQL procedure successfully completed.

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘OLAPSYS’);

PL/SQL procedure successfully completed.

Page 12: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

12/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘SYSMAN’);

PL/SQL procedure successfully completed.

NOTE:

Gather the dictionary statistics by executing DBMS_STATS.GATHER_SCHEMA_STATS for all theusers as per the warning.

Re-run the pre-upgrade script again

1. Log into the system as the owner of the Oracle Database 11g

2. Copy the Pre-Upgrade Information Tool (utlu111i.sql) from the Oracle 11g’sORACLE_HOME/rdbms/admin directory to a directory outside of the Oracle Home, such as thetemporary directory on your system. Make a note of the new location of this file

3. Log into the system as the owner of the Oracle Database 10g, the database to be upgraded

4. Start SQL*Plus with sysdba privilege

5. Bounce the database to open phase

6. Set the system to spool results to a log file for later analysis and to gather the information

7. Run the Pre-Upgrade Information Tool:

SQL> @/tmp/utlu111i.sql

8. Turn off the spooling of script results to the log file:

9. Check for upgrading warnings again

$ cat pre_upgrade_info.log

SQL> @/tmp/utlu111i.sql

.

.

.

Page 13: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

13/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

**********************************************************************

Miscellaneous Warnings

**********************************************************************

WARNING: –> Database contains schemas with objects dependent on network

packages.

…. Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.

…. USER SYSMAN has dependent objects.

WARNING: –> EM Database Control Repository exists in the database.

…. Direct downgrade of EM Database Control is not supported. Refer to the

…. 11g Upgrade Guide for instructions to save the EM data prior to upgrade.

.

2. Backup the Oracle 10g database

Perform the Oracle 10g database backup in any of the methods like cold backup, hot backup orRMAN backups

Backup the ORACLE_HOME software path too.

3. Create parameter file for Oracle 11g

Backup the Oracle10g’s parameter file and paste under Oracle11g’s default path

$ cp /u01/app/o10g/product/10.2.0/db_1/dbs/initorcl.ora/u01/app/o11g/product/11.1.0/db_1/dbs/initorcl.ora

Edit the Oracle 11g’s parameter file to remove the Obsolete/Deprecated parameters, as listed in thepre_upgrade_info.log file

Page 14: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

14/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

4. Upgrade the database

1. If the Oracle10g database is still running, shutdown the database

2. Export the variables for Oracle 11g

$ export ORACLE_SID=orcl

$ export ORACLE_BASE=/u01/app/o11g

$ export ORACLE_HOME=/u01/app/o11g/product/11.1.0/db_1

$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

$ export PATH=$ORACLE_HOME/bin:$PATH

3. Start the SQL*Plus with sysdba privilege

4. Start the Oracle11g database using the ‘startup upgrade‘

SQL> startup upgrade

5. Verify the version of Oracle

SQL> select * from v$version;

BANNER

———————————————————————-

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 – Production

PL/SQL Release 11.1.0.6.0 – Production

CORE 11.1.0.6.0 Production

TNS for Linux: Version 11.1.0.6.0 – Production

NLSRTL Version 11.1.0.6.0 – Production

6. Upgrade the data dictionary tables via the catupgrd.sql script.

SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql

From hereafter the database downtime will starts and the upgrading a database will take its owntime to completes depending upon the size of the database and environment.

Page 15: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

15/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

Once the upgrades completes, the database will shutdown automatically

5. Post Upgrading Steps

1. Once the upgrade completed, reinitialize the system parameters for normal startup and bounceback the database by login again as sys with sysdba privilege, and start the database to normal mode

SQL> startup

2. Check the dba_registry for the components and its status

SQL> select comp_name, status, version from dba_registry;

3. Run ‘utlu111s.sql‘ script to display the results of the upgrade

SQL> @$ORACLE_HOME/rdbms/admin/utlu111s.sql

4. Run ‘catuppst.sql‘ script from $ORACLE_HOME/rdbms/admin directory, to perform upgradeactions that change the database from UPGRADE mode to the NORMAL mode

SQL> @$ORACLE_HOME/rdbms/admin/catuppst.sql

5. Find for the invalid objects after the upgrade

SQL> select count(*) from dba_objects where status=’INVALID’;

COUNT(*)

———

1572

6. Run ‘$ORACLE_HOME/rdbms/admin/utlrp.sql‘ script to recompile the INVALID objects

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

7. Again find the status for invalid objects after recompiling them

SQL> select count(*) from dba_objects where status=’INVALID’;

COUNT(*)

———-

0

Page 16: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

16/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

This will completes the manually upgrading the Oracledatabase from 10.2.0.1 to 11.1.0.6

Using the Database Upgrade Assistant (DBUA)

You can start the Database Upgrade Assistant (DBUA) via the shipped utility in Oracle 11g, the

dbua command (in UNIX environments) or by selecting ªDatabase Upgrade Assistantº from theOracle Configuration and Migration Tools menu option (in Windows environments).

The scripts we had executing in the Manually in the previous method will be executed and taken careby the DBUA utility

Follow the steps to upgrade the Oracle 10.2.0.1 database to 11.1.0.6:

1. Login in as Oracle 11g user, and initiate all the variables need for the environment

$ export ORACLE_BASE=/u01/app/o11g

$ export ORACLE_HOME=/u01/app/o11g/product/11.1.0/db_1

$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

$ export PATH=$ORACLE_HOME/bin:$PATH

2. Confirm the Oracle 10g database name and ORACLE_HOME path is entered in /etc/oratab file

$ cat /etc/oratab

orcl:/u01/app/o10g/product/10.2.0/db_1:N

3. Execute the dbca utility from Oracle 11g’s path

$ $ORACLE_HOME/bin/dbua

4. A Welcome screen will appear, click Next

Page 17: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

17/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

(http://naveenkumarsr.files.wordpress.com/2011/02/01.png)

5. Select the database you want to upgrade from the list of available databases. You can upgradeonly one database at a time. For all the list of databases, the database names should be listed in/etc/oratab file (Step 2). Click Next

(http://naveenkumarsr.files.wordpress.com/2011/02/02.png)

6. The dbua utility will check the warnings should be taken care during the upgrading

(http://naveenkumarsr.files.wordpress.com/2011/02/03.png)

Here again we need to solve the warning like update the timezone file version as a critical warning,and remaining warning you can skip. If you continue with this screen, at the point of in time thedbua will through an error and the upgrading the database will fail.

Page 18: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

18/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

Its a better practice to solve the warnings.

Upgrading the timezone file version from 2 to 4

Following are the critical steps to be executed based on above warnings. These commands are to be

executed while connecting to database from 10g Oracle Home

WARNING: –> Database is using an old timezone file version.

…. Patch the 10.2.0.1.0 database to timezone file version 4

…. BEFORE upgrading the database. Re-run utlu111i.sql after

…. patching the database to record the new timezone file version.

Finding the Version of existing timezone files in Oracle 10g:

SQL> select * from v$timezone_file;

FILENAME VERSION

———— ———-

timezlrg.dat 2

For 10.2.0.1, check the metalink note ID 413671.1. The table which defines the patch to be applied toupgrade the timezone.

If there is no official patchset for the version you are currently having then you can Identify patch fora different patchset, but with same release.

For example if you run 10.2.0.1 and there is no particular patch release. In this case we can make useof patch 5632264 for 10.2.0.2 and 10.2.0.3, and this will be applicable to 10.2.0.1 as well.

Please follow the metalink note ID 396387.1

Once you identify the correct patchset (5632264 for 10.2.X), download the same and unzip it.

1. Unzip the patch file p5632264_10203_Linux-x86-64.zip

$ unzip p5632264_10203_Linux-x86-64.zip

2. Change directory to the 5632264 and list, which will contain the timezone files

3. Backup the existing timezone files in the Oracle10g’s ORACLE_HOME, these will be present

Page 19: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

19/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

under $ORACLE_HOME/oracore/zoneinfo directory

4. Copy the newly extracted files to the ORACLE_HOME path

$ cp -r 5632264/files/oracore/zoneinfo $ORACLE_HOME/oracore/zoneinfo

5. If the new timezone changes has to come to an effect, restart the database and select the timezone

SQL> select * from v$timezone_file;

FILENAME VERSION

———— ———-

timezlrg.dat 4

NOTE:

Do not follow this method of applying the patch for all the patch-sets. That will corrupt theORACLE_HOME path and may need to reinstall the software again. For each individual patchinstallation, please refer to the Oracle Patchset Documentation’s

To Solve Stale Optimizer Statistics Warning

WARNING: –> Database contains stale optimizer statistics.

…. Refer to the 11g Upgrade Guide for instructions to update

…. statistics prior to upgrading the database.

…. Component Schemas with stale statistics:

…. SYS

…. OLAPSYS

…. SYSMAN

Gather the dictionary statistics by executing the PL/SQL blocks

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘SYS’);

PL/SQL procedure successfully completed.

Page 20: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

20/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘OLAPSYS’);

PL/SQL procedure successfully completed.

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS(‘SYSMAN’);

PL/SQL procedure successfully completed.

NOTE:

Gather the dictionary statistics by executing DBMS_STATS.GATHER_SCHEMA_STATS for all theusers as per the .warning.

This will solve the main warnings that got from the above step, the remaining warning can beignored.

Rerun the dbua utility again and clear the previous steps, now the warnings will be ease toupgrading the database, you can ignore these warnings

(http://naveenkumarsr.files.wordpress.com/2011/02/04.png)

Click ‘Yes’, this will continue with the further steps of upgrading.

7. The next screen will allow to select the ORACLE_BASE and the Diagnostic Destination, Click Next

Page 21: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

21/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

(http://naveenkumarsr.files.wordpress.com/2011/02/05.png)

8. You can then select to have your database files moved during the upgrade process. Click Next

(http://naveenkumarsr.files.wordpress.com/2011/02/08.png)

9. DBUA will then prompt you for a flash recovery area destination for the storage of backup and-

recovery-related files. Click Next

(http://naveenkumarsr.files.wordpress.com/2011/02/09.png)

10. DBUA will then prompt you to recompile invalid PL/SQL objects following the upgrade. If youdo not recompile these objects after the upgrade, the first user of these objects will be forced to waitwhile Oracle performs a run-time recompilation. Click Next

Page 22: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

22/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

(http://naveenkumarsr.files.wordpress.com/2011/02/10.png)

11. DBUA will prompt for back up the database as part of the upgrade process. If already backed upthe database prior to starting DBUA, elect to skip this step. If you choose to have DBUA back up thedatabase, it will shut down the database and perform an offline backup. DBUA will also create abatch file in that directory to automate the restoration of those files to their earlier locations. Click

Next

(http://naveenkumarsr.files.wordpress.com/2011/02/11.png)

12. If Oracle detects multiple Oracle Net listeners on the server, you will then be prompted to select alistener for your database, and the network configuration details will be displayed for your reviewand editing. Click Continue

(http://naveenkumarsr.files.wordpress.com/2011/02/12.png)

13. A final summary screen displays your choices for the upgrade, and the upgrade starts when youaccept them. Click Finish

Page 23: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

23/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

(http://naveenkumarsr.files.wordpress.com/2011/02/13.png)14. The DBUA will start upgrading the database, the upgrading logs can be read in theORACLE_BASE path

(http://naveenkumarsr.files.wordpress.com/2011/02/14.png)

15. The DBUA will complete the upgrading the database, Click ‘OK’

(http://naveenkumarsr.files.wordpress.com/2011/02/15.png)

16. After the upgrade has completed, DBUA will display the Upgrade Results screen, showing thesteps performed, the related log files, and the status.

Page 24: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

24/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

(http://naveenkumarsr.files.wordpress.com/2011/02/16.png)

17. The section of the screen titled Password Management allows you to manage the passwords andthe locked/unlocked status of accounts in the upgraded database.

(http://naveenkumarsr.files.wordpress.com/2011/02/17.png)

If you are not satisfied with the upgrade results, you can choose the Restore option. If you used

DBUA to perform the backup, the restoration will be performed automatically; otherwise, you willneed to perform the restoration manually.

When you exit DBUA after successfully upgrading the database, DBUA removes the old database’sentry in the network listener configuration file, inserts an entry for the upgraded database, andreloads the file.

After Upgrading

Page 25: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

25/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

Following the upgrade, you should double-check the configuration and parameter files related to the

database, particularly if the instance name changed in the migration process. These files include

The tnsnames.ora file

The listener.ora file

NOTE:

You will need to manually reload the modified listener.ora file if you are not using DBUA to performthe upgrade.

Additional post-upgrade steps should include verifying the values for all environment variables (such

as ORACLE_HOME and PATH) and upgrading the recovery catalog.

You should review your database initialization parameters to make sure deprecated and obsoleteparameters have been removed; these should have been identified during the migration process. Besure to recompile any programs you have written that rely on the database software libraries.

Once the upgrade has completed, perform the functional and performance tests identified before theupgrade began. If there are issues with the database functionality, attempt to identify any parametersettings or missing objects that may be impacting the test results. If the problem cannot be resolved,you may need to revert to the prior release.

7 CommentsPosted by Naveen K. SR on February 16, 2011 in Oracle

7 Responses to Upgrading Oracle 10.2.0.1 to 11.1.0.6

1. Anonymous

July 29, 2011 at 4:13 PM

nice article…thankQ Naveen..got clear idea on upgrade.. Thanks for sharing..

Reply

2. Anonymous

Page 26: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

26/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

June 18, 2011 at 12:21 AM

what is main difference between patching and upgrading?

Reply

Naveen K. SR

June 18, 2011 at 2:07 PM

Hi

Patching means in straight-forward resolving or fixing the bugs of the present version. This

can be done through applying interim patches or Critical Patches, and even changing theversion patching can also be done. If you apply these patches the fourth digit of the versionsequence will be changed.

Upgrading means having the same physical files, just we are changing the binaries and thelibraries of the Oracle Software. So that we can get move on to the new features, flexibilitiesthat will be provided in the new versions or released in the Oracle Software.

- Naveen K. SR

Reply Anonymous

June 29, 2011 at 9:02 PM

patching can be done in O/S level or database level?

Reply

Naveen K. SR

June 30, 2011 at 11:59 AM

You will get multiple type of patches to apply, the best practice you need to follow beforepatching is ‘read the README file’. You cannot follow same thumb-rule to apply all typeof patches. So my recommendation is go through the README file and know about howto apply the patch.

There are many types of patches like PSU, CPU, version patch, timezone patch etc…

Usually these patches will be applied using the Oracle binary, called, ‘opatch’ in the OSlevel or using Oracle OUI by running runInstaller that internally applies to the databaselevel.

Reply

Page 27: Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R

27/27nav eenkumarsr.wordpress.com/2011/02/16/upgrad-oracle/

3. Perkins

March 31, 2011 at 4:49 PM

Good article on upgrading. .came to know lot of thingsgood job, I awaiting much more writings from u Naveen.. well done, keep it up…

Reply

4. Anush

February 23, 2011 at 3:11 PM

Hi Naveen

Nice information on upgrading, after reading ur blog, i came to know the difference betweenupgrade and migrationthanks once again, nice job keep it up

Anush

Reply

Blog at WordPress.com. Theme: Choco by .css{mayo}.

Entries (RSS) and Comments (RSS)