nitiserver[oracle]_test> mkdir -p /nitiserver/dba01/oracle/test/upgrade11gR2
nitiserver[oracle]_test> cp /nitiserver/testdb/oracle/product/11.2.0.2/rdbms/admin/utlu112i.sql $ORACLE_HOME/test/upgrade11gR2
nitiserver[oracle]_test> cd $ORACLE_HOME/test/upgrade11gR2
nitiserver[oracle]_test> pwd
/nitiserver/dba01/oracle/test/upgrade11gR2
nitiserver[oracle]_test> ls -ltr
total 204
-rw-r--r-- 1 oracle dba 204205 Apr 15 03:43 utlu112i.sql
nitiserver[oracle]_test> sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 15 03:43:48 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining Scoring Engine and Real Application Testing options
SQL> spool upgrade_info.log
SQL> @utlu112i.sql
Oracle Database 11.2 Pre-Upgrade Information Tool 04-15-2012 03:44:22
Script Version: 11.2.0.2.0 Build: 001
.
**********************************************************************
Database:
**********************************************************************
--> name: test
--> version: 10.2.0.4.0
--> compatible: 10.2.0.2.0
--> blocksize: 8192
--> platform: Linux IA (32-bit)
--> timezone file: V4
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 389 MB
--> UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 211 MB
--> TEMP tablespace is adequate for the upgrade.
.... minimum required size: 61 MB
--> SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 318 MB
.
**********************************************************************
Flashback: OFF
**********************************************************************
**********************************************************************
Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]
Note: Pre-upgrade tool was run on a lower version 32-bit database.
**********************************************************************
--> If Target Oracle is 32-Bit, refer here for Update Parameters:
WARNING: --> "shared_pool_size" needs to be increased to at least 236 MB
.
--> If Target Oracle is 64-Bit, refer here for Update Parameters:
WARNING: --> "shared_pool_size" needs to be increased to at least 472 MB
.
**********************************************************************
Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
-- No renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
--> background_dump_dest 11.1 DEPRECATED replaced by "diagnostic_dest"
--> user_dump_dest 11.1 DEPRECATED 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
--> OLAP Analytic Workspace [upgrade] VALID
--> Oracle OLAP API [upgrade] VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: --> Database is using a timezone file older than version 14.
.... After the release migration, it is recommended that DBMS_DST package
.... be used to upgrade the 10.2.0.4.0 database timezone version
.... to the latest version which comes with the new release.
WARNING: --> Database contains INVALID objects prior to upgrade.
.... The list of invalid SYS/SYSTEM objects was written to
.... registry$sys_inv_objs.
.... The list of non-SYS/SYSTEM objects was written to
.... registry$nonsys_inv_objs.
.... Use utluiobj.sql after the upgrade to identify any new invalid
.... objects due to the upgrade.
.... USER testBA has 2 INVALID objects.
.... USER SYSTEM has 11 INVALID objects.
.... USER testBAPRD has 27 INVALID objects.
.... USER SYS has 2 INVALID objects.
.
**********************************************************************
Recommendations
**********************************************************************
Oracle recommends gathering dictionary statistics prior to
upgrading the database.
To gather dictionary statistics execute the following command
while connected as SYSDBA:
EXECUTE dbms_stats.gather_dictionary_stats;
**********************************************************************
Oracle recommends reviewing any defined events prior to upgrading.
To view existing non-default events execute the following commands
while connected AS SYSDBA:
Events:
SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2
WHERE UPPER(name) ='EVENT' AND isdefault='FALSE'
Trace Events:
SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2
WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'
Changes will need to be made in the init.ora or spfile.
**********************************************************************
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
SQL> SHUTDOWN IMMEDIATE
#############################################################################
cd /nitiserver/oracle/bin
cp test_11202 test
nitiserver[oracle]_test> vi /etc/oratab
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#test:/nitiserver/testdb/oracle/product/test_10.2.0.4:N
test:/nitiserver/testdb/oracle/product/11.2.0.2:N
######################################################################################
nitiserver[oracle]_test> cat /etc/oraInst.loc
#inventory_loc=/nitiserver/testdb/oracle/product/test_10.2.0.4/oraInventory
inventory_loc=/nitiserver/testdb/oracle/product/11.2.0.2/oraInventory
inst_group=dba
############################################################################################
Change the init paramete
diagnostic_dest=/nitiserver/dump01/oracle/test/bdump
diagnostic_dest=/nitiserver/dump01/oracle/test/udump
core_dump_dest=/nitiserver/dump01/oracle/test/cdump
compatible=11.2.0.2.0
shared_pool_size=263402291
##############################################################################################
nitiserver[oracle]_test> ln -s $SID_HOME/pfile/init$ORACLE_SID.ora $ORACLE_HOME/dbs/init$ORACLE_SID.ora
nitiserver[oracle]_test> ls -ltr $ORACLE_HOME/dbs/
total 4
-rw-r--r-- 1 oracle dba 2851 May 15 2009 init.ora
lrwxrwxrwx 1 oracle dba 50 Apr 15 04:37 inittest.ora -> /nitiserver/dba01/oracle/test/pfile/inittest.ora
nitiserver[oracle]_test> cd $SID_HOME/upgrade11gR2
nitiserver[oracle]_test> pwd
/nitiserver/dba01/oracle/test/upgrade11gR2
SQL> STARTUP UPGRADE;
ORA-00371: not enough shared pool memory, should be atleast 263402291 bytes
#################################################################################################
[oracle@nitiserver ~]$ sqlplus
SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 06:36:42 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter user-name: / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !echo $ORACLE_SID
test
SQL> STARTUP UPGRADE;
ORACLE instance started.
Total System Global Area 481275904 bytes
Fixed Size 1344952 bytes
Variable Size 339741256 bytes
Database Buffers 134217728 bytes
Redo Buffers 5971968 bytes
Database mounted.
Database opened.
SQL> SET SERVEROUTPUT ON
SQL> purge dba_recyclebin;
DBA Recyclebin purged.
SQL> TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;
Table truncated.
SQL> TRUNCATE TABLE SYS.DST$AFFECTED_TABLES;
Table truncated.
SQL> TRUNCATE TABLE SYS.DST$ERROR_TABLE;
Table truncated.
SQL> EXEC DBMS_DST.BEGIN_UPGRADE(11);
An upgrade window has been successfully started.
PL/SQL procedure successfully completed.
SQL> column PROPERTY_NAME format a30
column VALUE format a30
SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
SQL> SQL> 2 3 4
PROPERTY_NAME VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION 11
DST_SECONDARY_TT_VERSION 4
DST_UPGRADE_STATE UPGRADE
SQL> EXEC DBMS_DST.BEGIN_UPGRADE(14);
BEGIN DBMS_DST.BEGIN_UPGRADE(14); END;
*
ERROR at line 1:
ORA-56920: a prepare or upgrade window or an on-demand or datapump-job loading
of a secondary time zone data file is in an active state
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DST", line 1158
ORA-06512: at line 1
SQL> SELECT OWNER, TABLE_NAME, UPGRADE_IN_PROGRESS
FROM ALL_TSTZ_TABLES
WHERE UPGRADE_IN_PROGRESS='YES';
2 3
no rows selected
SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP
ORACLE instance started.
Total System Global Area 481275904 bytes
Fixed Size 1344952 bytes
Variable Size 339741256 bytes
Database Buffers 134217728 bytes
Redo Buffers 5971968 bytes
Database mounted.
Database opened.
SQL> set serveroutput on
VAR numfail number
BEGIN
SQL> SQL> 2 DBMS_DST.UPGRADE_DATABASE(:numfail,
3 parallel => TRUE,
4 log_errors => TRUE,
5 log_errors_table => 'SYS.DST$ERROR_TABLE',
6 log_triggers_table => 'SYS.DST$TRIGGER_TABLE',
7 error_on_overlap_time => FALSE,
8 error_on_nonexisting_time => FALSE);
9 DBMS_OUTPUT.PUT_LINE('Failures:'|| :numfail);
10 END;
11 /
Failures:0
PL/SQL procedure successfully completed.
SQL> VAR fail number
BEGIN
DBMS_DST.END_UPGRADE(:fail);
DBMS_OUTPUT.PUT_LINE('Failures:'|| :fail);
END;
SQL> 2 3 4 5
6 ;
7
8 /
;
*
ERROR at line 6:
ORA-06550: line 6, column 1:
PLS-00103: Encountered the symbol ";"
SQL> VAR fail number
BEGIN
DBMS_DST.END_UPGRADE(:fail);
DBMS_OUTPUT.PUT_LINE('Failures:'|| :fail);
END;
SQL> 2 3 4 5 /
An upgrade window has been successfully ended.
Failures:0
PL/SQL procedure successfully completed.
SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
SELECT * FROM v$timezone_file;
2 3 4
PROPERTY_NAME VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION 11
DST_SECONDARY_TT_VERSION 0
DST_UPGRADE_STATE NONE
SQL> SQL>
FILENAME VERSION
-------------------- ----------
timezlrg_11.dat 11
SQL> EXEC DBMS_DST.BEGIN_UPGRADE(14);
BEGIN DBMS_DST.BEGIN_UPGRADE(14); END;
*
ERROR at line 1:
ORA-56926: database must be in UPGRADE mode in order to start an upgrade window
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DST", line 1195
ORA-06512: at line 1
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> SQL> startup
ORACLE instance started.
Total System Global Area 481275904 bytes
Fixed Size 1344952 bytes
Variable Size 339741256 bytes
Database Buffers 134217728 bytes
Redo Buffers 5971968 bytes
Database mounted.
Database opened.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> SQL> startup
ORACLE instance started.
Total System Global Area 481275904 bytes
Fixed Size 1344952 bytes
Variable Size 339741256 bytes
Database Buffers 134217728 bytes
Redo Buffers 5971968 bytes
Database mounted.
Database opened.
SQL> SELECT comp_name, version, status FROM dba_registry;
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ -----------
Oracle Database Catalog Views
11.2.0.2.0 VALID
Oracle Database Packages and Types
11.2.0.2.0 VALID
OLAP Analytic Workspace
11.2.0.2.0 VALID
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ -----------
Oracle OLAP API
11.2.0.2.0 VALID
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP UPGRADE;
ORACLE instance started.
Total System Global Area 481275904 bytes
Fixed Size 1344952 bytes
Variable Size 339741256 bytes
Database Buffers 134217728 bytes
Redo Buffers 5971968 bytes
Database mounted.
Database opened.
SQL> purge dba_recyclebin;
DBA Recyclebin purged.
SQL> TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;
Table truncated.
SQL> TRUNCATE TABLE SYS.DST$AFFECTED_TABLES;
Table truncated.
SQL> TRUNCATE TABLE SYS.DST$ERROR_TABLE;
Table truncated.
SQL> EXEC DBMS_DST.BEGIN_UPGRADE(14);
PL/SQL procedure successfully completed.
SQL> column PROPERTY_NAME format a30
column VALUE format a30
SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
SQL> SQL> 2 3 4
PROPERTY_NAME VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION 14
DST_SECONDARY_TT_VERSION 11
DST_UPGRADE_STATE UPGRADE
SQL> SQL> SELECT OWNER, TABLE_NAME, UPGRADE_IN_PROGRESS
FROM ALL_TSTZ_TABLES
WHERE UPGRADE_IN_PROGRESS='YES';
2 3
no rows selected
SQL> SHUTDOWN IMMEDIATE
startup
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> ORACLE instance started.
Total System Global Area 481275904 bytes
Fixed Size 1344952 bytes
Variable Size 339741256 bytes
Database Buffers 134217728 bytes
Redo Buffers 5971968 bytes
Database mounted.
Database opened.
SQL> set serveroutput on
VAR numfail number
BEGIN
SQL> SQL> 2 DBMS_DST.UPGRADE_DATABASE(:numfail,
3 parallel => TRUE,
4 log_errors => TRUE,
5 log_errors_table => 'SYS.DST$ERROR_TABLE',
6 log_triggers_table => 'SYS.DST$TRIGGER_TABLE',
7 error_on_overlap_time => FALSE,
8 error_on_nonexisting_time => FALSE);
9 DBMS_OUTPUT.PUT_LINE('Failures:'|| :numfail);
10 END;
11 /
Failures:0
PL/SQL procedure successfully completed.
SQL> VAR fail number
BEGIN
DBMS_DST.END_UPGRADE(:fail);
DBMS_OUTPUT.PUT_LINE('Failures:'|| :fail);
END;
/
SQL> 2 3 4 5 An upgrade window has been successfully ended.
Failures:0
PL/SQL procedure successfully completed.
SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;
2 3 4
PROPERTY_NAME VALUE
------------------------------ ------------------------------
DST_PRIMARY_TT_VERSION 14
DST_SECONDARY_TT_VERSION 0
DST_UPGRADE_STATE NONE
SQL> SQL> SELECT * FROM v$timezone_file;
FILENAME VERSION
-------------------- ----------
timezlrg_14.dat 14
#################################################################################################
COMP_NAME VERSION STATUS
--------------------------------------------- ------------------------------ -----------
Oracle Database Catalog Views 11.2.0.2.0 VALID
Oracle Database Packages and Types 11.2.0.2.0 VALID
OLAP Analytic Workspace 11.2.0.2.0 VALID
Oracle OLAP API 11.2.0.2.0 VALID
###################################################################################################
LSNRCTL> start LSTNtest
Starting /nitiserver/testdb/oracle/product/11.2.0.2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is /nitiserver/testdb/oracle/product/11.2.0.2/network/admin/test_nitiserver/listener.ora
Log messages written to /nitiserver/testdb/oracle/product/11.2.0.2/log/diag/tnslsnr/nitiserver/lstntest/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=nitiserver)(PORT=1599)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=nitiserver)(PORT=1599)))
STATUS of the LISTENER
------------------------
Alias LSTNtest
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 15-APR-2012 05:37:37
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /nitiserver/testdb/oracle/product/11.2.0.2/network/admin/test_nitiserver/listener.ora
Listener Log File /nitiserver/testdb/oracle/product/11.2.0.2/log/diag/tnslsnr/nitiserver/lstntest/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=nitiserver)(PORT=1599)))
Services Summary...
Service "test." has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
########################################################################################################
[oracle@nitiserver test_nitiserver]$ tnsping test
TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 15-APR-2012 05:38:30
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = ( ADDRESS = (PROTOCOL = TCP) ( HOST = nitiserver)(PORT = 1599)) ( CONNECT_DATA = ( SID = test)))
OK (0 msec)
############################################################################################