How to upgrade Oracle 10g to 11g R2 on Solaris 10 – Part 3/3
12. Shutdown Oracle 10g.
-bash-3.00$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 – Production on Tue Jan 10 16:34:41 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
13. Change ORACLE_HOME and ORACLE_SID in .profile file and re-login for changes take effect.
Now, ORACLE_HOME points Oracle 11g home directory and ORACLE_SID is set for Oracle 11g SID.
14. Now, lets startup database with upgrade option
-bash-3.00$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 10 16:38:50 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup upgrade
ORACLE instance started.
Total System Global Area 5062303744 bytes
Fixed Size 2156816 bytes
Variable Size 922752752 bytes
Database Buffers 4127195136 bytes
Redo Buffers 10199040 bytes
Database mounted.
Database opened.
SQL>
15.Find following line in catupstr.sql under /u01/app/oracle/product/11.2.0/db_1/rdbms/admin and change it from 10.2.0.1 to 10.2.0.2
BEGIN
– For 11.2, direct uppgrades are supported from 9.2.0.8, 10.1.0.5,
– 10.2.0.2 and above, and 11.1.0.6 and above
–
SELECT version INTO p_version FROM registry$ where cid=’CATPROC’;
IF substr(p_version,1,7) = ’9.2.0.8′ THEN
RETURN ’0902000′;
ELSIF substr(p_version,1,8) = ’10.1.0.5′ THEN
RETURN ’1001000′;
ELSIF substr(p_version,1,6) = ’10.2.0′ AND
substr(p_version,1,8) != ’10.2.0.1′ THEN
RETURN ’1002000′;
ELSIF substr(p_version,1,6) = ’11.1.0′ THEN
RETURN ’1101000′;
ELSIF substr(p_version,1,6) = ’11.2.0′ THEN — current version
SELECT version INTO server_version FROM v$instance;
IF substr(p_version,1,8) != substr(server_version,1,8) THEN — run c1101000
RETURN ’1101000′;
ELSE — version is the same as instance, so rerun the previous upgrade
– rerun upgrade of previous release
EXECUTE IMMEDIATE
16. Upgrade all tables, schemas etc… It will take hours to upgrade depending on HW and number of invalid object in database, not size of database.
SQL>@/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catupgrd.sql
17. After all, database automatically will be shutdown.
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 *********************************************************************
18. Check alert logs under “/u01/app/oracle/diag/rdbms/SID/SID/trace/alert_[ORACLE_SID].log”.
19. Startup database
-bash-3.00$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 11 07:57:44 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 5062303744 bytes
Fixed Size 2156816 bytes
Variable Size 922752752 bytes
Database Buffers 4127195136 bytes
Redo Buffers 10199040 bytes
Database mounted.
Database opened.
SQL>
20. Check all database components are VALID.
-bash-3.00$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 11 08:06:39 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning and OLAP options
SQL> @/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlu112s.sql
.
Oracle Database 11.2 Post-Upgrade Status Tool 01-11-2012 08:07:19
.
Component Status Version HH:MM:SS
.
Oracle Server
. VALID 11.2.0.1.0 00:59:09
JServer JAVA Virtual Machine
. VALID 11.2.0.1.0 00:28:16
Oracle Workspace Manager
. VALID 11.2.0.1.0 00:02:42
OLAP Analytic Workspace
. VALID 11.2.0.1.0 00:02:00
OLAP Catalog
. VALID 11.2.0.1.0 00:04:29
Oracle OLAP API
. VALID 11.2.0.1.0 00:02:07
Oracle Enterprise Manager
. VALID 11.2.0.1.0 00:38:44
Oracle XDK
. VALID 11.2.0.1.0 00:09:19
Oracle XML Database
. ORA-04043: object XDB_DATASTORE_PROC does not exist
. ORA-04043: object XDB_DATASTORE_PROC does not exist
. VALID 11.2.0.1.0 00:15:41
Oracle Database Java Packages
. VALID 11.2.0.1.0 00:01:09
Oracle Expression Filter
. VALID 11.2.0.1.0 00:00:49
Oracle Rules Manager
. VALID 11.2.0.1.0 00:00:43
Gathering Statistics
. 00:19:48
Total Upgrade Time: 03:05:05
PL/SQL procedure successfully completed.
21. Migrate the Baseline data on a pre-11g database to the 11g database.
SQL> @/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catuppst.sql
22. Compile invalid objects.
SQL> @/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlrp.sql
….
COMP_TIMESTAMP UTLRP_END 2012-01-11 08:19:11
DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
——————-
0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
—————————
0
23. Check INVALID objects
SQL> select count(*) from dba_objects where status like ‘INVALID’;
COUNT(*)
———-
0
24. Check Database components, versions and status.
SQL> select comp_name,version, status from dba_registry;
COMP_NAME
——————————————————————————–
VERSION STATUS
—————————— ——————————————–
Oracle Enterprise Manager
11.2.0.1.0 VALID
OLAP Catalog
11.2.0.1.0 VALID
Oracle XML Database
11.2.0.1.0 VALID
COMP_NAME
——————————————————————————–
VERSION STATUS
—————————— ——————————————–
Oracle Expression Filter
11.2.0.1.0 VALID
Oracle Rules Manager
11.2.0.1.0 VALID
Oracle Workspace Manager
11.2.0.1.0 VALID
COMP_NAME
——————————————————————————–
VERSION STATUS
—————————— ——————————————–
Oracle Database Catalog Views
11.2.0.1.0 VALID
Oracle Database Packages and Types
11.2.0.1.0 VALID
JServer JAVA Virtual Machine
11.2.0.1.0 VALID
COMP_NAME
——————————————————————————–
VERSION STATUS
—————————— ——————————————–
Oracle XDK
11.2.0.1.0 VALID
Oracle Database Java Packages
11.2.0.1.0 VALID
OLAP Analytic Workspace
11.2.0.1.0 VALID
COMP_NAME
——————————————————————————–
VERSION STATUS
—————————— ——————————————–
Oracle OLAP API
11.2.0.1.0 VALID
13 rows selected.














