Tag Archives: upgrade

Determine Oracle RDBMS component upgrade and modification history.

The Oracle RDBMS provides a history of upgrade and modification to database components through the view DBA_REGISTRY_LOG. This information can be used by the DBA to determine times which installation, upgrades, and modifications have been made to various RDBMS components. This article covers the use of the view DBA_REGISTRY_LOG.

1. Logon to your database server with SYSDBA privileges from your remote client.

C:\>sqlplus ljcatt/password5@orcl as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Wed Feb 24 20:51:08 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

2. Execute the following SQL statement: select * from DBA_REGISTRY_LOG;

SQL> column optime format a28
SQL> column namespace format a10
SQL> column comp_id format a10
SQL> column message format a10
SQL> set pagesize 100
SQL> select * from DBA_REGISTRY_LOG order by optime;
OPTIME NAMESPACE COMP_ID OPERATION MESSAGE
—————————- ———- ———- ———– ———-
18-JUL-09 03.13.00.026718 PM SERVER UPGRD_BGN
18-JUL-09 03.47.27.539499 PM SERVER CATPROC INVALID 10.2.0.4.0
18-JUL-09 03.48.35.621297 PM SERVER RDBMS INVALID 10.2.0.4.0
18-JUL-09 04.01.47.151968 PM SERVER JAVAVM VALID 10.2.0.4.0
18-JUL-09 04.04.58.654033 PM SERVER XML VALID 10.2.0.4.0
18-JUL-09 04.05.43.121515 PM SERVER CATJAVA VALID 10.2.0.4.0
18-JUL-09 04.07.27.818615 PM SERVER CONTEXT VALID 10.2.0.4.0
18-JUL-09 04.11.48.629069 PM SERVER XDB VALID 10.2.0.4.0
18-JUL-09 04.13.49.808540 PM SERVER OWM VALID 10.2.0.4.3
18-JUL-09 04.22.02.603685 PM SERVER ORDIM VALID 10.2.0.4.0
18-JUL-09 04.28.32.273345 PM SERVER SDO VALID 10.2.0.4.0
18-JUL-09 04.29.25.682363 PM SERVER WK INVALID 10.2.0.4.0
18-JUL-09 04.35.37.187381 PM SERVER UPGRD_END
18-JUL-09 05.45.01.775983 PM SERVER UTLRP_BGN
18-JUL-09 05.48.54.633250 PM SERVER UTLRP_END
18-JUL-09 07.06.22.748873 PM SERVER UTLRP_BGN
18-JUL-09 07.09.59.268882 PM SERVER UTLRP_END
19-JUL-09 01.16.55.416850 PM SERVER UTLRP_BGN
19-JUL-09 01.17.15.642776 PM SERVER UTLRP_END
13-AUG-09 12.56.24.513219 PM SERVER UTLRP_BGN
13-AUG-09 12.57.04.276009 PM SERVER UTLRP_END
08-SEP-09 01.27.01.558155 PM SERVER UTLRP_BGN
08-SEP-09 01.27.46.036417 PM SERVER UTLRP_END
08-SEP-09 01.30.25.121025 PM SERVER UTLRP_BGN
08-SEP-09 01.31.13.640322 PM SERVER UTLRP_END
08-SEP-09 01.37.39.576965 PM SERVER UTLRP_BGN
08-SEP-09 01.37.58.850834 PM SERVER UTLRP_END
08-SEP-09 01.43.30.395883 PM SERVER UTLRP_BGN
08-SEP-09 01.44.25.124050 PM SERVER UTLRP_END
08-SEP-09 01.50.01.872579 PM SERVER UTLRP_BGN
08-SEP-09 01.50.15.180842 PM SERVER UTLRP_END

31 rows selected.

SQL>

3. The information above can be used to determine dates of upgrades, installations, and recompilation of various ORACLE RDBMS components.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Upgrade of Oracle 9i RDBMS to 10g RDBMS

Oracle provides upgrade paths for most RDBMS versions, however they are not as simple as some would like. I have ran into several Junior to Mid-level DBA’s who appear to have a difficult time grasping the general steps required to perform this task or just want a Senior person present for them to perform sanity checks with. Thus, I have decided to outline the general steps required to perform the upgrade from 9i to 10g.

1. Downloading the following software from www.oracle.com if you do not have the media available:

• Oracle 10.2.0.1 (this is the base release of Oracle 10g R2)
• Oracle 10.2.0.1 Companion CD (if needed)
• Oracle 10.2.0.4 (This is patch set 6810189)
• Latest Oracle CPU Patch

2. Shutdown your current Oracle 9i database system and listener. Do not delete any of the 9i binaries or database objects.

$ sqlplus ” / as sysdba”
SQL> shutdown immediate
SQL> exit
$
$ cd network/admin
$ lsnrctl stop LISTENER

3. Unpack or Unzip (dependent on OS) your 10.2.0.1 database installation. Execute the runInstaller. Note: It is most likely that your OS will be of a higher version, than is supported by this installer. You may have to use the tags “–jreLoc –ignoreSysPrereqs” to bypass the OS support version. Example:

./runInstaller -jreLoc /opt/java1.4/jre -ignoreSysPrereqs

4. At the Welcome to the Oracle Database 10g Installation page, check the Advanced Installation option and press Next.

5. At the Select Installation Type page, select Enterprise Addition and press Next.

6. At the Specify Home Details page, enter OraDb10g for Name and /app/oracle/10.2.0 for the path and press Next.

7. At the Product-Specific Prerequisite Checks page the Installer will verify the system is ready for installation.

8. At the Product-Specific Prerequisite Checks, review any warning received and press Next.

9. At the Upgrade an Existing Database page, select No and press next.

10. At the Select Configuration Options page, select Install Database Software Only and press Next.

11. At the Summary page, press Install.

12. Once the installer request for you to execute shell script root.sh, contact the SA support for your system and have them execute, then click OK.

13. Record the following output in a safe place and click Exit.

The following J2EE Applications have been deployed and are accessible at the
URLs listed below.
iSQL*Plus URL:
http://linux1:5560/isqlplus
iSQL*Plus DBA URL:
http://linux1:5560/isqlplus/dba

14. This completes Installation of 10.2.0.1 software.

15. Install Oracle companion component. (if desired)

16. Upgrade to 10.2.0.4, unzip the Oracle patch set 6810189 and execute the runInstaller utility. NOTE: You may again have to user the –jreLoc and –ignoreSysPrereqs tags. Example

./runInstaller -jreLoc /opt/java1.4/jre -ignoreSysPrereqs

17. At the Welcome page, select Next.

18. At the Specify Home Details page, enter OraDb10g in Name and /app/oracle/10.2.0 in Path and press Next

19. At the Product-Specific Prerequisite Checks page, press Next.

20. At the Oracle Configuration Manager Registration page, press Next.

21. At the Summary page, press Install.

22. Once requested to execute the script: app/oracle/10.2.0/root.sh, contact the SA and have them execute as root, then press OK.

23. At the End of Installation page, record the below information and press Exit.

The iSQL*Plus URL is:
http://linux1:5560/isqlplus

The iSQL*Plus DBA URL is:
http://linux1:5560/isqlplus/dba

24. At the screen ‘Do you really want to exit?’, press Yes.

25. This completes the upgrade to 10.2.0.4

26. Apply latest CPU patch. Logon to Metalink at metalink.oracle.com and download the latest CPU patch for Oracle 10.2.0.4. In this example, we will download CPU Jan 2009 – patch number 7592346

27. Unzip the patch file.

28. Ensure that the ORACLE_HOME parameter is point to 10.2.0.4 install by setting the parameter again.

Linux1:/oracle_software/7592346:>echo $ORACLE_HOME
/app/oracle/10.2.0
Linux1:/oracle_software/7592346:>

29. Edit your .profile file to ensure that OPATCH parameter is pointing at the correct OPatch directory and your PATH parameter is specifying the correct $ORACLE_HOME/bin directory. NOTE: The OPatch utility installed with 10.2.0.1 maybe too old for your CPU patch, see the README in your CPU to determine the correct OPatch version to use. You can navigate to $ORACLE_HOME/OPatch and execute the command “opatch version” to determine you current version.

30. Note: you may have to user the -jre tag to make the patch work.

opatch napply -skip_subset -skip_duplicate -jre /opt/java1.4/jre

or
$ORACLE_HOME/OPatch/opatch napply -skip_subset -skip_duplicate -jre
/opt/java1.4/jre

31. This completes installation of the latest CPU patch.

Post installation Steps

32. Update the .profile file to point to the new Oracle installation and make sure the following environment variables point to the new ORACLE installation.

ORACLE_HOME
PATH
LD_LIBRARY_PATH
SH_LIB_PATH

33. Logout and login to reset your environment variables.

34. Copy the init.ora file from existing 9.2.0.8 $ORACLE_HOME/dbs to 10g $ORACLE_HOME/dbs folder

Linux1:/app/oracle/9.2.0.8.0/dbs:>cp initorcl.ora ../../10.2.0/dbs/.
Linux1:/app/oracle/9.2.0.8.0/dbs:>

35. NOTE: See listing at bottom of this article for all non-supported 9i init parameters which must be removed or commented out.

36. Increase large pool size=200M in init.ora file.

37. Change folders to $ORACLE_HOME/rdbms/admin/. This is the folder where the SQL files for upgrade are stored.

$ cd $ORACLE_HOME/rdbms/admin

38. Start the database in upgrade mode

$>sqlplus / as sysdba
SQL>startup upgrade

39. Create sysaux tablespace

Ex:CREATE TABLESPACE sysaux DATAFILE
‘/orcl/oradata/orcl/data1/sysaux02.dbf’ SIZE 4096M REUSE EXTENT
MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE;

40. Issue unlimited quota for system

ALTER USER SYSTEM QUOTA UNLIMITED ON system;

41. Start the upgrade by running catupgrd.sql

SQL> spool /scripts/upgrade.log
SQL> @catupgrd.sql
Turn off the spooling of script results to the log file:
SQL> SPOOL OFF

Check the spool file and verify that the packages and procedures compiled successfully. You named the spool file earlier in this step; the suggested name was upgrade.log. Correct any problems you find in this file and rerun the appropriate upgrade script if necessary. You can rerun any of the scripts described in this note as many times as necessary.

42. Run utlu102s.sql, specifying the TEXT option:

SQL> @utlu102s.sql TEXT

43. Insure that all temp files from the production system are attached to temporary tablespace in converted database. If not recreate temp files.

Example:
alter tablespace TEMP add tempfile ‘/orcl/oradata/orcl/data1/temp_01.dbf’
size 2048m;

44. Run utlrp.sql to recompile any remaining stored PL/SQL and Java code.

SQL> @utlrp.sql

Verify that all expected packages and classes are valid:

45. If there are still objects which are not valid after running the script run
the following:

spool invalid_post.lst
Select substr(owner,1,12) owner,
substr(object_name,1,30) object,
substr(object_type,1,30) type, status
from dba_objects where status <>‘VALID’;
spool off

46. Copy old listeners.ora and tnsnames.ora from the previous 9.2.0.8 oracle installation and update their ORACLE_HOME references.
• Copy files to new ORACLE_HOME/network/admin folder
cp listener.ora $ORACLE_HOME/network/admin
cp tnsnames.ora $ORACLE_HOME/network/admin
• Change folders to $ORACLE_HOME/network/admin
cd $ORACLE_HOME/network/admin
• Update the newly copied files to point to the new ORACLE_HOME location

47. Restart the database in a normal mode with “startup open”

48. It is a good idea to know rebuild all of your indexes and gather statistics.

49. NOTE: You will not get all of the benefits of Oracle 10g until you set the COMPATIBILITY parameter to a minimum of 10.1

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Appendix A: Initialization Parameters Obsolete in 10g
—————————————————–

ENQUEUE_RESOURCES
DBLINK_ENCRYPT_LOGIN
HASH_JOIN_ENABLED
LOG_PARALLELISM
MAX_ROLLBACK_SEGMENTS
MTS_CIRCUITS
MTS_DISPATCHERS
MTS_LISTENER_ADDRESS
MTS_MAX_DISPATCHERS
MTS_MAX_SERVERS
MTS_MULTIPLE_LISTENERS
MTS_SERVERS
MTS_SERVICE
MTS_SESSIONS
OPTIMIZER_MAX_PERMUTATIONS
ORACLE_TRACE_COLLECTION_NAME
ORACLE_TRACE_COLLECTION_PATH
ORACLE_TRACE_COLLECTION_SIZE
ORACLE_TRACE_ENABLE
ORACLE_TRACE_FACILITY_NAME
ORACLE_TRACE_FACILITY_PATH
PARTITION_VIEW_ENABLED
PLSQL_NATIVE_C_COMPILER
PLSQL_NATIVE_LINKER
PLSQL_NATIVE_MAKE_FILE_NAME
PLSQL_NATIVE_MAKE_UTILITY
ROW_LOCKING
SERIALIZABLE
TRANSACTION_AUDITING
UNDO_SUPPRESS_ERRORS

Appendix B: Initialization Parameters Deprecated in 10g
——————————————————-

LOGMNR_MAX_PERSISTENT_SESSIONS
MAX_COMMIT_PROPAGATION_DELAY
REMOTE_ARCHIVE_ENABLE
SERIAL_REUSE
SQL_TRACE
BUFFER_POOL_KEEP (replaced by DB_KEEP_CACHE_SIZE)
BUFFER_POOL_RECYCLE (replaced by DB_RECYCLE_CACHE_SIZE)
GLOBAL_CONTEXT_POOL_SIZE
LOCK_NAME_SPACE
LOG_ARCHIVE_START
MAX_ENABLED_ROLES
PARALLEL_AUTOMATIC_TUNING
PLSQL_COMPILER_FLAGS (replaced by PLSQL_CODE_TYPE and PLSQL_DEBUG)

Larry Catt
oracle@allcompute.com
www.allcompute.com