The APEX_INSTANCE_ADMIN
package provides utilities for managing an Oracle Application Express runtime environment. You use the APEX_INSTANCE_ADMIN
package to get and set email settings, wallet settings, report printing settings and to manage scheme to workspace mappings. APEX_INSTANCE_ADMIN
can be executed by the SYS
, SYSTEM
, and APEX_040200
database users and any database user granted the role APEX_ADMINISTRATOR_ROLE
.
Table 10-1 lists all the available parameter values you can set within the APEX_INSTANCE_ADMIN package
, including parameters for email, wallet, and reporting printing.
Table 10-1 Available Parameters
Parameter Name | Description |
---|---|
|
The maximum number of days an end-user account password may be used before the account is expired. |
|
If set to |
|
If set to |
|
If set to |
|
Controls instance wide setting of application activity log ([A]lways, [N]ever, [U]se application settings) |
|
If set to |
|
If set to |
|
Uploaded files like application export files, websheet export files, spreadsheet data load files are automatically deleted after this number of days. Default is |
|
If set to |
|
If set to |
|
If set to |
|
Specifies the full URL to the images directory of Application Express instance, including the trailing slash after the images directory. For example: http://your_server/i/ |
|
Specifies the URL to Application Express instance, including the trailing slash after the Database Access Descriptor. For example: http://your_server/pls/apex/ |
|
If set to |
|
If set to |
|
If set to |
|
Comma-separated list of IP addresses for proxy servers through which requests come in. |
|
The flag which determines the time increase in seconds after failed logins. |
|
The methods to count failed logins. Colon-separated list of |
|
The number of seconds an internal application may be idle. |
|
The number of seconds an internal application session may exist. |
|
The alphabetic characters used for password complexity rules. Default list of alphabetic characters include the following: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |
|
A positive integer or 0 which specifies the minimum character length for passwords for instance administrators, workspace administrators, developers, and end user Application Express accounts. |
|
A positive integer or 0 which specifies the number of differences required between old and new passwords. The passwords are compared character by character, and each difference that occurs in any position counts toward the required minimum difference. This setting applies to accounts for instance administrators, workspace administrators, developers, and end user Application Express accounts. |
|
The punctuation characters used for password complexity rules. Default list of punctuation characters include the following: !"#$%&()``*+,-/:;<=>?_ |
|
If set to |
|
If set to |
|
If set to |
|
If set to |
|
If set to |
|
If set to |
|
Determines default provisioning mode. Default is |
|
Defines the "from" address for administrative tasks that generate email, such as approving a provision request or resetting a password. Enter a valid email address, for example:
|
|
Defines the server address of the SMTP server. If you are using another server as an SMTP relay, change this parameter to that server's address. Default setting: localhost |
|
Defines the port the SMTP server listens to for mail requests. Default setting: 25 |
|
Defines the password Application Express takes to authenticate itself against the SMTP server, with the parameter |
|
Defines whether Application Express opens an encrypted connection to the SMTP server. Encryption is only supported on database versions 11.2.0.2 and later. On earlier database versions, the connection is not encrypted. If set to If set to If |
|
Defines the username Application Express takes to authenticate itself against the SMTP server (default is null). Starting with database version 11.2.0.2, Application Express uses |
|
The maximum allowable size for an individual script result. Default is |
|
If set to |
|
Location of the help and documentation accessed from the Help link within the development environment. Default is |
|
If set to If set to |
|
The regular expression used to validate a username if the Builder authentication scheme is not APEX. Default is as follows: ^[[:alnum:]._%-]+@[[:alnum:].-]+\.[[:alpha:]]{2,4}$ |
|
The path to the wallet on the file system, for example:
file:/home/<username>/wallets
|
|
The password associated with the wallet. |
|
If set to |
|
Maximum number of emails allowed to be sent by using APEX_MAIL per workspace in a 24 hour period. Default is |
|
The maximum space allocated for script results. Default is |
|
If set to |
|
If set to |
|
Defines the maximum number of days a developer or administrator account password may be used before the account expires. The default value is 45 days. |
|
Specify either standard support or advanced support. Advanced support requires an Oracle BI Publisher license. Valid values include:
|
|
Valid values include:
|
|
Specifies the host address of the print server converting engine, for example, |
|
Defines the port of the print server engine, for example |
|
Defines the script that is the print server engine, for example: /xmlpserver/convert |
|
Set to |
The ADD_SCHEMA
procedure adds a schema to a workspace to schema mapping.
APEX_INSTANCE_ADMIN.ADD_SCHEMA( p_workspace IN VARCHAR2, p_schema IN VARCHAR2);
Table 10-2 describes the parameters available in the ADD_SCHEMA
procedure.
Table 10-2 ADD_SCHEMA Parameters
Parameter | Description |
---|---|
|
The name of the workspace to which the schema mapping is added. |
|
The schema to add to the schema to workspace mapping. |
The following example demonstrates how to use the ADD_SCHEMA
procedure to map a schema mapped to a workspace.
BEGIN APEX_INSTANCE_ADMIN.ADD_SCHEMA('MY_WORKSPACE','FRANK'); END;
The ADD_WORKSPACE
procedure adds a workspace to an Application Express Instance.
APEX_INSTANCE_ADMIN.ADD_WORKSPACE( p_workspace_id IN NUMBER DEFAULT NULL, p_workspace IN VARCHAR2, p_source_identifier IN VARCHAR2 DEFAULT NULL, p_primary_schema IN VARCHAR2, p_additional_schemas IN VARCHAR2, p_rm_consumer_group IN VARCHAR2 DEFAULT NULL );
Table 10-3 describes the parameters available in the ADD_WORKSPACE
procedure.
Table 10-3 ADD_WORKSPACE Parameters
Parameter | Description |
---|---|
|
The ID to uniquely identify the workspace in an Application Express instance. This may be left null and a new unique ID is assigned. |
|
The name of the workspace to be added. |
|
A short identifier for the workspace used when synchronizing feedback between different instances. |
|
The primary database schema to associate with the new workspace. |
|
A colon delimited list of additional schemas to associate with this workspace. |
|
Resource Manager consumer group which is used when executing applications of this workspace. |
The following example demonstrates how to use the ADD_WORKSPACE
procedure to add a new workspace named MY_WORKSPACE
using the primary schema, SCOTT
, along with additional schema mappings for HR and OE.
BEGIN APEX_INSTANCE_ADMIN.ADD_WORKSPACE ( p_workspace_id => 8675309, p_workspace => 'MY_WORKSPACE', p_primary_schema => 'SCOTT', p_additional_schemas => 'HR:OE' ); END;
The GET_PARAMETER
function retrieves the value of a parameter used in administering a runtime environment.
APEX_INSTANCE_ADMIN.GET_PARAMETER( p_parameter IN VARCHAR2) RETURN VARCHAR2;
Table 10-4 describes the parameters available in the GET_PARAMETER
function.
Table 10-4 GET_PARAMETER Parameters
Parameter | Description |
---|---|
|
The instance parameter to be retrieved. |
The following example demonstrates how to use the GET_PARAMETER
function to retrieve the SMTP_HOST_ADDRESS
parameter currently defined for an Oracle Application Express instance.
DECLARE L_VAL VARCHAR2(4000); BEGIN L_VAL :=APEX_INSTANCE_ADMIN.GET_PARAMETER('SMTP_HOST_ADDRESS'); DBMS_OUTPUT.PUT_LINE('The SMTP Host Setting Is: '||L_VAL); END;
The GET_SCHEMAS
function retrieves a comma-delimited list of schemas that are mapped to a given workspace.
APEX_INSTANCE_ADMIN.GET_SCHEMAS( p_workspace IN VARCHAR2) RETURN VARCHAR2;
Table 10-5 describes the parameters available in the GET_SCHEMAS
function.
Table 10-5 GET_SCHEMAS Parameters
Parameter | Description |
---|---|
|
The name of the workspace from which to retrieve the schema list. |
The following example demonstrates how to use the GET_SCHEMA
function to retrieve the underlying schemas mapped to a workspace.
DECLARE L_VAL VARCHAR2(4000); BEGIN L_VAL :=APEX_INSTANCE_ADMIN.GET_SCHEMAS('MY_WORKSPACE'); DBMS_OUTPUT.PUT_LINE('The schemas for my workspace: '||L_VAL); END;
The REMOVE_APPLICATION procedure removes the application specified from the Application Express instance.
APEX_INSTANCE_ADMIN.REMOVE_APPLICATION ( p_application_id IN NUMBER);
Table 10-6 describes the REMOVE_APPLICATION procedure parameters.
Table 10-6 REMOVE_APPLICATION Parameters
Parameter | Description |
---|---|
|
The ID of the application to remove. |
The following example demonstrates how to use the REMOVE_APPLICATION procedure to remove an application with an ID of 100 from an Application Express instance.
BEGIN APEX_INSTANCE_ADMIN.REMOVE_APPLICATION(100); END;
The REMOVE_SAVED_REPORT
procedure removes a specific user's saved interactive report settings for a particular application.
APEX_INSTANCE_ADMIN.REMOVE_SAVED_REPORT( p_application_id IN NUMBER, p_report_id IN NUMBER);
Table 10-7 describes the parameters available in the REMOVE_SAVED_REPORT
procedure.
Table 10-7 REMOVE_SAVED_REPORT Parameters
Parameter | Description |
---|---|
|
The ID of the application for which to remove user saved interactive report information. |
p_report_id |
The ID of the saved user interactive report to be removed. |
The following example demonstrates how to use the REMOVE_SAVED_REPORT
procedure to remove user saved interactive report with the ID 123 for the application with an ID of 100.
BEGIN APEX_INSTANCE_ADMIN.REMOVE_SAVED_REPORT(100,123); END;
The REMOVE_SAVED_REPORTS
procedure removes all user saved interactive report settings for a particular application or for the entire instance.
APEX_INSTANCE_ADMIN.REMOVE_SAVED_REPORTS( p_application_id IN NUMBER DEFAULT NULL);
Table 10-8 describes the parameters available in the REMOVE_SAVED_REPORTS
procedure.
Table 10-8 REMOVE_SAVED_REPORTS Parameters
Parameter | Description |
---|---|
|
The ID of the application for which to remove user saved interactive report information. If this parameter is left null, all user saved interactive reports for the entire instance is removed. |
The following example demonstrates how to use the REMOVE_SAVED_REPORTS
procedure to remove user saved interactive report information for the application with an ID of 100.
BEGIN APEX_INSTANCE_ADMIN.REMOVE_SAVED_REPORTS(100); END;
This REMOVE_SCHEMA
procedure removes a workspace to schema mapping.
APEX_INSTANCE_ADMIN.REMOVE_SCHEMA( p_workspace IN VARCHAR2, p_schema IN VARCHAR2);
Table 10-9 describes the parameters available in the REMOVE_SCHEMA
procedure.
Table 10-9 REMOVE_SCHEMA Parameters
Parameter | Description |
---|---|
|
The name of the workspace from which the schema mapping is removed. |
|
The schema to remove from the schema to workspace mapping. |
The following example demonstrates how to use the REMOVE_SCHEMA
procedure to remove the schema named Frank
from the MY_WORKSPACE
workspace to schema mapping.
BEGIN APEX_INSTANCE_ADMIN.REMOVE_SCHEMA('MY_WORKSPACE','FRANK'); END;
The REMOVE_SUBSCRIPTION
procedure removes a specific interactive report subscription.
APEX_INSTANCE_ADMIN.REMOVE_SUBSCRIPTION( p_subscription_id IN NUMBER);
Table 10-10 describes the parameters available for the REMOVE_SUBSCRIPTION
procedure.
Table 10-10 REMOVE_SUBSCRIPTION Procedure Parameters
Parameter | Description |
---|---|
p_subscription_id |
The ID of the interactive report subscription to be removed. |
The following example demonstrates how to use the REMOVE_SUBSCRIPTION
procedure to remove interactive report subscription with the ID 12345. Use of APEX_APPLICATION_PAGE_IR_SUB
view can help identifying the subscription ID to remove.
BEGIN APEX_INSTANCE_ADMIN.REMOVE_SUBSCRIPTION ( p_subscription_id => 12345); END;
The REMOVE_WORKSPACE
procedure removes a workspace from an Application Express instance.
APEX_INSTANCE_ADMIN.REMOVE_WORKSPACE( p_workspace IN VARCHAR2, p_drop_users IN VARCHAR2 DEFAULT 'N', p_drop_tablespaces IN VARCHAR2 DEFAULT 'N' );
Table 10-11 describes the parameters available in the REMOVE_WORKSPACE
procedure.
Table 10-11 REMOVE_WORKSPACE Parameters
Parameter | Description |
---|---|
|
The name of the workspace to be removed. |
|
|
|
'Y' to drop the tablespace associated with the database user associated with the workspace. The default is |
The following example demonstrates how to use the REMOVE_WORKSPACE
procedure to remove an existing workspace named MY_WORKSPACE, along with the associated database users and tablespace.
BEGIN APEX_INSTANCE_ADMIN.REMOVE_WORKSPACE('MY_WORKSPACE','Y','Y'); END;
Set the log switch interval for each of the logs maintained by Application Express.
APEX_INSTANCE_ADMIN.SET_LOG_SWITCH_INTERVAL( p_log_name IN VARCHAR2, p_log_switch_after_days IN NUMBER );
Table 10-12 describes the parameters available in the SET_LOG_SWITCH_INTERVAL
procedure.
Table 10-12 SET_LOG_SWITCH_INTERVAL Parameters
Parameters | Description |
---|---|
|
Specifies the name of the log. Valid values include |
|
This interval must be a positive integer between 1 and 180. |
This example sets the log switch interval for the ACTIVITY log to 30 days.
begin apex_instance_admin.set_log_switch_interval( p_log_name in 'ACTIVITY', p_log_switch_after_days => 30 ); commit; end;
The SET_PARAMETER
procedure sets a parameter used in administering a runtime environment.
APEX_INSTANCE_ADMIN.SET_PARAMETER( p_parameter IN VARCHAR2, p_value IN VARCHAR2 DEFAULT 'N');
Table 10-13 describes the parameters available in the SET_PARAMETER
procedure.
Table 10-13 SET_PARAMETER Parameters
Parameter | Description |
---|---|
|
The instance parameter to be set. |
|
The value of the parameter. |
The following example demonstrates how to use the SET_PARAMETER
procedure to set the SMTP_HOST_ADDRESS
parameter for an Oracle Application Express instance.
BEGIN APEX_INSTANCE_ADMIN.SET_PARAMETER('SMTP_HOST_ADDRESS','mail.example.com'); END;
The SET_WORKSPACE_CONSUMER_GROUP
procedure sets a Resource Manager Consumer Group to a workspace.
set_workspace_consumer_group( p_workspace in varchar2, p_rm_consumer_group in varchar2 );
Table 10-14 describes the parameters available for the SET_WORKSPACE_CONSUMER_GROUP
procedure.
Table 10-14 SET_WORKSPACE_CONSUMER_GROUP Parameters
Parameters | Description |
---|---|
p_workspace |
This is the name of the workspace for which the resource consumer group is to be set. |
p_rm_consumer_group |
The parameter If the value of |
The following example sets the workspace to the Resource Manager consumer group "CUSTOM_GROUP1":
begin apex_instance_admin.set_workspace_consumer_group( p_workspace => 'MY_WORKSPACE', p_rm_consumer_group => 'CUSTOM_GROUP1' ); commit; end; /
The TRUNCATE_LOG procedure truncates the log entries specified by the input parameter.
APEX_INSTANCE_ADMIN.TRUNCATE_LOG( p_log IN VARCHAR2);
Table 10-15 describes the parameters available in the TRUNCATE_LOG
procedure.
Table 10-15 TRUNCATE_LOG Parameters
Parameter | Description |
---|---|
|
This parameter can have one of the following values:
|
The following example demonstrates how to use the TRUNCATE_LOG
procedure to remove all log entries that record access to Application Express application pages.
BEGIN APEX_INSTANCE_ADMIN.TRUNCATE_LOG('ACTIVITY'); END;