P. 1
10g-Upgrade Database Dbua1

10g-Upgrade Database Dbua1

|Views: 10|Likes:
Published by oraclebharadwaj

More info:

Published by: oraclebharadwaj on Jun 01, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





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/cr9idata.pl

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 . Enter password: Connected to an idle instance.profile . Listener started successfully.2. All rights reserved.Production on Thu Feb 21 11:57:55 2008 Copyright (c) 1982.6.profile and are still using the 9i . just log into a new session so that the old 9i environment is picked up. Oracle Net Services configuration successful. oraprod(DATABASE)@nbrbwdev5:sqlplus "sys as sysdba" SQL*Plus: Release 9.0. Listener configuration complete.0 .2/db_1/bin/lsnrctl start FINPROD Listener Control complete. Oracle Net Listener Startup: Running Listener Control: /u01/finprod/finproddb/10. Oracle Corporation.Message on screen : Oracle Net Services Configuration: Configuring Listener:FINPROD Default local naming configuration complete. 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. 2002. .

Change to the temporary directory that you copied files to in Step 1. .sql SQL> spool off Then.sql). check the spool file and examine the output of the upgrade information tool. cd /tmp Start SQL*Plus and connect to the database instance as a user with SYSDBA privileges. Please note that the database must be running in normal mode in the old release.i. Then run and spool the utlu102i.e 9i environment. ORACLE instance started.SQL> startup.sql /tmp---have to be in the 10g environment to do this. 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> spool Database_Info. The sections which follow. such as the /tmp directory on your system: cp $ORACLE_HOME/rdbms/admin/utlu102i. 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. sqlplus '/as sysdba' ---In 9i environment. 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. describe the output of the Upgrade Information Tool (utlu102i. Database opened.log SQL> @utlu102i. Make a note of the new location of these files. 1.sql file.

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

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

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

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

:/u01/local/bwa/prod/scri pts:/u01/local/sas8:/u01/finprod/finproddb/10. substr(object_type.2/d b_1/perl/lib/site_pearl/5.2/db_1/bin:/usr/ccs/bin:/usr/sbin:/bin:/u01/finprod/finproddb/10.1.2/db_1/ctx/lib $export PATH=/u01/finprod/finproddb/10.2/db _1/Apache/perl/bin:/usr/bin:/u01/finprod/finprodora/iAS/Apache/perl/bin:/u01/finprod/fin proddb/10. owner.2/db_1/lib32:/u01/finprod/finproddb/10.1. spool off.2/db_1 $export PERL5LIB=/u01/finprod/finproddb/10.2/db_1/Apache/perl/bin:/u01/finprod/finproddb/10. substr(object_name.lst select substr(owner.owner from dba_objects where status <>'VALID' group by object_type.2/db_1/perl/lib/5.101.30) type.Run /u02/oradata/software/analyze.0 unset TNS_ADMIN unset ORACLE_BASE echo all the env variables above and then proceed.30) object.12) owner.2/db_1/OPatch $export ORA_NLS10=/u01/finprod/finproddb/10.3 $export LD_LIBRARY_PATH=/u01/finprod/finproddb/10. status from dba_objects where status <>'VALID'.2/db_1/lib:/usr/dt/lib:/usr/openwin/lib:/u 01/finprod/finproddb/10.2/db_1/Apach e/perl/bin:/usr/bin:/usr/bin:/u01/finprod/finproddb/10.25:0.object_type.2/db_1/ctx/lib $export LIBPATH=/u01/finprod/finproddb/10.8.2/db_1/nls/data/9idata export DISPLAY=10.sql Get a count of all INVALID OBJECTS PRIOR TO UPGRADE: spool invalid_pre. . LOGOFF FROM MACHINE. 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/lib:/usr/dt/lib:/usr/openwin/lib:/u01/finprod/fi nproddb/10.3:/u01/finprod/finproddb/ 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:. select count(*).

ora tnsnames.2 home. If they are not there then find out where the TNS_ADMIN variable points to. 3. Make sure that the sqlnet config files listener. therefore DBUA cannot resolve the local_listener. Copy the sqlnet config files from TNS_ADMIN location to $ORACLE_HOME/network/admin. This should be the 9.2 ORACLE_HOME/network/admin directory then DBUA fails.. tnsnames.synopsis below Cause Apparently if there are no sqlnet config files in the default location of the 9. This should be the 9. copy the following files from the 9i ORACLE_HOME/network/admin/finprod_frmbwds03 to ORACLE_HOME/network/admin Refer note 431437.To avoid a local_listener error after launching DBUA since port 1521 is in use. "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. During DBUA's "Pre Upgrade" check.ora.ora /u01/finprod/finproddb/92/network/admin .ora.ora sqlnet.ora /u01/finprod/finproddb/92/network/admin cp sqlnet_ifile.2 ORACLE_HOME 4. Solution 1. But in an Oracle E-business Suite environment the sqlnet config files are not in the default location of $ORACLE_HOME /network/admin.ora The TNS_ADMIN environment variable is not set in 10g.2 ORACLE_HOME 2. sqlnet.ora /u01/finprod/finproddb/92/network/admin cp tnsnames. it runs database from 9.1 in metalink….ora are in the default location of $ORACLE_HOME/network/admin. Rerun DBUA Steps below : cd /u01/finprod/finproddb/92/network/admin/finprod_frmbwds03 cp listener.

3 apply the following patches using opatch to avoid the upgrade failing half way. Now launch DBUA from the 10g ORACLE_HOME/bin cd $ORACLE_HOME/bin export DISPLAY=10.0.ora -rw-r--r-.101. 5871314 4.254. Now proceed with UPGRADE of database. 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. ld: 0711-783 WARNING: TOC overflow. .2. opatch apply –invPtrLoc $ORACLE_HOME/oraInst.1 oraprod dba 1315 Apr 24 11:26 listener.25:0. 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. 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..ora -rw-r--r-.ora $ Before upgrading to 10. The patch numbers for AIX5L are 1. Should be in the 10g HOME.0.1 oraprod dba 2292 Apr 24 11:26 tnsnames.loc Make sure right inventory is picked up – the new 10g patched environment..1 oraprod dba 627 Apr 24 11:26 sqlnet_ifile. Error similar to this… ld: 0711-783 WARNING: TOC overflow. Download the patches and transfer to any directory. address of your machine/laptop. 5892355 3.loc For two of the patches you will see a few relinking errors which can be ignored. The upgrade will fail if the following PATCHES are not applied. 5755471 2.cd /u01/finprod/finproddb/92/network/admin $ ls -lrt -rw-r--r-.This is the I.P.

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

To find out how many objects remain to be compiled run this command: SELECT COUNT(*) FROM obj$ WHERE status IN (4. . The count should increase . The count should reduce. To find out how much has completed run this command: SELECT COUNT(*) FROM UTL_RECOMP_COMPILED.From 32 percent the JServer JAVA Virtual Machine upgrade starts. 6). 5.73 percent. Post upgrade starts at 58 percent. Takes a long time at 33.39. 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. .


You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->