upgrade oracle 10g release 2 to oracle 11g release 1 jai maa durga

Upload: papusaha

Post on 12-Oct-2015

16 views

Category:

Documents


0 download

DESCRIPTION

upgrading

TRANSCRIPT

  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    1/16

    Upgrade Oracle 10g Release 2 to Oracle 11g Release 1

    This article is a step by step guide to upgrade oracle database 10gR2 (10.2.0.4) to 11gR1 (11.1.0.6). Thecurrent environment is RHEL 5.5.

    Preparing for upgrade to 11g Release 1

    The first step is to stop all the components of the oracle 10g database.

    -- stop isqlplus$ isqlplusctl stopiSQL*Plus 10.2.0.4.0Copyright (c) 2003, 2005, Oracle. All rights reserved.Stopping iSQL*Plus ...iSQL*Plus stopped.

    -- stop enterprise manager dbconsole

    $ emctl stop dbconsoleTZ set to US/EasternOracle Enterprise Manager 10g Database Control Release 10.2.0.4.0Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.Stopping Oracle Enterprise Manager 10g Database Control ...... Stopped.

    -- stop listener$ lsnrctl stop

    Copyright (c) 1991, 2005, Oracle. All rights reserved.

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))The command completed successfully

    -- Shutdown the database.$ sqlplus / as sysdba

    SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL>

    Now take a cold backup of the database and the ORACLE_HOME directory.

    $cd /u01/app/oracle/oradata/

    /*All my data files , control files and log files are in a directory ora10gat the location /u01/app/oracle/oradata/.I am going to make a tar archive of ora10g directory. If these filesare at separate locations then add all those locations into the tar archive.And since this is just a test database and is very small in size so tararchiveworks much better then every thing else. But if it would be a production dbandis big in size then I would consider other faster ways to take a cold backupofmy data files.

    */

    $ tar czf /home/oracle/ora10g.tar.gz ora10g

    $ echo $ORACLE_HOME/u01/app/oracle/product/10.2.0/db_1

    /*This is Home Directory for Oracle 10g so I would make a tar archive of"db_1" directory.*/

    $ cd /u01/app/oracle/product/10.2.0/

    $ tar czf /home/oracle/oraHomeBackup.tar.gz db_1

  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    2/16

    $ ls /home/oracle/*.tar.gz/home/oracle/ora10g.tar.gz /home/oracle/oraHomeBackup.tar.gz

    Configure the system for oracle 11g Release 1 Installation

    Now is the time to install oracle 11g R1 in a separate home directory from the oracle 10g.

    I would recommend that before going ahead you should have a look at this article,at least the pre-installation configurations.Since Oracle 10g is already installed on this server so you may find some of the pre-installationconfigurations already there.I will go through the adjustments in the pre-installation configurations that I had to make when preparingfor 11gR1 install on a server where 10gR2 was already installed.

    Open/etc/sysctl.confand the following lines:

    # Oracle settingsfs.file-max = 65536kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 1024 65500net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576

    If any one of these exist already and value is higher then or equal to the above, then don't add the newvalue but if the value is lower remove the already existing value and add the above.

    -- Make the kernel parameters changes effective immediately:# /sbin/sysctl -p

    -- Verify the parameters are changed or not?# /sbin/sysctl -a | grep name_of_kernel_parameter -- e.g. shmall

    Now we need to make sure we have all necessary packages for Oracle. Most of the rpm packages listedin the article I mentioned above would be installed. However to verify you may go ahead and issue thefollowing command for each of them.

    # rpm -qa | grep binutils-2binutils-2.17.50.0.6-12.el5

    It will show you if the package is installed or not.

    Now which ever package you find missing install them. Put your Linux Media into DVD and go to the"Server" directory.

    cd /dvd_mount_point/Server

    -- In my case only following three were missing.rpm -Uvih libaio-devel-0*`uname -p`*rpm -Uvih numactl-devel-0*`uname -p`*rpm -Uvih unixODBC-2*`uname -p`*rpm -Uvih unixODBC-2*i386*rpm -Uvih unixODBC-devel-2*`uname -p`*

    NOTE: If you are using RHEL5 DVD then you should find them all in the "Server" directory in your DVD.And if you don't find one there you may download it from the Linux vendor's Web site. If you have yourLinux distribution in 3 CDs then these will be scattered on all three CDs in the Server directory on all CDs.

    In my case the linux user that owns the oracle software installation is oracle. Check for the existence ofthe groups it needs.

    # cat /etc/group | grep dbadba:x:501:oracle# cat /etc/group | grep oinstalloinstall:x:500:# cat /etc/group | grep oper

    http://www.oracleflash.com/35/Install-Oracle-11g-Release-1-on-RHEL-5.htmlhttp://www.oracleflash.com/35/Install-Oracle-11g-Release-1-on-RHEL-5.htmlhttp://www.oracleflash.com/35/Install-Oracle-11g-Release-1-on-RHEL-5.htmlhttp://www.oracleflash.com/35/Install-Oracle-11g-Release-1-on-RHEL-5.html
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    3/16

    -- Group oper doesn't exist. Create it and assign it to the user oracle assecondary group.

    groupadd operusermod -g oinstall -G dba,oper oracle

    Allow the user oracle to use X server, which it will need to run Oracle Universal Installer.

    # xhost +SI:localuser:oraclelocaluser:oracle being added to access control list

    Now switch to the user oracle.

    # su - oracle

    Create a new directory for 11g Oracle Home under your Oracle Base directory.

    $ echo $ORACLE_BASE/u01/app/oracle$ echo $ORACLE_HOME/u01/app/oracle/product/10.2.0/db_1$$ cd /u01/app/oracle/product$ mkdir -p 11.1.0/db_1$ mkdir -p 11.1.0/oraInventory-- We will use a separate inventory location for 11g installation.

    Add these lines into the file ~/.bash_profile

    # Oracle 11g Home settings#ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE#ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1; export ORACLE_HOME#ORACLE_SID=ora10g; export ORACLE_SID

    With these changes the ~/.bash_profileshould look like this:

    # User specific environment and startup programs

    PATH=$PATH:$HOME/bin

    export PATH

    # Oracle settingsTMP=/tmp; export TMPTMPDIR=$TMP; export TMPDIR

    # If /tmp doesn't have 400mb space free then you can workaround it# by pointing the variables TMP AND TMPDIR to a location where you# have sufficient space. Oracle will then use this directory for# temporary files.

    # Oracle 11g Home settings#ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE#ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1; export ORACLE_HOME#ORACLE_SID=ora10g; export ORACLE_SID# Oracle 10g Home settingsORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

    ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOMEORACLE_SID=ora10g; export ORACLE_SIDORACLE_TERM=xterm; export ORACLE_TERMPATH=/usr/sbin:$PATH; export PATHPATH=$ORACLE_HOME/bin:$PATH; export PATH

    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;export LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH

    if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; then

    ulimit -p 16384ulimit -n 65536

  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    4/16

    elseulimit -u 16384 -n 65536

    fifi

    As you can see I have made two sections in the file. One to setup the Environemnt for Oracle 11g and

    one for 10g. During the Upgrade we will need to switch back and forth in the 10g and 11g environemnts,and these settings will make it easy for us.If we want to set the user environemnt to 11g Oracle Home we will edit the file and uncomment 11gsetting and comment out the 10g settings and will do the vice versa to set the user environemnt to 10g.

    How to set the oracle user environment to 10g: - Edit the ~/.bash_profile, comment out the 11g settings and uncomment the 10g settings.- Logout and Login again to bring the changes in effect.

    How to set the oracle user environment to 11g: - Edit the ~/.bash_profile, comment out the 10g settings and uncomment the 11g settings.- Logout and Login again to bring the changes in effect.

    Install Oracle 11g Release 1 software

    Open another console and login as user root. Edit the file/etc/oraInst.locto change the Oracle Inventorylocation.

    The contents of the file should look like this.

    inventory_loc=/u01/app/oracle/product/11.1.0/oraInventoryinst_group=oinstall

    Download Oracle 11gR1 software

    You will have to login to your OTN web account first.

    - ForLinux x86 (32-bit)- ForLinux x86_64 (64-bit)

    Once download is complete unzip the files that you downloaded.

    -- Do this in the console where user oracle is logged in.$ cd /home/oracle-- This is where I downloaded the zip files.$ ls *.ziplinux.x64_11gR1_database_1013_1.zip$

    $ unzip linux.x64_11gR1_database_1013_1.zip

    Set the oracle user environment to 11g using the way described above.

    $ cd /home/oracle/database/$ ./runInstaller -invPtrLoc /etc/oraInst.loc

    Welcome to Oracle Universal Installer

    This is the first screen you should see when you run Installer. Just press Next.

    Welcome to Oracle Universal Installer

    Select Installation Type

    Choose the type of installation you want to proceed with. In my case I choose "Enterprise Edition".

    Select Installation Type

    Install Location

    Choose your installation locations i.e. ORACLE_BASE and ORACLE_HOME locations.

    Install Location

    http://download.oracle.com/otn/linux/oracle11g/linux_11gR1_database_1013.ziphttp://download.oracle.com/otn/linux/oracle11g/linux_11gR1_database_1013.ziphttp://download.oracle.com/otn/linux/oracle11g/linux_11gR1_database_1013.ziphttp://download.oracle.com/otn/linux/oracle11g/linux.x64_11gR1_database_1013.ziphttp://download.oracle.com/otn/linux/oracle11g/linux.x64_11gR1_database_1013.ziphttp://download.oracle.com/otn/linux/oracle11g/linux.x64_11gR1_database_1013.ziphttp://oracleflash.com/images/upgrade_10204_to_11106/1.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/1.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/2.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/2.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/3.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/3.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/3.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/2.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/1.pnghttp://download.oracle.com/otn/linux/oracle11g/linux.x64_11gR1_database_1013.ziphttp://download.oracle.com/otn/linux/oracle11g/linux_11gR1_database_1013.zip
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    5/16

    Product Specific Prerequisite Checks

    Oracle will perform all prerequisite checks here it will show a report about the checks performed. If youhave configured your environment properly before starting the installation as demonstratedhere,allchecks should pass.

    Product Specific Prerequisite Checks

    Upgrade an Existing Database

    Choose No here as we will upgrade the database manually.

    Upgrade an Existing Database

    Select Configuration Option

    Choose "Install Software Only" and press next.

    Select Configuration Option

    Privileged Operating System Groups

    Provide the OS groups that you created for OSDBA, OSOPER and OSASM privileges. We have no plansfor ASM at this point so we didn't create and OS group to be used for OSASM privilege. In my caseOSDBA group is dba, OSOPER group is oper and I would use oinstall group for OSASM.

    Privileged Operating System Groups

    Summary

    This is the install summary. Review it and press Install.

    Summary

    Installation Progress

    Oracle software will be installed now. Sit back and relax until the progress bar goes to 100%.

    Installation Progress

    Execute Configuration Scripts

    Execute the suggested scripts as root. See below.

    Execute Configuration Scripts

    Open another console, log in as root and perform run the root.sh script suggested by the Oracle installer.

    # which dbhome/usr/local/bin/dbhome# cd /usr/local/bin/

    # mv dbhome dbhome_10204# mv oraenv oraenv_10204

    # mv coraenv coraenv_10204

    # /u01/app/oracle/product/11.1.0/db_1/root.shRunning Oracle 11g root.sh script...

    The following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME= /u01/app/oracle/product/11.1.0/db_1

    Enter the full pathname of the local bin directory: [/usr/local/bin]:Copying dbhome to /usr/local/bin ...Copying oraenv to /usr/local/bin ...Copying coraenv to /usr/local/bin ...

    Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is created

    http://www.oracleflash.com/35/Install-Oracle-11g-Release-1-on-RHEL-5.htmlhttp://www.oracleflash.com/35/Install-Oracle-11g-Release-1-on-RHEL-5.htmlhttp://oracleflash.com/images/upgrade_10204_to_11106/4.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/4.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/5.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/5.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/6.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/6.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/7.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/7.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/8.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/8.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/9.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/9.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/10.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/10.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/10.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/9.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/8.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/7.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/6.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/5.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/4.pnghttp://www.oracleflash.com/35/Install-Oracle-11g-Release-1-on-RHEL-5.html
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    6/16

    Finished running generic part of root.sh script.Now product-specific root actions will be performed.Finished product-specific root actions.You have mail in /var/spool/mail/root

    End of Installation

    Press "Exit" to end the installation.

    End of Installation

    Pre-Upgrade tool (utlu111i.sql)

    You should analyze your database before upgrading it. Oracle 11g Release 1 ships a script utlu111i.sqlaka Pre-Upgrade tool. This script can be found in the ORACLE_HOME/rdbms/admin directory. This scriptchecks the current database which you are trying to upgrade to 11gR1 and display a report, if there areany changes need to be done before and after the upgrade. Besides its reporting nature, it is mandatoryto run the Pre-Upgrade Script before a manual upgrade.

    How to run Oracle 11gR1 Pre-Upgrade tool (utlu111i.sql)

    To run the Pre-Upgrade tool the environment should be set like this:

    $ORACLE_HOME = Oracle Home which you are planning to upgrade (Old Oracle Home).$ORACLE_SID = SID of the database being upgraded.$PATH = should point to the original/old Oracle Home.

    Copy the script utlu111i.sql from 11gR1 ORACLE_HOME/rdbms/admin to another directory say /tmp,change to that directory and start sqlplus. Run the script and view the output.

    $ echo $ORACLE_HOME/u01/app/oracle/product/10.2.0/db_1-- Verify that this is the 10g ORACLE_HOME$ cd /u01/app/oracle/product/11.1.0/db_1/rdbms/admin/$ cp utlu111i.sql /tmp$ cd /tmp$ sqlplus / as sysdba

    SQL> startup

    SQL> spool pre_upgrade.logSQL> @utlu111i.sqlOracle Database 11.1 Pre-Upgrade Information Tool 07-28-2010 17:53:06.

    **********************************************************************Database:**********************************************************************--> name: ORA10G--> version: 10.2.0.4.0--> compatible: 10.2.0.1.0--> blocksize: 8192--> platform: Linux x86 64-bit--> timezone file: V4.**********************************************************************Tablespaces: [make adjustments in the current environment]**********************************************************************

    --> SYSTEM tablespace is adequate for the upgrade..... minimum required size: 742 MB.... AUTOEXTEND additional space required: 242 MB--> UNDOTBS1 tablespace is adequate for the upgrade..... minimum required size: 440 MB--> SYSAUX tablespace is adequate for the upgrade..... minimum required size: 421 MB.... AUTOEXTEND additional space required: 181 MB--> TEMP tablespace is adequate for the upgrade..... minimum required size: 61 MB.... AUTOEXTEND additional space required: 32 MB--> EXAMPLE tablespace is adequate for the upgrade..... minimum required size: 69 MB.

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

    http://oracleflash.com/images/upgrade_10204_to_11106/11.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/11.pnghttp://oracleflash.com/images/upgrade_10204_to_11106/11.png
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    7/16

    **********************************************************************WARNING: --> "sga_target" needs to be increased to at least 672 MB.**********************************************************************Renamed Parameters: [Update Oracle Database 11.1 init.ora or spfile]**********************************************************************-- No renamed parameters found. No changes are required..**********************************************************************Obsolete/Deprecated Parameters: [Update Oracle Database 11.1 init.ora orspfile]**********************************************************************--> "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

    --> 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 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.... WMSYS.... OLAPSYS

    .... SYSMAN

    .... CTXSYS

    .... XDB

    .... MDSYSWARNING: --> Database contains INVALID objects prior to upgrade..... USER PUBLIC has 1 INVALID objects..... USER SYS has 2 INVALID objects.WARNING: --> Database contains schemas with objects dependent on networkpackages..... Refer to the 11g Upgrade Guide for instructions to configure NetworkACLs.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.SQL> spool offSQL> exit

    Fix the warnings reported by the Pre-Upgrade tool. The warnings about parameters and tablespaces ifthere are any needs to be done before the database upgrade. As far as the Miscellaneous Warnings areconcerned some you have to fix before the upgrade and some after the upgrade.

    Please look at the articleOracle 11g Release 1 Pre Upgrade tool utlu111i.sqlto see how to fix warningsand cautions reported by the Pre-Upgrade tool.

    http://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.htmlhttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.htmlhttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.htmlhttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    8/16

    I have fixed the following warnings prior to the upgrade with the help of the linkOracle 11g Release 1 PreUpgrade tool utlu111i.sql.

    WARNING: --> Database contains schemas with stale optimizer statistics.WARNING: --> EM Database Control Repository exists in the database.

    While fixing the warning about EM Database Control Repository, I have started the Oracle listener andEM console. Shut them down to start the Oracle 11g Upgrade process.

    -- Stop the listener$ lsnrctl stop

    Copyright (c) 1991, 2007, Oracle. All rights reserved.

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))The command completed successfully

    -- Stop the EM database console.$ emctl stop dbconsole

    TZ set to US/EasternOracle Enterprise Manager 10g Database Control Release 10.2.0.4.0Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.Stopping Oracle Enterprise Manager 10g Database Control ...... Stopped.

    Now log in as sysdba and change the initialization parameters as suggested by the Pre-Upgrade Tool.Once done, shutdown the database and create a pfile from spfile, that we will ship to the 11gORACLE_HOME.

    $ sqlplus / as sysdba

    SQL> show parameter sga_max_size

    NAME TYPE VALUE------------------------------------ ----------- ------------------------------sga_max_size big integer 572M

    SQL> show parameter sga_target

    NAME TYPE VALUE------------------------------------ ----------- ------------------------------sga_target big integer 572M

    -- change sga_max_size to 700m and bounce the database.

    SQL> alter system set sga_max_size=700m scope=spfile;

    System altered.

    SQL> shutdown immediate

    SQL> startup

    -- Change the sga_target to 700m now.

    SQL> alter system set sga_target=700m scope=both;

    System altered.

    -- remove *_dump_dest parameters from spfile.

    SQL> alter system reset background_dump_dest scope=spfile sid='*';

    System altered.

    SQL> alter system reset core_dump_dest scope=spfile sid='*';

    System altered.

    SQL> alter system reset user_dump_dest scope=spfile sid='*';

    System altered.

    http://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#statisticshttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#statisticshttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#statisticshttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#statisticshttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#statisticshttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#statistics
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    9/16

    -- Shutdown the database and create pfile from spfile.

    SQL> shutdown immediate

    SQL> create pfile from spfile;

    File created.

    SQL> exit

    Now copy the newly created pfile (init[SID].ora) and the password file (orapw[SID]) from oracle 10gORACLE_HOME/dbs to oracle 11g ORACLE_HOME/dbs.

    $ echo $ORACLE_HOME/u01/app/oracle/product/10.1.0/db_1$ cd $ORACLE_HOME/dbs$ cp initora10g.ora orapwora10g /u01/app/oracle/product/11.1.0/db_1/dbs/$

    Now open another console, log in as root and edit /etc/oratabto change the oracle home with the sidora10g to 11g ORACLE_HOME. After the change the/etc/oratabshould look like this.

    ora10g:/u01/app/oracle/product/11.1.0/db_1:N

    Now set the oracle user environment to 11g Oracle Home using the way described above in this article.

    Once the environment is set to 11g ORACLE_HOME, open sqlplus and startup the database in upgrademode.

    $ echo $ORACLE_HOME/u01/app/oracle/product/11.1.0/db_1

    $ cd $ORACLE_HOME/rdbms/admin/

    $ sqlplus / as sysdba

    Connected to an idle instance.

    SQL> startup upgrade pfile='/u01/app/oracle/product/11.1.0/db_1/dbs/initora10g.ora'

    ORACLE instance started.

    Total System Global Area 606806016 bytesFixed Size 1338196 bytesVariable Size 201327788 bytesDatabase Buffers 398458880 bytesRedo Buffers 5681152 bytesDatabase mounted.Database opened.SQL> spool upgrade.logSQL> @catupgrd.sql..[output trimmed].

    .SQL>/*****************************************************************************/SQL> /* Step 10 - SHUTDOWN THE DATABASE..!!!!!SQL> */SQL>/*****************************************************************************/SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL>SQL>SQL>

  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    10/16

    SQL> DOCDOC>#######################################################################DOC>#######################################################################DOC>DOC> The above sql script is the final step of the upgrade. PleaseDOC> review any errors in the spool log file. If there are any errors inDOC> the spool file, consult the Oracle Database Upgrade Guide forDOC> troubleshooting recommendations.DOC>DOC> Next restart for normal operation, and then run utlrp.sql toDOC> recompile any invalid application objects.DOC>DOC>#######################################################################DOC>#######################################################################DOC>#SQL>SQL>SQL>SQL>SQL>

    SQL> Rem Set errorlogging offSQL> SET ERRORLOGGING OFF;SQL>SQL> Rem*********************************************************************SQL> Rem END catupgrd.sqlSQL> Rem*********************************************************************SQL>SQL> SPOOL OFFSQL> exit

    When catupgrd.sql finishes it will automatically shutdown the database. Exit from sqlplus and open the

    spool file for the upgrade process and see if there were any errors during the upgrade. If you don't seeany errors proceed further with the upgrade. If you see errors refer to the link below to trouble shoot them.Troubleshoot the Upgrade

    Post upgrade steps: Oracle 11g Release 2

    Create the spfile from the pfile so that the system should use the spfile for next startup.

    $ sqlplus / as sysdba

    Connected to an idle instance.

    SQL> create spfile from

    pfile='/u01/app/oracle/product/11.1.0/db_1/dbs/initora10g.ora';

    File created.

    SQL> startupORACLE instance started.

    Total System Global Area 606806016 bytesFixed Size 1338196 bytesVariable Size 201327788 bytesDatabase Buffers 398458880 bytesRedo Buffers 5681152 bytesDatabase mounted.

    Database opened.SQL>

    Post-Upgrade Status tool (utlu111s.sql)

    Now run the post upgrade tool to verify the status of the upgrade.SQL> spool post_upgrade.logSQL> @utlu111s.sql.Oracle Database 11.1 Post-Upgrade Status Tool 07-28-2010 20:29:10.Component Status Version HH:MM:SS.

    Oracle Server. VALID 11.1.0.6.0 00:17:33

    http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#i1012368http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#i1012368http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#i1012368
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    11/16

    JServer JAVA Virtual Machine. VALID 11.1.0.6.0 00:09:05Oracle Workspace Manager. VALID 10.2.0.4.3 00:00:01OLAP Analytic Workspace. VALID 11.1.0.6.0 00:00:24OLAP Catalog. VALID 11.1.0.6.0 00:00:55Oracle OLAP API. VALID 11.1.0.6.0 00:00:24Oracle Enterprise Manager. ORA-06550: line 5, column 35:. PL/SQL: ORA-00942: table or view does not exist. ORA-06550: line 5, column 1:. PL/SQL: SQL Statement ignored. ORA-00001: unique constraint (SYSMAN.PARAMETERS_PRIMARY_KEY) violated. ORA-06512: at "SYSMAN.MGMT_TIME_SYNC", line 108. ORA-06512: at "SYSMAN.MGMT_TIME_SYNC", line 166. ORA-06512: at line 2. VALID 11.1.0.6.0 00:08:48

    Oracle XDK. VALID 11.1.0.6.0 00:00:41Oracle Text. VALID 11.1.0.6.0 00:00:50Oracle XML Database. VALID 11.1.0.6.0 00:03:48Oracle Database Java Packages. VALID 11.1.0.6.0 00:00:17Oracle Multimedia. VALID 11.1.0.6.0 00:03:20Spatial. VALID 11.1.0.6.0 00:04:13Oracle Expression Filter

    . VALID 11.1.0.6.0 00:00:11Oracle Rule Manager

    . VALID 11.1.0.6.0 00:00:09Gathering Statistics. 00:03:59Total Upgrade Time: 00:54:50

    PL/SQL procedure successfully completed.

    SQL> SPOOL OFF

    The following errors will arise if you are upgrading from Oracle 10.2.0.4:

    . ORA-06550: line 5, column 35:. PL/SQL: ORA-00942: table or view does not exist

    . ORA-06550: line 5, column 1:

    . PL/SQL: SQL Statement ignored

    . ORA-00001: unique constraint (SYSMAN.PARAMETERS_PRIMARY_KEY) violated

    . ORA-06512: at "SYSMAN.MGMT_TIME_SYNC", line 108

    . ORA-06512: at "SYSMAN.MGMT_TIME_SYNC", line 166

    . ORA-06512: at line 2

    These errors do not result in any data loss. Therefore, you can ignore these errors.

    This issue is tracked with Oracle bug 6705429.SeeMetalink Note: 559255.1

    If the Post-Upgrade Status Tool returns and other errors or shows components that are not VALID or notthe most recent release, then see:Troubleshoot the Upgrade

    There are some further actions that need to be done, but they do not require the database to be inupgrade mode. Now is the time to perform those action via catuppst.sql script.

    SQL> SPOOL catuppst.logSQL> @catuppst.sqlTIMESTAMP--------------------------------------------------------------------------------

    COMP_TIMESTAMP POSTUP_BGN 2010-07-28 20:44:04

    https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=README&id=559255.1#BGBIBBCDhttps://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=README&id=559255.1#BGBIBBCDhttps://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=README&id=559255.1#BGBIBBCDhttp://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#i1012368http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#i1012368http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#i1012368https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=README&id=559255.1#BGBIBBCD
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    12/16

    PL/SQL procedure successfully completed.

    This script will migrate the Baseline data on a pre-11g databaseto the 11g database..[output trimmed]... ...... Completed Moving the Baseline Data ...... ...... If there are no Move BL Data messages ...... above, then there are no renamed ...... baseline tables in the system. ...... ...[output trimmed]... ...... Completed the Dropping of the ...... Renamed Baseline Tables ...... ...

    ... If there are no Drop Table messages ...

    ... above, then there are no renamed ...

    ... baseline tables in the system. ...

    ... ...

    PL/SQL procedure successfully completed.

    TIMESTAMP

    --------------------------------------------------------------------------------COMP_TIMESTAMP POSTUP_END 2010-07-28 20:44:11

    SQL> SPOOL OFF

    Now run the utlrp.sql script to compile the objects which were invalidated during the upgrade.

    SQL> SPOOL utlrp.logSQL> @utlrp.sql

    TIMESTAMP-----------------------------------------------------------------------------

    ---COMP_TIMESTAMP UTLRP_BGN 2010-07-28 20:46:23..[output trimmed]..PL/SQL procedure successfully completed.

    TIMESTAMP--------------------------------------------------------------------------------COMP_TIMESTAMP UTLRP_END 2010-07-28 20:51:09

    PL/SQL procedure successfully completed.

    DOC> The following query reports the number of objects that have compiledDOC> with errors (objects that compile with errors have status set to 3 inDOC> obj$). If the number is higher than expected, please examine the errorDOC> messages reported with each object (using SHOW ERRORS) to see if theyDOC> point to system misconfiguration or resource constraints that must beDOC> fixed before attempting to recompile these objects.DOC>#

    OBJECTS WITH ERRORS

    -------------------1

  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    13/16

    DOC> The following query reports the number of errors caught duringDOC> recompilation. If this number is non-zero, please query the errorDOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errorsDOC> are due to misconfiguration or resource constraints that must beDOC> fixed before objects can compile successfully.DOC>#

    ERRORS DURING RECOMPILATION---------------------------

    0

    PL/SQL procedure successfully completed.

    PL/SQL procedure successfully completed.

    SQL> SPOOL OFF

    SQL> SELECT count(*) FROM dba_invalid_objects;

    COUNT(*)----------

    1

    SQL> select owner , object_name FROM dba_invalid_objects;

    OWNER OBJECT_NAME--------- ---------------------------SH FWEEK_PSCAT_SALES_MV

    /*

    Even after running utlrp.sql if you see objects invalid indba_invalid_objects, thenreview those objects and see why they are invalid and try to fix them.In my case this is a materialized view in SH schema that is invalid. Since

    SH is nota schema used by my application and is an Oracle sample schema so I don't

    careabout it.

    */

    The upgrade is now done. Now is the time to fix the Miscellaneous Warnings that were suggested by thePre-Upgrade tool as to be done after the upgrade. In my case I need to fix the following:

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

    Refer to the articleOracle 11g Release 1 Pre Upgrade tool utlu111i.sqlto see how to fix these.

    Now change the compatible initialization parameter to 11.1.0.6.0 to use all the features of Oracle 11gRelease 1.

    SQL> alter system set compatible='11.1.0.6.0' scope=spfile;

    System altered.

    SQL> shutdown immediate

    SQL> startup

    SQL> show parameter compatible

    NAME TYPE VALUE------------------------------------ ----------- ------------------------------compatible string 11.1.0.6.0

    Configure Listener for New Oracle 11g Database in 11g ORACLE_HOME

    Copy the 10g ORACLE_HOME/network/admin/listener.ora to 11g ORACLE_HOME/network/admin, oncecopied change the ORACLE_HOME in the file to point to 11g HOME whereever required.

    This is how the listener.ora should look like under the 11g ORACLE_HOME/network/admin directory.

    http://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#aclhttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#aclhttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#aclhttp://www.oracleflash.com/38/Oracle-11g-Release-1-Pre-Upgrade-tool-utlu111i-sql.html#acl
  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    14/16

    # listener.ora Network Configuration File:/u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora# Generated by Oracle configuration tools.

    SID_LIST_LISTENER =(SID_LIST =(SID_DESC =

    (SID_NAME = PLSExtProc)(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)(PROGRAM = extproc)

    ))

    LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =

    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))(ADDRESS = (PROTOCOL = TCP)(HOST = ora11gR1.home.com)(PORT = 1521))

    ))

    Once listener is setup just start the listener.

    $ lsnrctl start

    TNSLSNR for Linux: Version 11.1.0.6.0 - ProductionSystem parameter file is/u01/app/oracle/product/11.1.0/db_1/network/admin/listener.oraLog messages written to/u01/app/oracle/diag/tnslsnr/ora11gR1/listener/alert/log.xmlListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))Listening on:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora11gR1.home.com)(PORT=1521)))

    .[output trimmed].Listening Endpoints Summary...

    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora11gR1.home.com)(PORT=1521)))

    Services Summary...Service "PLSExtProc" has 1 instance(s).

    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully

    The listener is just started and shortly it will register the SID ora10g.

    $ lsnrctl status

    Copyright (c) 1991, 2007, Oracle. All rights reserved..[output trimmed].Listening Endpoints Summary...

    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora11gR1.home.com)(PORT=1521)))

    Services Summary...Service "PLSExtProc" has 1 instance(s).

    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

    Service "ora10g.home.com" has 1 instance(s).Instance "ora10g", status READY, has 1 handler(s) for this service...Service "ora10gXDB.home.com" has 1 instance(s).

    Instance "ora10g", status READY, has 1 handler(s) for this service...Service "ora10g_XPT.home.com" has 1 instance(s).

    Instance "ora10g", status READY, has 1 handler(s) for this service...The command completed successfully

    ora10g which is an upgraded database is now registered with the LISTENER.

    Upgrade Enterprise Manager Repository to 11g

    The enterprise manager is unusable yet. You will have to upgrade it too from 10g to 11g and then you

    may use it.

  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    15/16

    $ export ORACLE_UNQNAME=ora10g[oracle@ora11gR1 admin]$ emctl start dbconsoleOC4J Configuration issue./u01/app/oracle/product/11.1.0/db_1/oc4j/j2ee/OC4J_DBConsole_ora11gR1.home.com_ora10gnot found.

    -- As you see the dbconsole cannot start.

    $ emca -upgrade db

    STARTED EMCA at Jul 28, 2010 9:14:23 PMEM Configuration Assistant, Version 11.1.0.5.0 ProductionCopyright (c) 2003, 2005, Oracle. All rights reserved.

    Enter the following information:Jul 28, 2010 9:14:23 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineSEVERE: No SID specifiedORACLE_HOME for the database to be upgraded:/u01/app/oracle/product/10.2.0/db_1

    Database SID: ora10gListener port number: 1521Password for SYS user:Do you wish to continue? [yes(Y)/no(N)]: YJul 28, 2010 9:15:01 PM oracle.sysman.emcp.EMConfig performINFO: This operation is being logged at/u01/app/oracle/cfgtoollogs/emca/ora10g/emca_2010_07_28_21_14_23.log.Jul 28, 2010 9:15:01 PM oracle.sysman.emcp.util.DBControlUtil stopOMSINFO: Stopping Database Control (this may take a while) ...Jul 28, 2010 9:15:13 PM oracle.sysman.emcp.EMReposConfiguploadConfigDataToRepositoryINFO: Uploading configuration data to EM repository (this may take a while)...

    Jul 28, 2010 9:16:09 PM oracle.sysman.emcp.EMReposConfig invokeINFO: Uploaded configuration data successfullyJul 28, 2010 9:16:32 PM oracle.sysman.emcp.util.DBControlUtilconfigureSoftwareLibINFO: Software library configured successfully.Jul 28, 2010 9:16:32 PM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibraryINFO: Deploying Provisioning archives ...Jul 28, 2010 9:17:12 PM oracle.sysman.emcp.EMDBPostConfigconfigureSoftwareLibraryINFO: Provisioning archives deployed successfully.Jul 28, 2010 9:17:12 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsoleINFO: Securing Database Control (this may take a while) ...Jul 28, 2010 9:17:25 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

    INFO: Database Control secured successfully.Jul 28, 2010 9:17:25 PM oracle.sysman.emcp.util.DBControlUtil startOMSINFO: Starting Database Control (this may take a while) ...Jul 28, 2010 9:19:04 PM oracle.sysman.emcp.EMDBPostConfig performUpgradeINFO: Database Control started successfullyJul 28, 2010 9:19:08 PM oracle.sysman.emcp.EMDBPostConfig performUpgradeINFO: >>>>>>>>>>> The Database Control URL ishttps://ora11gR1.home.com:1158/em

  • 5/22/2018 Upgrade Oracle 10g Release 2 to Oracle 11g Release 1 JAI MAA DURGA

    16/16

    Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.Oracle Enterprise Manager 11g is running.------------------------------------------------------------------Logs are generated in directory/u01/app/oracle/product/11.1.0/db_1/ora11gR1.home.com_ora10g/sysman/log$

    At last lets check the status of the oracle components upgraded.

    SQL> column comp_name format a40SQL> column version format a15SQL> column status format a7SQL> select comp_name , version , status from dba_registry;

    COMP_NAME VERSION STATUS---------------------------------------- --------------- -------Oracle Enterprise Manager 11.1.0.6.0 VALIDOLAP Catalog 11.1.0.6.0 VALIDSpatial 11.1.0.6.0 VALIDOracle Multimedia 11.1.0.6.0 VALIDOracle XML Database 11.1.0.6.0 VALIDOracle Text 11.1.0.6.0 VALIDOracle Data Mining 11.1.0.6.0 VALIDOracle Expression Filter 11.1.0.6.0 VALIDOracle Rule Manager 11.1.0.6.0 VALIDOracle Workspace Manager 10.2.0.4.3 VALIDOracle Database Catalog Views 11.1.0.6.0 VALIDOracle Database Packages and Types 11.1.0.6.0 VALIDJServer JAVA Virtual Machine 11.1.0.6.0 VALIDOracle XDK 11.1.0.6.0 VALIDOracle Database Java Packages 11.1.0.6.0 VALIDOLAP Analytic Workspace 11.1.0.6.0 VALID

    Oracle OLAP API 11.1.0.6.0 VALID

    17 rows selected.

    If they are all VALID with 11.1.0.xxx, the upgrade was successful.