You are on page 1of 9

Upgrading 10gR2 to 11gR2

i)

Pre-requisites

a) Complete Checklist for Manual Upgrades to 11gR2 [ID 837570.1]


b) Ensure that all database components / objects provided by Oracle are
VALID in the source database prior to starting the upgrade

SQL> set pagesize500


SQL>
set linesize 100
SQL>
select substr(comp_name,1,40) comp_name, status,
substr(version,1,10) version from dba_registry order by comp_name;
SQL> select substr(object_name,1,40) object_name,substr(owner,1,15)
owner,object_type from dba_objects where status='INVALID' order by
owner,object_type;
SQL> select owner,object_type,count(*) from dba_objects where
status='INVALID' group by owner,object_type order by
owner,object_type ;

COMP_NAME

For any invalid


utlrp.sql script

STATU
S

VERSION

JServer JAVA Virtual Machine

VALID

10.2.0.4.
0

OLAP Analytic Workspace

VALID

10.2.0.4.
0

Oracle Data Mining

VALID

c)

10.2.0.4.
0

Oracle Database Catalog


Views

VALID

10.2.0.4.
0

Oracle Database Java


Packages

VALID

10.2.0.4.
0

Oracle Database Packages


and Types

VALID

10.2.0.4.
0

Oracle Enterprise Manager

VALID

10.2.0.4.
0

Oracle Expression Filter

VALID

10.2.0.4.
0

Oracle OLAP API

VALID

10.2.0.4.
0

Oracle Rule Manager

VALID

10.2.0.4.
0

Oracle Text

VALID

10.2.0.4.
0

Oracle Workspace Manager

VALID

10.2.0.4.
0

VALID

10.2.0.4.
0

Oracle XMLINDEX
Database
AQ$_SCHEDULES_PRI
MARY

VALID

10.2.0.4.
0

Oracle interMedia
DBMS_REPCAT_AUTH
PACKAGE

VALID

DBMS_REPCAT_AUTH
Spatial

10.2.0.4.
0

VALID

10.2.0.4.
0

OBJECT_NAME
Oracle XDKOBJECT_TYPE
AQ$_SCHEDULES

TABLE

PACKAGE
BODY

objects entry
to validate.
Ensure that you
do not have the
duplicate
objects in the
SYS and
SYSTEM
schema

SQL> select
object_name,
object_type
from
dba_objects
where
object_name||
object_type in
(select
object_name||
object_type
from
dba_objects
where owner
= 'SYS')
and owner =
'SYSTEM';

ii)

Install 11g software(11.2.0) in a new ORACLE_HOME


a)
b)
c)
d)

e)
f)
g)
h)
i)

iii)

Install database software only


Single instance database
Enterprise Edition
Check for kernel parameters
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483648
kernel.msgmnb = 65535
kernel.msgmni = 2878
kernel.sem = 256 32000 100 142
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 6915744
fs.aio-max-nr = 1048576
Check for Packages ( elfutils and unixODBC-devel were missing in my
instance. I ignored and moved further)
Proceed with installation
Execute root.sh and complete the installation
Copy utlu112i.sql from 11i ORACLE_HOME to any temporary directory
Execute utlu112i.sql from 10g ORACLE_HOME
Source ORACLE_HOME,PATH,SID
export ORACLE_HOME= /oraProdBin/10g/oracle/product/10.2.0/db_1/
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=test
sqlplus /as sysdba
SQL>@ utlu112i.sql
Check the spool file for any Errors and clear them before proceeding
with the upgrade.

Check for the integrity of the source database prior to


starting the upgrade by downloading and running
dbupgdiag.sql script from below Metalink article
Note 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information
(dbupgdiag.sql)
Check the logfile for any erros.

iv)

Check for TIMESTAMP WITH TIMEZONE Datatype


SQL> select * from v$timezone_file;

v)

FILENAME
-----------timezlrg.dat

VERSION
---------4

Check no files need media recovery


SELECT * FROM v$recover_file;

vi)

Check no files are in backup mode


SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

vii)

To check if a standby database exists, issue the following


query:
SELECT SUBSTR(value,INSTR(value,'=',INSTR(UPPER(value),'SERVICE'))+1)
FROM v$parameter
WHERE name LIKE 'log_archive_dest%' AND UPPER(value) LIKE 'SERVICE%';

viii)

Ensure the users sys and system have 'system' as their


default tablespace.
You must have sufficient space in the tablespace or be set to extents unlimited.
SQL> SELECT username, default_tablespace
FROM dba_users
WHERE username in ('SYS','SYSTEM');

USERNAME
DEFAULT_TABLESPACE
------------------------------ -----------------------------SYSTEM
SYSTEM
SYS
SYSTEM

ix)

Note down the location of datafiles, redo logs, control files.


Also take a backup of all configuration files like
listener.ora,tnsnames.ora,etc., from $ORACLE_HOME
SQL> SELECT name FROM v$controlfile;
NAME
-------------------------------------------------------------------------------/oraProdBin/10g/oracle/product/10.2.0/oradata/test/control01.ctl
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/control02.ctl
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/control03.ctl
SQL> SELECT file_name FROM dba_data_files;
FILE_NAME
-------------------------------------------------------------------------------/oraProdBin/10g/oracle/product/10.2.0/oradata/test/users01.dbf
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/sysaux01.dbf
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/undotbs01.dbf
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/system01.dbf
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/example01.dbf
SQL> SELECT group#, member FROM v$logfile;
GROUP#
---------MEMBER
-------------------------------------------------------------------------------3
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/redo03.log
2

/oraProdBin/10g/oracle/product/10.2.0/oradata/test/redo02.log
1
/oraProdBin/10g/oracle/product/10.2.0/oradata/test/redo01.log
SQL>

x)

Stop the listener

xi)

Stop other executable such as dbconsole, isqlplus

Lsnrctl stop

emctl stop dbconsole


isqlplusctl stop

xii)

Copy the parameter file from 10g ORACLE_HOME to 11g


ORACLE_HOME

cp -r initTEST.ora /oraProdBin/app/oradev/product/11.2.0/dbhome_1/dbs/

xiii) Open and edit the pfile as follows


Commend the below lines
# Diagnostics and Statistics

#background_dump_dest=/oraProdBin/10g/oracle/product/10.2.0/db_1/ad
min/test/bdump
#core_dump_dest=/oraProdBin/10g/oracle/product/10.2.0/db_1/admin/test
/cdump
#user_dump_dest=/oraProdBin/10g/oracle/product/10.2.0/db_1/admin/test
/udump
Add
_disable_fast_validate = true
Replace old ORACLE_HOME with new ORACLE_HOME.

xiv) Set the environment variables to point to the new 11g


ORACLE_HOME

xv)

export ORACLE_HOME=/oraProdBin/app/oradev/product/11.2.0/dbhome_1/
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=test

Update the oratab entry, to set the new ORACLE_HOME


pointing towards TEST database
#test:/oraProdBin/10g/oracle/product/10.2.0/db_1:N
test:/oraProdBin/app/oradev/product/11.2.0/dbhome_1:N

xvi) Start the database in upgrade mode

[oradev@erpdevasi01 ~]$ sqlplus "/as sysdba"


SQL*Plus: Release 11.2.0.1.0 Production on Sun Jan 17 17:37:07 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup upgrade


ORACLE instance started.
Total System Global Area 1573527552 bytes
Fixed Size
1336764 bytes
Variable Size
402655812 bytes
Database Buffers
1157627904 bytes
Redo Buffers
11907072 bytes
Database mounted.
Database opened.
SQL>

xvii) Run upgrade script

SQL> set echo on


SQL> spool catupgrd.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL>
SQL>
SQL>
/**************************************************************************
***/
SQL> /* Step 10 - SHUTDOWN THE DATABASE..!!!!!
SQL> */
SQL>
/**************************************************************************
***/
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL>
SQL> DOC
DOC>#########################################
##############################
DOC>#########################################
##############################
DOC>
DOC> The above sql script is the final step of the upgrade. Please
DOC> review any errors in the spool log file. If there are any errors in
DOC> the spool file, consult the Oracle Database Upgrade Guide for
DOC> troubleshooting recommendations.
DOC>
DOC> Next restart for normal operation, and then run utlrp.sql to
DOC> recompile any invalid application objects.
DOC>
DOC>#########################################
##############################

DOC>#########################################
##############################
DOC>#
SQL>
SQL> Rem Set errorlogging off
SQL> SET ERRORLOGGING OFF;
SQL>
SQL> Rem
*********************************************************************
SQL> Rem END catupgrd.sql
SQL> Rem
*********************************************************************
[oradev@erpdevasi01 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Sun Jan 17 18:19:37 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1573527552 bytes
Fixed Size
1336764 bytes
Variable Size
402655812 bytes
Database Buffers
1157627904 bytes
Redo Buffers
11907072 bytes
Database mounted.
Database opened.
SQL> select count(*) From all_objects where status='INVALID';
COUNT(*)
---------1345
SQL> @?/rdbms/admin/utlrp.sql
SQL> select count(*) from all_objects where status='INVALID';
COUNT(*)
---------47

xviii) Post Upgrade Step

a) Check component status


SQL>select comp_name,status,version from dba_Registry;
SQL> /
COMP_NAME
---------------------------------------------------------------------------------------------------STATUS
VERSION

----------- -----------------------------Oracle Enterprise Manager


VALID
11.2.0.1.0
OLAP Catalog
VALID
11.2.0.1.0
Spatial
VALID

11.2.0.1.0

Oracle Multimedia
VALID
11.2.0.1.0
Oracle XML Database
VALID
11.2.0.1.0
Oracle Text
VALID
11.2.0.1.0
Oracle Data Mining
VALID
11.2.0.1.0
Oracle Expression Filter
VALID
11.2.0.1.0
Oracle Rule Manager
VALID
11.2.0.1.0
Oracle Workspace Manager
VALID
11.2.0.1.0
Oracle Database Catalog Views
VALID
11.2.0.1.0
Oracle Database Packages and Types
VALID
11.2.0.1.0
JServer JAVA Virtual Machine
VALID
11.2.0.1.0
Oracle XDK
VALID
11.2.0.1.0
Oracle Database Java Packages
VALID
11.2.0.1.0
OLAP Analytic Workspace
INVALID
11.2.0.1.0
Oracle OLAP API

VALID

11.2.0.1.0

17 rows selected.
b) Run catuppst.sql, located in the $ORACLE_HOME/rdbms/admin
directory, to perform upgrade actions that do not require the database
to be in UPGRADE mode:
c) Run dbdiag.sql
d) Start listerner --- lsnrctl start
*******************UPGRADE COMPLETE***********************

You might also like