5 Upgrading Applications After Upgrading Oracle Database

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:

5.1 Overview of Upgrading Applications on a New Oracle Database Release

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:

5.2 Compatibility Issues for Applications on Different Releases of Oracle Database

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:

5.3 Upgrading Precompiler and OCI Applications in Oracle Database

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.

5.4 Software Upgrades and Client and Server Configurations for Oracle Database

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.

5.4.1 Types of Software Upgrades for Oracle Database Client and Server Software

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.

5.4.1.1 Oracle Database Major Release Upgrade

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.

5.4.1.2 Oracle Database Maintenance Release Upgrade

The upgrade changes the second digit of the release number. For example, upgrading from Oracle Database 11g Release 1 (11.1) to Oracle Database 11g Release 2 (11.2) is a database maintenance release upgrade.

5.4.2 Possible Client and Server Configurations for Oracle Database

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:

5.4.2.1 Oracle Database Client and Server on Different Computers

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.

5.4.2.2 Oracle Database Client and Server in Different Oracle Locations on the Same Computer

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.

5.4.2.3 Oracle Database Client and Server in the Same Oracle Location

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 environments

5.5 Compatibility Rules for Applications When Upgrading Oracle Database Client or Server Software

Compatibility 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:

5.5.1 Rules for Upgrading Oracle Database Server Software

Different rules apply when you upgrade Oracle Database server software depending on your database environment.

5.5.1.1 If You Do Not Change the Client Environment, Then You Are Not Required to Relink.

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.

5.5.1.2 Applications Can Run Against Newer or Older Oracle Database Server Releases

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.

5.5.2 Upgrading the Oracle Database Client Software

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.

5.5.2.1 Applications Can Be Linked with Newer Libraries

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.

5.5.2.2 Statically Linked Applications Must Always Be Relinked

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.

5.5.2.3 Relinking Dynamically Linked Applications

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.

5.6 Upgrading Options for Oracle Precompiler and OCI Applications

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.

5.6.1 Option 1: Leave the Application Unchanged

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.

5.6.2 Option 2: Precompile or Compile the Application Using the New Software

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.

5.6.3 Option 3: Change the Application Code to Use New Oracle Database Features

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:

5.6.3.1 Changing Precompiler Applications

Complete the following steps to change your precompiler application to use features of Oracle Database 12c:

  1. 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.

  2. Precompile the application using the Oracle precompiler.

  3. Compile the application.

  4. Relink the application with the run-time library of the new Oracle Database 12c, SQLLIB, which is included with the precompiler.

5.6.3.2 Changing OCI Applications

Complete the following steps to change your OCI application to use features of Oracle Database 12c:

  1. Incorporate OCI calls of the new Oracle Database 12c into the existing application.

  2. Compile the application.

  3. Relink the application with the run-time library of the new Oracle Database 12c.

5.7 Upgrading SQL*Plus Scripts and PL/SQL after Upgrading Oracle Database

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.

5.7.1 Evaluation of Numeric Literals

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:

5.8 About Upgrading Oracle Forms or Oracle Developer Applications

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.