ORACLE – 9i to 10g database Upgrade using DBUA.

Purpose of this document is to show a complete 9i to 10g upgrade of an Oracle database on AIX 5L using DBUA ( Database Uprgrade Assistant)

10g upgrade from 9.2.06 to for any database -: Check the init.ora parameter file in the 9I ORACLE_HOME/dbs Make sure there is no “If event=”30084 trace name context forever, level1” defined in pfile of spfile. LOGIN TO NEW PSERIES MACHINE AS oraprod user. Important : Issue unix command unset TNS_ADMIN
export ORACLE_HOME=/u01/finprod/finproddb/10.2/db_1 export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:/usr/sbin:/usr/bin/
export PERL5LIB=$ORACLE_HOME/perl/lib/5.8.3:$ORACLE_HOME/perl/lib/site_pearl/5.8.3 export LIBPATH=$ORACLE_HOME/lib:/usr/dt/lib:/usr/openwin/lib: $ORACLE_HOME/lib32:$ORACLE_HOME/ctx/lib export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/dt/lib:/usr/openwin/lib:$ORACLE_HOME/ctx/lib

export ORA_NLS10=/u01/finprod/finproddb/10.2/db_1/nls/data/9idata unset TNS_ADMIN To make sure run the following to ascertain correct paths below. echo $ORACLE_HOME echo $PATH echo $PERL5LIB echo $LIBPATH echo $LD_LIBRARY_PATH echo $NLS_010

Firstly create the /NLS/DATA/9i data directory.


DESCRIPTION The script copies every nlb files under $ORACLE_HOME/nls/data and $ORACLE_HOME/nls/data/old to directory $ORACLE_HOME/nls/data/9idata for customer needs to revert back to 9i locale behavior.

Make sure perl utility being used points to the 10g oracle environment. Make sure there is no reference to the old 9i environment in the $PATH or this command will fail as the old version of perl is picked up. export PATH=$ORACLE_HOME/bin: $ORACLE_HOME/perl/bin:/usr/sbin:/usr/bin/ $ which perl /u01/finprod/finproddb/10.2/db_1/perl/bin/perl $
oraprod(DATABASE)@nbrbwdev5:perl $ORACLE_HOME/nls/data/old/

Creating directory /u01/finprod/finproddb/10.2/db_1/nls/data/9idata ... Copying files to /u01/finprod/finproddb/10.2/db_1/nls/data/9idata... Copy finished. Please reset environment variable ORA_NLS10 to /u01/finprod/finproddb/10.2/db_1/nls/data/9idata export ORA_NLS10=/u01/finprod/finproddb/10.2/db_1/nls/data/9idata oraprod(DATABASE)@nbrbwdev5:echo $ORA_NLS10 /u01/finprod/finproddb/10.2/db_1/nls/data/9idata Now configure listener for 10g home First unset TNS_ADMIN so that the old 9i environment is unset. unset TNS_ADMIN
oraprod(DATABASE)@nbrbwdev5:cd $ORACLE_HOME/bin (10g ORACLE_HOME)

oraprod(DATABASE)@nbrbwdev5:export DISPLAY= oraprod(DATABASE)@nbrbwdev5:ls netca netca oraprod(DATABASE)@nbrbwdev5:./netca Oracle Net Services Configuration:


FINPROD was used here and not LISTENER as above. .Use same listener name as in old machine….

Use same port number as currently used by the current database -1526 .

If you haven’t changed your . oraprod(DATABASE)@nbrbwdev5:sqlplus "sys as sysdba" SQL*Plus: Release 9. Oracle Corporation. All rights reserved. Oracle Net Services configuration successful.6.Production on Thu Feb 21 11:57:55 2008 Copyright (c) 1982.0 . 2002. The exit code is 0 SHUTDOWN LISTENER lsnrctl stop FINPROD ( Database name ) Now start the PRE-UPGRADE STEPS: Important : START THE DATABASE in the 9i environment and not from the new 10g environment.0.Message on screen : Oracle Net Services Configuration: Configuring Listener:FINPROD Default local naming configuration complete.profile . Listener configuration complete. Listener started successfully. Enter password: Connected to an idle instance.2/db_1/bin/lsnrctl start FINPROD Listener Control complete. . just log into a new session so that the old 9i environment is picked up. Oracle Net Listener Startup: Running Listener Control: /u01/finprod/finproddb/10.profile and are still using the 9i .2.

sqlplus '/as sysdba' ---In 9i environment. 1. ORACLE instance started. SQL> STEPS FOR UPGRADING THE DATABASE TO 10G RELEASE 2 ================================================= Preparing to Upgrade -------------------In this section all the steps need to be performed to the previous version of Oracle.e 9i environment. Make a note of the new location of these files. cd /tmp Start SQL*Plus and connect to the database instance as a user with SYSDBA privileges. The sections which follow. Database opened. Please note that the database must be running in normal mode in the old release.log SQL> @utlu102i. Total System Global Area 2149552280 bytes Fixed Size 745624 bytes Variable Size 1879048192 bytes Database Buffers 268435456 bytes Redo Buffers 1323008 bytes Database mounted.SQL> startup.sql file. . check the spool file and examine the output of the upgrade information tool. Then run and spool the utlu102i.sql SQL> spool off Then. SQL> spool Database_Info. such as the /tmp directory on your system: cp $ORACLE_HOME/rdbms/admin/utlu102i. PRE UPGRADE DATABASE HEALTH CHECK: Log in to the system as the owner of the new 10gR2 ORACLE_HOME and copy the following files from the 10gR2 ORACLE_HOME/rdbms/admin directory to a directory outside of the Oracle home.i.sql). Change to the temporary directory that you copied files to in Step 1.sql /tmp---have to be in the 10g environment to do this. describe the output of the Upgrade Information Tool (utlu102i.

a message is displayed if the tablespace is adequate for the upgrade. New files of at least 4 MB (preferably 10 MB) need to be created in the current database. Update Parameters: This section displays a list of initialization parameters in parameter file of the current database that must be adjusted the database is upgraded. The adjustments need to be made to parameter file after it is copied to the new Oracle Database release. Obsolete initialization parameters need to be removed from the parameter file before the database is upgraded. For each log file. and recommended size is displayed. If the tablespace does not have enough free space. Tablespace adjustments need to be made before the database is upgraded. Obsolete Parameters: This section displays a list of initialization parameters in the parameter file of the current database that are obsolete in the new Oracle Database 10g release. the before the 10g Components: . and compatibility level. Logfiles: This section displays a list of redo log files in the current database whose size is less than 4 MB. group number. In addition. Tablespaces: This section displays a list of tablespaces in the current database. Any redo log files less than 4 MB must be dropped before the database is upgraded.Database: This section displays global database information about the current database such as the database name. the file name. then space must be added to the tablespace in the current database. Deprecated Parameters: This section displays a list of initialization parameters in the parameter file of the current database that are deprecated in the new Oracle Database 10g release. A warning is displayed if the COMPATIBLE initialization parameter needs to be adjusted before the database is upgraded. release number.the tablespace name and minimum required size is displayed. For each tablespace.

Miscellaneous Warnings: This section provides warnings about specific situations that may require attention before and/or after the upgrade.This section displays a list of database components in the new Oracle Database 10g release that will be upgraded or installed when the current database is upgraded. SYSAUX Tablespace: This section displays the minimum required size for the SYSAUX tablespace. grant alter session to connect1. 'WKUSER'. 'OLAPDBA'. grant create table to connect1. 'ORDPLUGINS'. 'EXFSYS'. grant create sequence to connect1. The SYSAUX tablespace must be created after the new Oracle Database 10g release is started and BEFORE the upgrade scripts are invoked. 'SYSMAN'. which is required in Oracle Database 10g. . 'SI_INFORMTN_SCHEMA'. However since we are using DBUA to upgrade. Grant all privs usually associated with the CONNECT role in previous versions. Ex grant connect1 to “bb16872. 'DMSYS'. 'LOGSTDBY_ADMINISTRATOR'. spool grant_connect1.sql and make sure any bb staff I’d are in quotes. CREATE ROLE CONNECT1.sql Select ‘grant connect1 to ‘ || grantee || ‘.’ from dba_role_privs WHERE granted_role = 'CONNECT' and grantee NOT IN ( 'SYS'. 'LBACSYS'. grant create synonym to connect1. 2. 'ORDSYS'. grant create database link to connect1. 'CTXSYS'. 'DBSNMP'. 'ODM').1”. Therefore create a new role with the usual privileges which CONNECT role had in 9i and grant it to the users who are not generic database users. spool off Run @grant_connect1. 'OUTLN'. 'XDB'. 'MDDATA'. 'WKPROXY'. 'SYSTEM'. 'WK_TEST'. 'OEM_MONITOR'. 'WKSYS'. grant create cluster to connect1. 'OLAPSVR'. 'MDSYS'. grant create view to connect1. the assistant will prompt you for the creation of the SYSAUX tablespace so there is no need to create it manually. 'OLAP_USER'. CHECK FOR CONNECT ROLE PRIVILEGE CHANGES The CONNECT role in 10g Release 2 has only create session privilege. grant create session to connect1. 'OLAPSYS'. 'WMSYS'.

. connect to the database AS SYSDBA using SQL*Plus.user$ U WHERE L. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. the database links will not exist in the downgraded database. If you anticipate a requirement to be able to downgrade back to your original release. exec dbms_stats. Spool off Spool file above already in place in /u02/oradata/software 4.NAME.sql from /u02/oradata/software 3.USER# . U.Null.gather_schema_stats('WMSYS'. exec dbms_stats. Spool db_links. then save the information about affected database links from the SYS.NAME||chr(10) ||'connect to ' || L. cascade => TRUE).NAME||'.PASSWORD||''' using ''' || L. Consequently. so that you can recreate the database links after the downgrade. GATHER SCRIPT TO RECREATE DATABASE LINKS IN CASE OF DOWNGRADE: During the upgrade to 10gR2.LINK$ table.options=>'GATHER'.txt Set head off SELECT 'create '||DECODE(U. all of the database links with encrypted passwords must be dropped prior to the downgrade.gather_schema_stats('MDSYS'.' TEXT FROM sys.'public ')||'database link '|| CHR(10)||DECODE(U.AUTO_SAMPLE_SIZE. any passwords in database links will be || '''' ||chr(10)||'. estimate_percent =>$ L.NAME.options=>'GATHER'.AUTO_SAMPLE_SIZE.USERID || ' identified by ''' ||L. Following script can be used to construct the dblink. cascade => TRUE).'PUBLIC'.Scripts for the above already in place : Just run create_connect1.sql and grant_connect1.OWNER# = U. spool gdict grant analyze any to sys. estimate_percent => DBMS_STATS. GATHER STATISTICS BEFORE UPGRADE: To run this script.'PUBLIC'. method_opt => 'FOR ALL COLUMNS SIZE AUTO'.')|| L. To downgrade back to the original release. sys.

gather_schema_stats('CTXSYS'. exec dbms_stats.AUTO_SAMPLE_SIZE.options=>'GATHER'. estimate_percent => DBMS_STATS. cascade => TRUE). spool off The above steps take 1.5 hours max. cascade => TRUE). estimate_percent => DBMS_STATS. estimate_percent => DBMS_STATS.exec dbms_stats.gather_schema_stats('SI_INFORMTN_SCHEMA'. estimate_percent => DBMS_STATS. exec dbms_stats.AUTO_SAMPLE_SIZE. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. cascade => TRUE).AUTO_SAMPLE_SIZE.options=>'GATHER'. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. method_opt => 'FOR ALL COLUMNS SIZE AUTO'.gather_schema_stats('SYSTEM'. exec dbms_stats. estimate_percent => DBMS_STATS. estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE. estimate_percent => DBMS_STATS.options=>'GATHER'. exec dbms_stats. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. cascade => TRUE).gather_schema_stats('ORDPLUGINS'.AUTO_SAMPLE_SIZE. estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. exec dbms_stats.AUTO_SAMPLE_SIZE.gather_schema_stats('WKSYS'. estimate_percent => DBMS_STATS. estimate_percent => DBMS_STATS. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. method_opt => 'FOR ALL COLUMNS SIZE AUTO'.options=>'GATHER'.options=>'GATHER'. cascade => TRUE).gather_schema_stats('DMSYS'. cascade => TRUE).gather_schema_stats('SYS'.gather_schema_stats('LBACSYS'. exec dbms_stats. method_opt => 'FOR ALL COLUMNS SIZE AUTO'.options=>'GATHER'. estimate_percent => DBMS_STATS.options=>'GATHER'.gather_schema_stats('OUTLN'. exec dbms_stats.AUTO_SAMPLE_SIZE. estimate_percent => DBMS_STATS. cascade => TRUE). exec dbms_stats.AUTO_SAMPLE_SIZE. exec dbms_stats.AUTO_SAMPLE_SIZE. estimate_percent => DBMS_STATS. . cascade => TRUE). cascade => TRUE). cascade => TRUE). cascade => TRUE).options=>'GATHER'.gather_schema_stats('DBSNMP'.options=>'GATHER'.options=>'GATHER'. exec dbms_stats. cascade => TRUE). method_opt => 'FOR ALL COLUMNS SIZE AUTO'.options=>'GATHER'.gather_schema_stats('OLAPSYS'. method_opt => 'FOR ALL COLUMNS SIZE AUTO'.gather_schema_stats('XDB'.options=>'GATHER'. cascade => TRUE).AUTO_SAMPLE_SIZE. method_opt => 'FOR ALL COLUMNS SIZE AUTO'.AUTO_SAMPLE_SIZE.gather_schema_stats('ODM'. exec dbms_stats. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. exec dbms_stats. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. exec dbms_stats. estimate_percent => DBMS_STATS.gather_schema_stats('ORDSYS'.AUTO_SAMPLE_SIZE. method_opt => 'FOR ALL COLUMNS SIZE AUTO'. cascade => TRUE).AUTO_SAMPLE_SIZE.options=>'GATHER'.options=>'GATHER'.

lst select substr(owner. substr(object_type. status from dba_objects where status <>'VALID'. LOGOFF FROM MACHINE.254.8.25:0.Run /u02/oradata/software/analyze.2/d b_1/perl/lib/site_pearl/5.2/db_1/Apache/perl/bin:/u01/finprod/finproddb/10.0 unset TNS_ADMIN unset ORACLE_BASE echo all the env variables above and then proceed.2/db_1/perl/lib/5.2/db_1/OPatch $export ORA_NLS10=/u01/finprod/finproddb/10.2/db_1/Apach e/perl/bin:/usr/bin:/usr/bin:/u01/finprod/finproddb/10.12) owner.1.2/db_1/lib:/usr/dt/lib:/usr/openwin/lib:/u01/finprod/fi nproddb/10.2/db_1/bin:/usr/ccs/bin:/usr/sbin:/bi n:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/x11:/sbin:/u01/oraprod:/u01/oraprod/bin:/bin:/u 01/oraprod/scripts:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/x11:/sbin:/u01/oraprod:/u01/or aprod/bin:/bin:/usr/local/bin:/u01/oracle/prod/scripts:/u01/local/bwa/prod/scripts:/u01/loc al/bwa/prod/c/bin:/u01/local/pvcs:/usr/ccs/bin:/usr/openwin/bin:.owner from dba_objects where status <>'VALID' group by object_type.2/db_1/nls/data/9idata export DISPLAY=10.8.3:/u01/finprod/finproddb/10.30) object.sql Get a count of all INVALID OBJECTS PRIOR TO UPGRADE: spool invalid_pre.2/db _1/Apache/perl/bin:/usr/bin:/u01/finprod/finprodora/iAS/Apache/perl/bin:/u01/finprod/fin proddb/10.1. spool off.3 $export LD_LIBRARY_PATH=/u01/finprod/finproddb/10. LOGIN AGAIN AND INVOKE 10g ENVIRONMENT UPGRADE STEPS Make sure environment in 10g and all env variables defined – export ORACLE_HOME=/u01/finprod/finproddb/10.2/db_1/ctx/lib $export LIBPATH=/u01/finprod/finproddb/10. owner.:/u01/local/bwa/prod/scri pts:/u01/local/sas8:/u01/finprod/finproddb/10.2/db_1/bin:/usr/ccs/bin:/usr/sbin:/bin:/u01/finprod/finproddb/10. .2/db_1/lib32:/u01/finprod/finproddb/10.2/db_1 $export PERL5LIB=/u01/finprod/finproddb/10.2/db_1/ctx/lib $export PATH=/u01/finprod/finproddb/10.101. select count(*). substr(object_name.1.object_type.30) type.2/db_1/lib:/usr/dt/lib:/usr/openwin/lib:/u 01/finprod/finproddb/10.

ora.ora The TNS_ADMIN environment variable is not set in 10g..ora. Make sure that the sqlnet config files listener. 3.2 ORACLE_HOME/network/admin directory then DBUA fails.ora tnsnames. But in an Oracle E-business Suite environment the sqlnet config files are not in the default location of $ORACLE_HOME /network/admin. During DBUA's "Pre Upgrade" check. Copy the sqlnet config files from TNS_ADMIN location to $ORACLE_HOME/network/admin.ora are in the default location of $ORACLE_HOME/network/admin. copy the following files from the 9i ORACLE_HOME/network/admin/finprod_frmbwds03 to ORACLE_HOME/network/admin Refer note 431437.2 ORACLE_HOME 4. This should be the 9. If they are not there then find out where the TNS_ADMIN variable points to.2 home.ora sqlnet.2 ORACLE_HOME 2.synopsis below Cause Apparently if there are no sqlnet config files in the default location of the 9. tnsnames. Rerun DBUA Steps below : cd /u01/finprod/finproddb/92/network/admin/finprod_frmbwds03 cp listener. therefore DBUA cannot resolve the local_listener.ora /u01/finprod/finproddb/92/network/admin . sqlnet. "Installation Guide for Solaris Operating System (SPARC 64-Bit)" wants it to be unset during software installation/database upgrade. The sqlnet config files are: listener.ora /u01/finprod/finproddb/92/network/admin cp tnsnames. Solution 1.ora /u01/finprod/finproddb/92/network/admin cp sqlnet_ifile.1 in metalink…. it runs database from 9. This should be the 9.To avoid a local_listener error after launching DBUA since port 1521 is in use.

1 oraprod dba 1315 Apr 24 11:26 listener.0.0.ora -rw-r--r-.loc Make sure right inventory is picked up – the new 10g patched environment.254.3 apply the following patches using opatch to avoid the upgrade failing half way. Should be in the 10g HOME. The patch numbers for AIX5L are 1. TOC size: 67040 Maximum size: 65536 Extra instructions are being generated for each reference to a TOC symbol if the symbol is in the TOC overflow area.2. Error similar to this… ld: 0711-783 WARNING: TOC overflow. Unzip the files and go to directory created on unzip For example patch number 5755471 Go to /5755471 directory opatch lsinventory –invPtrLoc $ORACLE_HOME/oraInst.loc For two of the patches you will see a few relinking errors which can be ignored.1 oraprod dba 627 Apr 24 11:26 /u01/finprod/finproddb/92/network/admin $ ls -lrt -rw-r--r-.ora $ Before upgrading to 10. address of your machine/laptop. 5755471 2. Now proceed with UPGRADE of database. ld: 0711-783 WARNING: TOC overflow..This is the I. TOC size: 67040 Maximum size: 65536 Extra instructions are being generated for each reference to a TOC symbol if the symbol is in the TOC overflow area. 5892355 3. . Now launch DBUA from the 10g ORACLE_HOME/bin cd $ORACLE_HOME/bin export DISPLAY=10. 5871314 4..1 oraprod dba 2292 Apr 24 11:26 tnsnames. opatch apply –invPtrLoc $ORACLE_HOME/oraInst. Download the patches and transfer to any directory.101.P.ora -rw-r--r-.25:0. The upgrade will fail if the following PATCHES are not applied.

/dbua ..


CLICK NEXT BACKUP already taken so continue… .

.No need of any OEM now.

.Takes a long time to go from 11 percent to 13 percent.

39. 6). . To find out how much has completed run this command: SELECT COUNT(*) FROM UTL_RECOMP_COMPILED. 5. Takes a long time at 33.73 percent. The count should reduce. To find out how many objects remain to be compiled run this command: SELECT COUNT(*) FROM obj$ WHERE status IN (4.From 32 percent the JServer JAVA Virtual Machine upgrade starts. The count should increase . Post upgrade starts at 58 percent. Takes about 7 hours at 82 percent -running the compilation job of all objects as part of the POST UPGRADE…as screenshot above shows.

Ignore if step is for Real Application Clusters as it is not used in this environment.Check the failed steps. .


Sign up to vote on this title
UsefulNot useful