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
27
Embed
Upgrading Oracle 10.2.0.1 to 11.1.0.6 « Naveen Kumar S.R
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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
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)
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
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
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
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
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
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:
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.
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’;
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
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
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.
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
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
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
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
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/13.png)14. The DBUA will start upgrading the database, the upgrading logs can be read in theORACLE_BASE path
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.
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.
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..
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.