Book Image

Oracle APEX Best Practices

Book Image

Oracle APEX Best Practices

Overview of this book

Have you ever wanted to create real-world database applications? In this book you're not only getting APEX best practices, but will also take into account the total environment of an APEX application and benefit from it."Oracle APEX Best Practices" will guide you through the development of real-world applications. It will give you a broader view of APEX. The various aspects include setting up APEX environment, testing and debugging, security, and getting the best out of SQL and PL/SQL.In six distinct chapters you will learn about different features of Oracle APEX as well as SQL and PL/SQL.Do you maximize the capabilities of Oracle APEX? Do you use all the power that SQL and PL/SQL have to offer? Do you want to learn how to build a secure, fully functional application? Then this is the book you'll need. "Oracle APEX: Best Practices" is where practical development begins!
Table of Contents (14 chapters)
Oracle APEX Best Practices
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Installing APEX


In this section, we will discuss some additional considerations to take care of while installing APEX. The best source for the installation process is the Installation Guide of APEX.

Runtime or full development environment

On a production database, the runtime environment of APEX should be installed. This installation lacks the Application Builder and the SQL Workshop. Users can run applications, but the applications cannot be modified. The runtime environment of APEX can be administered using SQL*Plus and SQL Developer. The (web interface) options for importing an application, which are only available in a full development environment, can be used manually with the APEX_INSTANCE_ADMIN API. See the reference guide for details. Using a runtime environment for production is recommended for security purposes, so that we can be certain that installed applications cannot be modified by anyone.

On a development environment the full development environment can be installed with all the features available to the developers.

Build status

Besides the environment of APEX itself, the applications can also be installed in a similar way. When importing or exporting an application the Run Application Only or Run and Build Application options can be selected.

Changing an application to Run Application Only can be done in the Application Builder by choosing Edit Application Properties. Changing the Build Status to Run and Build Application can only be done as the admin user of the workspace internal. In the APEX Administration Services, choose Manage Workspaces and then select Manage Applications | Build Status. Also refer to Chapter 6, Deploy and Maintain.

Another setting related to the Runtime Only option could be used in the APEX Administration Services at instance level. Select Manage Instance and then select Security. Setting the property Disable Workspace Login to yes, acts as setting a Runtime Only environment, while still allowing instance administrators to log in to the APEX Administration Services.

Tablespaces

Following the install guide for the full development environment, at a certain moment, we have to run the following command, when logged in as SYS with the SYSDBA role, on the command line:

@apexins tablespace_apex tablespace_files tablespace_temp images

The command is explained as follows:

  • tablespace_apex is the name of the tablespace that contains all the objects for the APEX application user.

  • tablespace_files is the name of the tablespace that contains all the objects for the APEX files user.

  • tablespace_temp is the name of the temporary tablespace of the database.

  • images will be the virtual directory for APEX images. Oracle recommends using /i/ to support the future APEX upgrades.

For the runtime environment, the command is as follows:

@apxrtins tablespace_apex tablespace_files tablespace_temp images

In the documentation, SYSAUX is given as an example for both tablespace_apex and tablespace_files. There are several reasons for not using SYSAUX for these tablespaces, but to use our own instead:

  • SYSAUX is an important tablespace of the database itself

  • We have more control over sizing and growth

  • It is easier for a DBA to manage tablespace placement

  • Contention in the SYSAUX tablespace is less occurring

  • It's easier to clean-up older versions of APEX

  • And last but not least, it's only an example

Converting runtime environment into a full development environment and vice versa

It's always possible to switch from a runtime to a production environment and vice versa. If you want to convert a runtime to a full development environment log in as SYS with the SYSDBA role and on the command line type @apxdvins.sql. For converting a full development to a runtime environment, type @apxdevrm—but export websheet applications first. For more details see the installation guide.

Another way to restrict user access can be accomplished by logging in to the APEX Administration Services, where we can (among others) manage the APEX instance settings and all the workspaces. We can do that in two ways:

  • http://server:port/apex/apex_admin: Log in with the administrator credentials

  • http://server:port/apex/: Log in to the workspace internal, with the administrator credentials

After logging in, perform the following steps:

  1. Go to Manage Instance.

  2. Select Security.

  3. Select the appropriate settings for Disable Administrator Login and Disable Workspace Login. These settings can also be set manually with the APEX_INSTANCE_ADMIN API. See the reference guide for details.