Skip Headers
Oracle® Database Express Edition Application Express User's Guide
Release 2.1

Part Number B25309-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

8 Understanding Application Administration

As you develop applications in Application Builder, you can mange your application development environment on the Application Administration page.

This section contains the following topics:

About the Application Administration Page

Use the Application Administration page to mange your application development environment. The Application Administration page contains the following icons:

A Tasks list displays on the right side of the Application Administration page and displays the following link:

This section contains the following topics:

Accessing Application Administration

Use the Application Administration page to mange your application development environment.

To access the Application Administration page:

  1. On the Database Home Page, click the Application Builder icon.

  2. On the Tasks list, click Administration.

    The Application Administration appears.

About Application Express

The About Application Express page lists basic product information.

To access the About Application Express page:

  1. On the Database Home Page, click the Application Builder icon.

  2. On the Tasks list, click About Application Express.

    The About Application Express page appears.

The following Oracle Application Express product information displays:

  • Product build

  • Schema compatibility

  • Last DDL time

  • Host schema

  • Application Owner

  • Workspace ID

  • Current user

  • Language Preference

  • Current Time (on server)

About the Manage Services Page

The Manage Services pages page contains the following icons:

This section contains the following topic:

Accessing the Manage Services Page

To access the Manage Services Page:

  1. On the Database Home Page, click the Application Builder icon.

  2. On the Tasks list, click Manage Services.

    The Manage Services page appears.

Managing Session State and User Preferences

A session is a logical construct that establishes persistence (or stateful behavior) across page views. Each session is assigned a unique ID which the Application Express engine uses to store and retrieve an application's working set of data (or session state) before and after each page view. Sessions persist in the database until purged.

Topics in this section include:

Managing Session State

A session establishes persistence (or stateful behavior) across page views. You view and purge session state for the current session, purge existing sessions by age, or first review session details on the Session State page and then purge.

Topics in this section include:

Viewing and Purging Session State for the Current Session

To view session state for the current session:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Session State.

  4. When the Session State page appears, click Current preferences and session state with an option to purge.

  5. To view information about the current session, click View Session State.

  6. To reset the session state for the current session, click Purge Session State.

Purging Sessions by Age

To purge existing session by age:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Session State.

  4. Select Purge sessions by age.

  5. Make a selection from Sessions older than.

  6. Click one of the following buttons:

    • Report Session generates a report detailing the total number of sessions for the database user account, the number of users, and the number of old sessions.

    • Purge Sessions purges existing sessions by age.

Viewing Session Details Prior to Removing Session State

You can determine whether to remove existing sessions by first reviewing session details on the Session State page.

To view session details prior to removing session state:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Session State.

  4. Select Recent sessions with drill down to session details.

  5. To narrow the results, select a time increment, specify a user, and click Go.

  6. To view session details, select the session ID.

    The Session Details page appears.

  7. Click one of the following buttons:

    • Remove Session. Removes the record of the session from the SESSIONS table along with session state (including collections data) associated with the session.

      Any user using a session that is removed will no longer be able to use the session and will be prompted to re-authenticate in most situations upon their next page request. This option could be used by administrators who might have a need to make sure a certain a specific user could no longer access to an Oracle Application Express applications.

    • Remove State. Clears the session data from the session state tables (including collections data) but does not remove the session record. Removing a session is a good approach for developers during debugging.

      This is the equivalent of clearing session state for the current session using the Clear Cache argument value SESSION in the f?p URL. This option might be used by developers during debugging.

Managing User Preferences

You can use preferences to store values for a specific Application Express user across distinct sessions. Once set, these preferences can removed programatically or manually. You can set user preferences by creating a page process, by the calculation of a preference Item Source Value, or programatically using a PL/SQL API.

Topics in this section include:

Viewing and Resetting Preferences for the Current User

To manage user preferences for the current user:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Session State.

  4. When the Session State page appears, click Current preferences and session state with an option to purge.

  5. To view preferences for the current user, click View Preferences.

  6. To reset user preferences for the current user, click Reset Preferences.

Viewing Preferences for Users

You view preferences for a specific user on the Purge Preferences report.

To view the Purge Preferences report:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Session State.

  4. On the Session State page, select Preferences by user.

    The Preferences by Users page appears.

  5. Specify a user and click Go.

Setting User Preferences

You can set user preferences within your application through the creation of a page process, by creating a preference item, or programatically.

Topics in this section include:

Setting User Preferences Using a Page Process

To set user preference values by creating a page process:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Database Home Page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Page Processes, click the Create icon.

    The Create Page Process Wizard appears.

  3. For the process category, select Session State.

  4. For the process type, select one of the following:

    • Set Preference to value of item

    • Set Preference to value of item if item is not NULL

  5. Specify a process name, sequence, and processing point.

  6. Specify the preference value in the field provided using the format:

    PreferenceName:Item
    
    
  7. Click Page Items to see a list of available items.

  8. Follow the on-screen instructions.

Setting the Source of an Item Based on a User Preference

You can set the source of an item based on a user preference by defining the item source type as Preference.

To define the source of item based on a user preference:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Database Home Page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Item, click the Create icon.

    The Create Item Wizard appears.

  3. For the item type, select Hidden.

  4. Specify the Item Name, sequence, and region.

  5. From the Item Source list, select Preference.

  6. In Item Source Value, enter the name of the preference.

  7. Click Create Item.

Setting User Preferences Programatically

To set or reference user preferences programatically, you must use a PL/SQL API. User-level caching is available programmatically. You can use the set_preference function to set a user level preference called NAMED_PREFERENCE. For example:

HTMLDB_UTIL.SET_PREFERENCE(
 p_preference=>'NAMED_PREFERENCE',
 p_value =>:ITEM_NAME);

You can reference the value of a user preference using the function GET_PREFERENCES. For example:

NVL(HTMLDB_UTIL.GET_PREFERENCE('NAMED_PREFERENCE'),15)

In the previous example, the preference would default to the value 15 if the preference contained no value.

Removing User Preferences Programatically

To remove user preferences programatically, you must use a PL/SQL API. You can use the REMOVE_PREFERENCE procedure to remove a user level preference called NAMED_PREFERENCE, for example:

HTMLDB_UTIL.REMOVE_PREFERENCE(
p_preference=>'NAMED_PREFERENCE',
p_value =>:ITEM_NAME);

Resetting User Preferences Using a Page Process

You can reset user preferences by creating a page process and selecting the process type Reset Preferences.

To reset user preferences using a page process:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Database Home Page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Page Processes, click the Create icon.

    The Create Page Process Wizard appears.

  3. For the process category, select Session State.

  4. From Type, select Reset Preferences.

  5. Specify a process name, sequence, and process point.

  6. Follow the on-screen instructions

Purging Preferences for a Specific User

You can purge preferences for a specific user on the Purge Preferences page.

To purge preferences for a specific user:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Session State.

  4. On the Session State page, select Purge preferences by user.

    The Purge Preferences page appears.

  5. Select a specific user and click Report.

    A report appears at the bottom of the page.

  6. To purge the displayed user preferences, click Purge User Preferences.

Managing Log Files

Log entries older then one month are automatically deleted. You can also manually purge log files on the Manage Logs page.

To purge log files, you must have a database account that has been granted a DBA role.

Topics in this section include:

Truncating Page Views

Page Views track user activity for an application. Application developers enable logging within their application on the Edit Application Attributes page.

The Application Express engine actually uses two logs to track user activity. At any given time, one log is designated as current. For each rendered page view, the Application Express engine inserts one row into the log file. A log switch occurs at the interval listed under Log Interval. At that point, the Application Express engine removes all entries in the noncurrent log and designates it as current.

To truncate the activity logs manually:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Select Manage Logs.

    The Manage Logs page appears.

  4. Select Page Views.

  5. If prompted, enter the appropriate administrator username and password and click Login.

    The entries in the current logs display.

  6. Click either Truncate Log 1 or Truncate Log 2.

Purging the External Clicks Log

The External Clicks Log counts clicks from an application to an external site. You can implement this functionality using COUNT_CLICK procedure.

To purge the External Clicks Log:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Manage Logs.

  4. Click External Clicks.

  5. If prompted, enter the appropriate administrator username and password and click Login.

  6. Click Truncate Logs.

Purging the Builder Activity Log

The Application Builder Activity log tracks changes to applications.

To purge the Application Builder Activity log:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Manage Logs.

  4. Click Builder Activity.

  5. If prompted, enter the appropriate administrator username and password and click Login.

  6. Click Truncate Logs.

Deleting SQL History Logs

The SQL History logs maintain a history of recent commands and scripts run in SQL Commands.

To delete SQL History logs:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Select Manage Logs.

    The Manage Logs page appears.

  4. Click SQL History.

  5. If prompted, enter the appropriate administrator username and password and click Login.

    The SQL History page appears, listing the current number of history entries.

  6. To delete all entries, click Truncate Logs.

Deleting SQL Script Execution Logs

The SQL Scripts Execution Log maintains a history of script executions from SQL Scripts.

To delete SQL Scripts Execution Log:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Select Manage Logs.

    The Manage Logs page appears.

  4. Click SQL Script Execution.

  5. If prompted, enter the appropriate administrator username and password and click Login.

    The SQL Script Execution page appears, listing the current number of entries.

  6. To delete all entries, click Truncate Logs.

Disabling PL/SQL Program Unit Editing

By default, developers can change and compile PL/SQL source code when browsing database procedures, packages, and functions in Object Browser. You can disable PL/SQL program unit editing by selecting Do not allow PL/SQL program unit editing on the Preferences page.

To disable PL/SQL program unit editing:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Preferences.

    The Preferences page appears.

  4. From PL/SQL Editing select one of the following:

    • Allow PL/SQL program unit editing

    • Do not allow PL/SQL program unit editing

    If you select Do not allow PL/SQL program unit editing, developers can still create and replace PL/SQL program units using scripts or SQL Commands.

Managing Application Models

Running the Create Application Wizard creates an application model. This model contains basic application property values, such as the application pages and page definitions, DML processes, and multi-row operation processes. When you create a new application, you can base it on an existing application model, making the creation process more productive.

This section contains the following topics:

Deleting an Application Model

You can remove unwanted application models on the Application Models page.

To delete an application model:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Services.

  3. Click Application Models.

    The Application Models page appears.

  4. To search for a model, enter a case insensitive query in the Model field and click Go.

  5. Select the models you want to delete and click Delete Checked.

Managing Application Express End Users

The simplest way to make an application available to other users is to create Application Express end users. Application Express end users do not have application development privileges and can only access applications that do not use an external authentication scheme. Use the Manage Application Express Users page to create new user accounts, manage existing user accounts, and change user passwords.

Topics in this section include:

See Also:

"Exporting Application Express Users", "About Publishing the Application URL" and "About Application Express Account Credentials" for information about implementing Application Express Authentication

Editing Existing End User Accounts

You edit existing end user accounts on the View User page.

To edit an existing a user account:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click View Users.

    The View Users page appears.

    You control how the page displays by making a selection from the View list. Available options include:

    • Icons (the default) displays each user as a large icon. To edit a user, click the appropriate icon.

    • Details displays each user as a line in a report. To edit a user, click a user name.

  4. Select a user.

    The Edit User page appears.

  5. Under Edit User, edit the User Name or Email address.

  6. Under Password, edit the current password by typing a new password in the Password and Confirm Password fields

  7. Under User Groups, select an optional user group.

    You can use groups to restrict access to various parts of an application. Groups are primarily useful when using Application Express Authentication.

  8. Click Apply Changes.

Creating New End User Accounts

You create new user accounts on the Create User page.

To create a new user account:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click Create User.

    The Create User page appears.

  4. Under User Identification, enter the appropriate information. Required fields are marked with a red asterisk (*).

  5. Under User Groups, select an optional user group.

    You can use groups to restrict access to various parts of an application. Groups are primarily useful when using Application Express Authentication.

  6. Click Create User or Create and Create Another.

Changing an End User Password

To change an end user password:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click View Users.

    The View Users page appears.

  4. To search for an existing user, enter a query in the Find field and clicking Go.

  5. Select a user.

  6. Scroll down to Password.

  7. Type a new password in the Password and Confirm Password fields and click Apply Changes.

Managing Application Express Users Using Groups

You can create groups to restrict access to various parts of an application. Keep in mind, however, that groups are not portable over different authentication schemes. Groups are primarily useful when using Application Express Authentication.

Topics in this section include:

See Also:

"About Application Express Account Credentials" for information about implementing Application Express Authentication and "Managing Application Express End Users"

Creating a Group

To create a new group:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click Create Group.

    The Create/Edit Group page appears.

  4. Specify a group name, description, and click Create Group.

Editing an Existing Group Assignment

To edit an existing group assignment:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click User Group Assignments.

    The User Group Assignments page appears.

  4. Click the Edit icon adjacent to the Group Name.

  5. Scroll down to User Groups, make a new selection, and click Apply Changes.

Viewing Group Assignment Reports

To view a report of user group assignments:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click User Group Assignments.

    The User Groups Assignments report appears.

Adding Users to a Group

To add a user to a group:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click View Users.

    The Existing Users page appears.

  4. Select a user.

    The Edit User page appears.

  5. Scroll down to User Groups.

  6. Select a group from the Groups list.

  7. Click Apply Changes.

Removing Users from a Group

To remove a user to a group:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Manage Application Express Users.

    The Manage Application Express Users page appears.

  3. Click View Users.

    The Existing Users page appears.

  4. Select a user.

    The Edit User page appears.

  5. Scroll down to User Groups.

  6. Deselect the selected group in the Groups list.

  7. Click Apply Changes.

Monitoring Activity

You can monitor changes to page views and entire applications by viewing reports on the Monitor page.

Topics in this section include:

Accessing the Monitor Page

To access the Monitor page:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Monitor Activity.

    The Monitor page is divided into the following sections:

    • Page Views

    • Application Changes

    • Sessions

  3. Select a report to review.

Viewing Application Changes by Application

To view application changes by developer:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Monitor Activity.

  3. Under Application Changes, select By Application.

  4. Specify a time frame. Make a selection form the Time list and click Go.

  5. To view additional details, select a user ID.

Viewing Application Changes by Day

To view application changes by day:

  1. Navigate to the Database Home Page.

  2. Click the Administration icon.

  3. Click Monitor Activity.

  4. Under Application Changes, select By Day.

    The Application Changes by Day page appears.

  5. Select the appropriate report:

    • Month View. Offers a listing of application changes by day in a Calendar view.

    • Report. Includes a report of application changes by day.

    • Line Chart. Make a selection from the Developer list and click Go.

    • By Developer Report. Specify a time frame by making a selection form the Time list and click Go. To view additional details, select a developer.

Viewing Active Sessions

The Active Sessions Report displays active sessions for the current workspace (or database user).

To view application changes by developer:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Monitor Activity.

  3. Under Sessions, select Active Sessions.

  4. Select the session ID to view the Session Details page.

How to Send Email from an Application

This section describes how to send email from an Application Builder application. Before you can send email from an Application Builder application, you first need to configure your Email Environment Settings.

Topics in this section include:

Configuring Email Environment Settings

To send email from an Oracle Application Express application, you must configure settings on the Email Environment Preferences page. To access the Email Environment Settings page, you must have a database account that has been granted a DBA role.

To configure Email Environment Preferences:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Email Configuration.

    The Email Configuration page appears.

  3. Click Email Environment Settings.

  4. If prompted, enter the appropriate administrator username and password and click Login.

  5. On the Email Environment Setting page:

    • SMTP Host Address - Enter the server address of the SMTP server. On installation, this will be set to localhost. If you are using another server as an SMTP relay, change localhost to that server's address.

    • For SMTP Host Port - Enter the port the SMTP server listens to for email requests. By default, this setting will be set to 25 at the time of installation.

  6. Click Apply Changes.

Sending Email from an Application

You can send an email from an Application Builder application by:

  • Creating a background job to periodically send all mail messages stored in the active mail queue

  • Calling the PL/SQL package HTMLDB_MAIL

Topics in this section include:

Sending Email Using a Background Job

Oracle Application Express stores unsent email messages in a table named HTMLDB_MAIL_QUEUE. A DBMS_JOB background process is automatically created when you install Oracle Application Express. This background process pushes the mail queue every 15 minutes.

The most efficient approach to sending email is to create a background job (using a DBMS_JOB package) to periodically send all mail messages stored in the active mail queue.

Sending Email Manually by Calling HTMLDB_MAIL

You can also send an email from an Oracle Application Express application by calling the PL/SQL HTMLDB_MAIL package. This package is built on top of the Oracle supplied UTL_SMTP package. Because of this dependence, in order to use HTMLDB_MAIL, the UTL_SMTP package must be installed and functioning.

See Also:

Oracle Database PL/SQL Packages and Types Reference for more information about the UTL_SMTP package and "HTMLDB_MAIL"

HTMLDB_MAIL contains two procedures for manually sending email:

  • Use the HTMLDB_MAIL.SEND procedure to manually send an outbound email message from your application

  • Use HTMLDB_MAIL to deliver mail messages stored in HTMLDB_MAIL_QUEUE

Oracle Application Express stores unsent email messages in a table named HTMLDB_MAIL_QUEUE. You can deliver mail messages stored in this queue to the specified SMTP gateway by calling the procedure HTMLDB_MAIL.PUSH_QUEUE.

Oracle Application Express logs successfully submitted messages in the table HTMLDB_MAIL_LOG with the timestamp reflecting your server's local time.

The following UNIX/LINUX example demonstrates the use of the HTMLDB_MAIL.PUSH_QUEUE procedure using a shell script.

SQLPLUS / <<EOF
FLOWS_020100.HTMLDB_MAIL.PUSH_QUEUE;
DISCONNECT
EXIT
EOF

See Also:

"HTMLDB_MAIL" for information about using the HTMLDB_MAIL

Viewing the Email Log

The Email log records message header information and send date of successfully sent mail message.

To view the email log:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Email Configuration.

  3. Click Manage Email Log.

  4. If prompted, enter the appropriate administrator username and password and click Login.

    The Email Log page appears.

  5. To control the number of rows that display, make a selection from the Display list and click Go.

  6. To delete all log entries, click Truncate Log.

Viewing the Mail Queue

Use the Manage Mail Queue page to monitor email messages in the mail queue.

To monitor messages in the mail queue:

  1. On the Database Home Page, click the Application Builder icon.

  2. From the Administration list, select Email Configuration.

  3. Click Manage Email Queue.

  4. If prompted, enter the appropriate administrator username and password and click Login.

    The Manage Email Queue page appears.

  5. To send email messages, click Send All Mail.

  6. To delete email messages, select the messages to be deleted and click Delete.