Many new features and enhancements are available after upgrading to a new release of Oracle Database. To take full advantage of the new features, you must upgrade applications running in the new release.
This chapter contains the following topics:
Overview of Upgrading Applications on a New Oracle Database Release
Upgrading Precompiler and OCI Applications in Oracle Database
Upgrading SQL*Plus Scripts and PL/SQL after Upgrading Oracle Database
About Upgrading Oracle Forms or Oracle Developer Applications
Existing applications running in a new release of Oracle Database function the same as they did in earlier releases and achieve the same, or enhanced, performance. You are not required to modify existing applications that do not use features available in the new Oracle Database release.
Many new features and enhancements are available after upgrading to the new Oracle Database release. Some of these features provide added features and functions, while others provide improved performance. Before you upgrade your applications, you should review these new features to decide which ones you want to use.
See Also:
Oracle Database New Features Guide for information about the new features available in Oracle Database 12c
The Oracle Technology Network (OTN) at http://www.oracle.com/technetwork/indexes/documentation/
for information about using individual Oracle Database 12c database products or options
There might be compatibility issues between different releases of Oracle Database that could affect your applications. These compatibility issues result from differences in Oracle Database in various releases. Also, in each new release of Oracle Database, new Oracle reserved words might be added, changes might be made to initialization parameters, and changes might be made to the data dictionary.
When you upgrade your Oracle Database software to a new release, ensure that your applications do not use any Oracle reserved words, that your applications are compatible with the initialization parameters of the database, and that your applications are compatible with the data dictionary of the database. Finally, a new release of Oracle Database software might require certain operating system releases or the application of certain patchsets.
See Also:
Appendix A, "Changes for Earlier Releases of Oracle Database" for information about initialization parameter changes and data dictionary changes
Oracle Database SQL Language Reference for a complete list of Oracle reserved words
Oracle Database Installation Guide for your operating system-specific Oracle documentation for information about operating system requirements
The upgrade path is very similar for precompiler and Oracle Call Interface (OCI) applications.
Create a test environment before you upgrade your production environment.
Include your upgraded application and the new Oracle Database software in your test environment.
Ensure that your test environment provides a realistic test of your application.
To understand your options for upgrading precompiler and Oracle Call Interface (OCI) applications, you first must understand the type of software upgrade that you are performing and your client and server configurations.
Types of Software Upgrades for Oracle Database Client and Server Software
Possible Client and Server Configurations for Oracle Database
Two types of upgrades are possible for Oracle Database client and server software: a major release of Oracle Database and maintenance release for Oracle Database.
The upgrade changes the first digit of the release number. For example, upgrading from Oracle Database 11g to Oracle Database 12c is a major database release upgrade.
Your precompiler and OCI applications run on the client in a client/server environment, where the Oracle Database server is the server. You can use one or more client/server configurations in your environment as follows:
Oracle Database Client and Server in Different Oracle Locations on the Same Computer
Oracle Database Client and Server in the Same Oracle Location
The client software and the server software are on different computers, and they are connected through a network. The client and server environments are separate.
The client software and the server software are on the same computer, but they are installed in different Oracle home directories. Again, the client and server environments are separate.
The client software and server software are installed in the same Oracle home on the same computer. In this case, any upgrade of the server software is also an upgrade of the client software.
See Also:
Oracle Database Concepts for more information about client/server environmentsCompatibility rules apply when you upgrade Oracle Database client or server software. The rules are based on the type of software upgrade you are performing and the type of client/server configuration.
The following sections contain compatibility rules depending on the type of upgrade:
Note:
This section uses the terms introduced in "Software Upgrades and Client and Server Configurations for Oracle Database".Different rules apply when you upgrade Oracle Database server software depending on your database environment.
If You Do Not Change the Client Environment, Then You Are Not Required to Relink.
Applications Can Run Against Newer or Older Oracle Database Server Releases
If your client and server are on different computers or are in different Oracle home directories on the same computer, and you upgrade the Oracle Database server software without changing the client software, then you are not required to precompile, compile, or relink your applications. In these cases, the client software is separate from the server software and continues to function against the server.
However, if your applications are using the same Oracle home as the Oracle Database server, then your server upgrade also upgrades your client software, and you must follow the rules in "Upgrading the Oracle Database Client Software".
Note:
It is possible to upgrade the Oracle Database server software but not install the new precompiler or OCI client software when you are using the same Oracle home for both. In this case, the client software is not upgraded. However, such a configuration is not recommended.When you run a precompiler or OCI application against a database server, Oracle recommends that the release of the database server software be equal to or later than the client software release, but this configuration is not strictly required. For example, if your client software is Oracle9i Release 2 (9.2.0.8), then Oracle recommends that your server software be Oracle9i Release 2 (9.2.0.8) or later to run a precompiler application on the client against the server.
Oracle recommends that you upgrade your client software to match the current server software. For example, if you upgrade your server to Oracle Database 12c, then Oracle recommends upgrading the client software to Oracle Database 12c as well. Keeping the server and client software at the same release number ensures the maximum stability for your applications. In addition, the latest Oracle Database client software might provide added features and performance enhancements that were not available with previous releases.
Depending on how your applications are linked, different rules apply when you upgrade the Oracle Database client software.
The code generated by precompiler applications can be linked with a release of the client library that equals or is later than the server release.
OCI applications can be linked with a release of the OCI run-time library that equals or is later than the release of the OCI library with which the application was developed.
Statically linked OCI applications must be re-linked for both major and minor releases, because the statically linked Oracle client-side library code may be incompatible with the error messages in the upgraded ORACLE_HOME
. For example, if an error message was updated with additional parameters, then it becomes incompatible with the statically-linked code.
Dynamically linked OCI applications from Oracle Database 10g Release 1 (10.1) and later releases are upward compatible with the current release. That is, the Oracle client-side dynamic library is upward compatible with the previous version of the library. Oracle Universal Installer creates a symbolic link for the previous version of the library that resolves to the current version. Therefore, an application that is dynamically linked with the previous version of the Oracle client-side dynamic library does not require relinking to operate with the current version of the Oracle client-side library.
Note:
If the application is linked with a run-time library search path (such as-rpath
on Linux), then the application may still run with the version of the Oracle client-side library with which it is linked. To run with the current version of the Oracle client-side library, it must be relinked.
If the application is linked with the deferred option (for example, statically-linked application), then it must be relinked.
If the application is from a release earlier than Oracle Database 10g Release 1 (10.1), then it must be relinked.
Oracle provides several options for upgrading your precompiler and Oracle Call Interface (OCI) applications running on a new release of Oracle Database.
The upgrade options are listed in order of increasing difficulty and increasing potential benefits. That is, Option 1 is the least difficult option, but it offers the least potential benefits, while Option 3 is the most difficult option, but it offers the most potential benefits.
Option 2: Precompile or Compile the Application Using the New Software
Option 3: Change the Application Code to Use New Oracle Database Features
Leave the application and its environment unchanged. Do not relink, precompile, or compile the application, and do not change the application code. The application continues to work against the new Oracle Database 12c. This option requires that the Oracle home environment of the application is not upgraded. You can leave the application unchanged, and it continues to work with the Oracle Database 12c server. The major advantage to this option is that it is simple and easy. In addition, this option requires the least amount of administration, because you are not required to upgrade any of your client computers. If you have a large number of client computers, then avoiding the administrative costs of upgrading all of them can become very important.
The major disadvantage to this option is that your application cannot use the features that are available in the new release of Oracle Database. In addition, your application cannot leverage all the possible performance benefits of Oracle Database 12c.
Precompile or compile and then relink the application using the new release of Oracle Database. Application code must be changed if any APIs are deprecated or changed. When upgrading to the new release of Oracle Database software, you must precompile or compile the application with the new software after making necessary code changes to account for APIs that are deprecated or changed.
This option requires that you install the new Oracle Database client software on each client computer. You are required to precompile or compile, and relink your application only one time, regardless of the number of clients you have.
By recompiling, you perform a syntax check of your application code. Some problems in the application code that were not detected by previous releases of the Oracle software might emerge when you precompile or compile with the new Oracle software. Therefore, precompiling and compiling with the new software often helps you detect and correct problems in the application code that might have gone unnoticed before.
Also, recompiling affords maximum stability for your application, because you are sure that it works with the new Oracle software. Further, your environment is ready for new development using the latest tools and features available. In addition, you might benefit from performance improvements that are available with the new Oracle software only after you recompile and relink.
Change the application code to use new features in Oracle Database 12c. Then, precompile or compile and then relink the code. You can make code changes to your application to take advantage of new Oracle Database features. This option is the most difficult, but it can provide the most potential benefits. You gain all of the advantages described in "Option 2: Precompile or Compile the Application Using the New Software". In addition, you also benefit from changes to your application that might leverage performance and scalability benefits available with the new release of Oracle Database. Further, you can add new features to your application that are available only with the new release.
Become familiar with the features of Oracle Database 12c by reading Oracle Database New Features Guide. Also, consult the Oracle documentation for your development environment so that you understand how to implement the features you want to use. For the precompilers, see Pro*C/C++ Programmer's Guide and Pro*COBOL Programmer's Guide. For OCI, see Oracle Call Interface Programmer's Guide.
When you have decided on the new features to use, change the code of your application to use these features. Follow the appropriate instructions in the following sections based on your development environment:
Complete the following steps to change your precompiler application to use features of Oracle Database 12c:
If you want to take advantage of new features in Oracle Database 12c, then incorporate the code for these new features into the existing application.
Precompile the application using the Oracle precompiler.
Compile the application.
Relink the application with the run-time library of the new Oracle Database 12c, SQLLIB
, which is included with the precompiler.
Complete the following steps to change your OCI application to use features of Oracle Database 12c:
Incorporate OCI calls of the new Oracle Database 12c into the existing application.
Compile the application.
Relink the application with the run-time library of the new Oracle Database 12c.
To use features and functions of the new Oracle Database release, change existing SQL scripts to use the syntax of the new Oracle Database release. Existing SQL scripts run unchanged on the new Oracle Database release, and require no modification, if they do not use features and functions of the new Oracle Database release.
Improved error checking in the new Oracle Database release might now identify errors at compile time rather than at run time.
Evaluation of numeric literals has changed such that at least one constant in a numeric computation with literals must be a decimal specified to the 10th place. This is because Oracle Database releases later than Oracle Database 10g Release 1 (10.1) use INTEGER
arithmetic (approximately nine significant digits) for some expressions whereas Oracle9i Release 2 (9.2) used NUMBER
arithmetic (approximately 38 significant digits). Therefore, if you are dealing with results of greater than nine (9) significant digits, then one literal should be in decimal format to prevent numeric overflow errors. For example, in Oracle Database 10g, the computation of v1
in the following example causes a numeric overflow error:
DECLARE v1 NUMBER(38); BEGIN v1 := 256*256*256*256; DBMS_OUTPUT.PUT_LINE(v1); END; /
The solution to the error is to specify one numeric literal as a decimal (256.0), as follows:
DECLARE v1 NUMBER(38); BEGIN v1 := 256*256*256*256.0; DBMS_OUTPUT.PUT_LINE(v1); END; /
See Also:
The "What's New in SQL*Plus" section in the SQL*Plus User's Guide and Reference to learn about new features in SQL*Plus
Oracle Database SQL Language Reference for more information about upgrading SQL scripts
Forms applications run the same on Oracle9i, Oracle Database 10g, and Oracle Database 11g. In Oracle Database 12c, the title of Oracle Database Development Guide has been changed to Oracle Database Advanced Application Developer's Guide.
Review the new features and changes described for developing applications. Also, review the new features described in Oracle Database New Features Guide to determine whether any of the features of Oracle Database 12c would be beneficial to your applications or might otherwise affect them.