How To Install Dbms_network_acl_admin Package In 11g

3.1 Recommended Pre-installation Tasks Before installing Oracle Application Express, Oracle recommends that you complete the following steps: • Review and satisfy all Oracle Application Express installation requirements. • Shut down with normal or immediate priority the Oracle Database instances where you plan to install Oracle Application Express. On Oracle Real Application Clusters (Oracle RAC) systems, shut down all instances on each node. An alternative to shutting down the database is to prevent all users from accessing Oracle Application Express when upgrading your installation from a previous release of Oracle Application Express. Oracle only recommends this option in high availability production environments where planned outages are not available. For all other scenarios, the database should be shut down. To disable access to Oracle Application Express when the existing installation is using the Application Express Listener, shut down the appropriate application server where the Application Express listener is deployed.
To disable user access to Oracle Application Express when the existing installation is using the Oracle HTTP Server with mod_plsql, you should either shut down the Web server or disable the Application Express Database Access Descriptor of the Web server. For an existing installation using the embedded PL/SQL gateway, you should disable the Oracle XML DB Protocol Server by setting the HTTP port to 0. This can be accomplished by starting SQL*Plus, connecting as SYS to the database where Oracle Application Express is installed, and running: EXEC DBMS_XDB.SETHTTPPORT(0); Once you have prevented access from Oracle Application Express users, you should log into SQL*Plus as SYS, connecting to the database where Oracle Application Express is installed, and query V$SESSION to ensure there are no long running sessions which would interfere with the upgrade process. • Back up the Oracle Database installation. Oracle recommends that you create a backup of the current Oracle Database installation before you install Oracle Application Express. You can use Oracle Database Recovery Manager, which is included in the Oracle Database installation, to perform the backup.
3.3.2 Download and Install Oracle Application Express To install Oracle Application Express: • For installations where the development will be in English only, download the file apex_4.2_en.zip from the Oracle Application Express download page. Where the development will include languages other than English, download apex_4.2.zip from the Oracle Application Express download page. See: Note that the actual file name may differ if a more recent release has shipped since this document was published. • Unzip downloaded zip file: • If English only, unzip apex_4.2_en.zip as follows, preserving directory names: • UNIX and Linux: $ unzip apex_4.2_en.zip • Windows: Double click the file apex_4.2_en.zip in Windows Explorer • If multiple languages, unzip apex_4.2.zip as follows, preserving directory names: • UNIX and Linux: $ unzip apex_4.2.zip • Windows: Double click the file apex_4.2.zip in Windows Explorer. Note: You should keep the directory tree where you unzip the files short and not under directories that contain spaces. For example, within Windows unzip to C: TEMP.
• Change your working directory to apex. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Select the appropriate installation option. Full development environment provides complete access to the Application Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified. To learn more, see. Available installation options include: • Full development environment.
This means, that after moving your application from 10g to 11g, packages like UTL_MAIL, UTL_TCP and UTL_SMTP (amongst others) will not work without some extra configuration. If your 10g-application has been installed on an 11g database without doing the extra config, you will get the following error. How To Install Dbms_Network_Acl_Admin Package. So far we have created. This document explains the full set of steps that need to be taken in order to perform a complete and working installation. Hi Christos I do not have experience with Oracle XE but I believe that you have to set ACL in Oracle 11g XE also.

Run apexins.sql passing the following four arguments in the order shown: @apexins.sql tablespace_apex tablespace_files tablespace_temp images Where: • tablespace_apex is the name of the tablespace for the Oracle Application Express application user. • tablespace_files is the name of the tablespace for the Oracle Application Express files user. • tablespace_temp is the name of the temporary tablespace or tablespace group. • images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/. Example: @apexins.sql SYSAUX SYSAUX TEMP /i/.
Note: If you receive the following error, please exit SQL*Plus and change your working directory to where you unzipped the installation file, for example C: TEMP in Windows, before starting SQL*Plus: SP2-0310: unable to open file 'apexins.sql' • Runtime environment. Run apxrtins.sql passing the following arguments in the order shown: @apxrtins.sql tablespace_apex tablespace_files tablespace_temp images Where: • tablespace_apex is the name of the tablespace for the Oracle Application Express application user. • tablespace_files is the name of the tablespace for the Oracle Application Express files user. • tablespace_temp is the name of the temporary tablespace or tablespace group. • images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/.
Example: @apxrtins.sql SYSAUX SYSAUX TEMP /i/. See Also: for more information about SQL*Plus When Oracle Application Express installs, it creates three new database accounts: • APEX_040200 - The account that owns the Oracle Application Express schema and metadata. • FLOWS_FILES - The account that owns the Oracle Application Express uploaded files. • APEX_PUBLIC_USER - The minimally privileged account is used for Oracle Application Express configuration with Oracle Application Express Listener or Oracle HTTP Server and mod_plsql. If you configured RESTful Web services, then these additional accounts will be created: • APEX_REST_PUBLIC_USER - The account used when invoking RESTful Services definitions stored in Oracle Application Express.
• APEX_LISTENER - The account used to query RESTful Services definitions stored in Oracle Application Express. If you are upgrading from a previous release, then FLOWS_FILES already exists and APEX_PUBLIC_USER is created if it does not already exist. Tip: You use the ADMIN account to log in to Oracle Application Express Administration Services and manage an entire Oracle Application Express instance.
To change the password for the ADMIN account: • Change your working directory to the apex directory where you unzipped the installation software. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run apxchpwd.sql. For example: @apxchpwd.sql When prompted, enter a password for the ADMIN account. Tip: If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary.
To unlock the APEX_PUBLIC_USER account: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run the following statement: ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK. Tip: If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary. To change the password for the APEX_PUBLIC_USER account: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run the following statement: ALTER USER APEX_PUBLIC_USER IDENTIFIED BY new_password Where new_password is the new password you are setting for APEX_PUBLIC_USER. You will use this password when creating the DAD in the sections that follow. 3.3.5.2.1 About Password Expiration in Oracle Database 11 g In the default profile in Oracle Database 11 g, the parameter PASSWORD_LIFE_TIME is set to 180.
If you are using Oracle Database 11 g with Oracle Application Express, this causes the password for APEX_PUBLIC_USER to expire in 180 days. As a result, your Oracle Application Express instance will become unusable until you change the password. To prevent this behavior, create another profile in which the PASSWORD_LIFE_TIME parameter is set to unlimited and alter the APEX_PUBLIC_USER account and assign it to the new profile. 3.3.6 Download and Install Oracle Application Express Listener To download the Oracle Application Express Listener: • Download the latest release of the Oracle Application Express Listener, apex_listener.
Zip, from the Oracle Application Express download page. See: Note that the version.number in the file name reflects the current release number. • Unzip the downloaded zip file into a directory (or folder) of your choice: • UNIX and Linux: unzip apex_listener. Version.number.zip • Windows: Double-click the file apex_listener. Version.number.zip in Windows Explorer • Locate the installation guide for Oracle Application Express Listener and follow instructions to complete installation and configuration steps.
3.3.6.1 Disabling Oracle XML DB Protocol Server If you were previously using the embedded PL/SQL Gateway and now wish to use Oracle Application Express Listener, you need to disable the Oracle XML DB Protocol server. To disable Oracle XML DB Protocol server: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run the following command: EXEC DBMS_XDB.SETHTTPPORT(0). 3.3.7 Configure RESTful Services In a new installation of Oracle Application Express, you configure RESTful Services by running the configuration script apex_rest_config.sql. This step is optional and only needs to be completed if you wish to use RESTful Services with the Oracle Application Express Listener on the instance.
Once configured, the instance administrator can control the availability of the feature. If the instance administrator has disabled RESTful Services for this Application Express instance, RESTful Services are not available for this instance and the RESTful Services icon does not display. See 'Configuring SQL Workshop' in. Note: RESTful Services requires Oracle Application Express Listener 2.0 or later. To configure RESTful Services in Oracle Application Express: • Change your working directory to the apex directory where you unzipped the installation software.
• Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run apex_rest_config.sql.
For example: @apex_rest_config.sql When Prompted, enter a password for the APEX_LISTENER and APEX_REST_PUBLIC_USER accounts. When configuring RESTful Services in Oracle Application Express, it creates two new database accounts.
• APEX_LISTENER - The account used to query RESTful Services definitions stored in Oracle Application Express. • APEX_REST_PUBLIC_USER - The account used when calling RESTful Services definitions stored in Oracle Application Express.
3.3.8 Enable Network Services in Oracle Database 11 g By default, the ability to interact with network services is disabled in Oracle Database 11 g Release 1 or 2. Therefore, if you are running Oracle Application Express with Oracle Database 11 g Release 1 or 2, you must use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the APEX_040200 database user. Failing to grant these privileges results in issues with: • Sending outbound mail in Oracle Application Express. Users can call methods from the APEX_MAIL package, but issues arise when sending outbound email. • Using Web services in Oracle Application Express. • PDF report printing.
3.3.8.1 Granting Connect Privileges The following example demonstrates how to grant connect privileges to any host for the APEX_040200 database user. This example assumes you connected to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to '*' and give APEX_040200 -- the 'connect' privilege if APEX_040200 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml', 'ACL that lets power users to connect to everywhere', 'APEX_040200', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*'); END; / COMMIT; The following example demonstrates how to provide less privileged access to local network resources. This example is used to enable access to servers on the local host only, such as email and report servers. DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to 'localhost' and give APEX_040200 -- the 'connect' privilege if APEX_040200 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = 'localhost' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to 'localhost'. WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml', 'ACL that lets users to connect to localhost', 'APEX_040200', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost'); END; / COMMIT.
3.3.8.2 Troubleshooting an Invalid ACL Error If you receive an ORA-44416: Invalid ACL error after running the previous script, use the following query to identify the invalid ACL: REM Show the dangling references to dropped users in the ACL that is assigned REM to '*'. SELECT ACL, PRINCIPAL FROM DBA_NETWORK_ACLS NACL, XDS_ACE ACE WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL AND NACL.ACLID = ACE.ACLID AND NOT EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL); Next, run the following code to fix the ACL: DECLARE ACL_ID RAW(16); CNT NUMBER; BEGIN -- Look for the object ID of the ACL currently assigned to '*' SELECT ACLID INTO ACL_ID FROM DBA_NETWORK_ACLS WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; -- If just some users referenced in the ACL are invalid, remove just those -- users in the ACL.
Otherwise, drop the ACL completely. SELECT COUNT(PRINCIPAL) INTO CNT FROM XDS_ACE WHERE ACLID = ACL_ID AND EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL); IF (CNT >0) THEN FOR R IN (SELECT PRINCIPAL FROM XDS_ACE WHERE ACLID = ACL_ID AND NOT EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL)) LOOP UPDATE XDB.XDB$ACL SET OBJECT_VALUE = DELETEXML(OBJECT_VALUE, '/ACL/ACE[PRINCIPAL=' R.PRINCIPAL ']') WHERE OBJECT_ID = ACL_ID; END LOOP; ELSE DELETE FROM XDB.XDB$ACL WHERE OBJECT_ID = ACL_ID; END IF; END; / REM commit the changes. COMMIT; Once the ACL has been fixed, you must run the first script in this section to apply the ACL to the APEX_040200 user. 3.3.11 About Developing Oracle Application Express in Other Languages The Oracle Application Express interface is translated into German, Spanish, French, Italian, Japanese, Korean, Brazilian Portuguese, Simplified Chinese, and Traditional Chinese. A single instance of Oracle Application Express can be installed with one or more of these translated versions. Developers can choose to run the Application Express development environment in any of the installed languages by simply selecting the language from the Application Builder log in screen or home page. In order to install other languages you must use the apex_4.2.zip file which contains the extra files referenced below.
If you previously downloaded apex_4.2_en.zip, then you do not need to re-install Oracle Application Express. Simply download apex_4.2.zip and unzip the file into the same directory where you unzipped apex_4.2_en.zip. The translated version of Oracle Application Express should be loaded into a database that has a character set that supports the specific language. If you attempt to install a translated version of Oracle Application Express into a database that does not support the character encoding of the language, the installation may fail or the translated Oracle Application Express instance may appear corrupt when run.
The database character set AL32UTF8 supports all the translated versions of Oracle Application Express. You can manually install translated versions of Oracle Application Express using SQL*Plus. The installation files are encoded in AL32UTF8. 3.3.11.1 Installing a Translated Version of Oracle Application Express Whether you are installing for the first time or upgrading from a previous release, you must run the load_ lang.sql script to run a translated version of Oracle Application Express. The installation scripts are located in subdirectories identified by a language code in the unzipped distribution apex/builder.
For example, the German version is located in apex/builder/de and the Japanese version is located in apex/builder/ja. Within each directory, there is a language loading script identified by the language code (for example, load_de.sql or load_ja. Download Mp3 Beyonce Knowles Stand Up For Love. sql).
To install a translated version of Oracle Application Express: • Set the NLS_LANG environment variable, making sure that the character set is AL32UTF8. For example: • Bourne or Korn shell: NLS_LANG=American_America.AL32UTF8 export NLS_LANG • C shell: setenv NLS_LANG American_America.AL32UTF8 • For Windows based systems: set NLS_LANG=American_America.AL32UTF8 • Navigate to the directory under apex/builder based on the language you need to install. For example for German, navigate to apex/builder/de. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Execute the following statement: ALTER SESSION SET CURRENT_SCHEMA = APEX_040200; • Execute the appropriate language specific script. For example: @load_ lang.sql Where lang is the specific language (for example, load_de.sql for German or load_ja.sql for Japanese).
3.3.12 Create a Workspace and Add Oracle Application Express Users You access the Oracle Application Express home page by logging in to a workspace using a Web browser. Your Web browser must have JavaScript enabled. A workspace is a virtual private database allowing multiple users to work within the same Oracle Application Express installation while keeping their objects, data and applications private. Each workspace has a unique ID and name. An instance administrator can create a workspace manually within Oracle Application Express Administration Services or have users submit requests. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. See ' and ' in Oracle Application Express Administration Guide.
3.3.12.1 Creating a Workspace Manually To create an Oracle Application Express workspace manually: • Log in to Oracle Application Express Administration Services. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. You log in using the ADMIN account and password created or reset during the installation process. • In a Web browser, navigate to the Oracle Application Express Administration Services application. Because your setup uses Oracle Application Express Listener, go to: hostname: port/apex/apex_admin Where: hostname is the name of the system where Oracle Application Express Listener is installed.
Port is the port number assigned when configuring the Oracle Application Express Listener. In a default installation, this number is 8080. To learn more, see. Apex is the service name defined when configuring the Oracle Application Express Listener. • On the Login page: • In Username, enter admin.
• In Password, enter the Oracle Application Express administrator account password you specified in. • Click Login to Administration. Note that, depending on your setup, you might be required to change your password when you log in for the first time. See Also: See 'Logging in to Oracle Application Express Administration Services' in.
Next, create a workspace. • Click Manage Workspaces. • Under Workspace Actions, click Create Workspace. The Create Workspace Wizard appears.
• For Identify Workspace, enter the following: • Workspace Name - Enter a unique workspace name. • Workspace ID - Leave Workspace ID blank to have the new Workspace ID automatically generated. A Workspace ID must be a positive integer greater than 100000. • Workspace Description - Enter a workspace description.
• Click Next. • For Identify Schema, specify whether you are re-using an existing schema or creating a new one. If you are using an existing schema: • For Re-use existing schema, select Yes.
• Select a schema from the list. • Click Next. If you are creating a new schema: • For Re-use existing schema, select No. • Enter a schema name and password. • Specify a space quota.
• Click Next. • For Identify Administrator, enter the Workspace administrator information and click Next. • Confirm your selections and click Create Workspace. 3.3.12.2 Creating Oracle Application Express Users To create an Oracle Application Express user account: • Log in to Oracle Application Express Administration Services as described in the previous section. See 'Logging in to Oracle Application Express Administration Services' in. • Click the Manage Workspaces icon. The Administration page appears.
• Click Manage Developers and Users. • Click Create User. The Create User page appears. • Under User Attributes, enter: • Username - Enter the username used to log in to the system. Restrictions include: • Maximum length of 100 characters • No spaces • Only these special characters are permitted: ampersand (@) and period (.) • Email Address - Enter the valid email address for this user. • First Name - Enter the first or given name to further identify the user.
• Last Name - Enter the last or family name to further identify the user. • Description - Enter comments about this user. • Default Date Format - Enter the default Oracle date format for the user. This controls the default date format within SQL Workshop. • Under Account Privileges: • Workspace - Select a workspace from the list.
• Default Schemas - Specify the default schema used for data browsing, application creation, and SQL script execution. When using workspaces that have more than one schema available, this schema is the default. This setting does not control security, only the user's preference. • User is a workspace administrator - Specify if this user should have workspace administrator privileges. Administrators are given access to all components. Additionally, they can manage user accounts, groups, and development services. Components may not be available if they are switched off by Instance Administrators.
• User is a developer - Specify if this user should have developer privileges. Developers must have access to either Application Builder, SQL Workshop, or both. These components may not be available if they are switched off by the Instance Administrator.
• Application Builder Access - Determines whether a developer has access to the Application Builder. • SQL Workshop Access - Determines whether a developer has access to the SQL Workshop. • Team Development Access - Determines whether a developer has access to the Team Development. • Set Account Availability - Select Locked to prevent the account from being used. Select Unlocked to allow the account to be used.
If the user has exceeded the maximum login failures allowed, specified in Workspace Preferences, then their account will be locked automatically. • Under Password: • Password - Enter a case sensitive password. • Confirm Password - Enter the password again. • Require Change of Password On First Use - Select No to allow the user to use the same password until it expires. Select Yes to require the user to change the password immediately when logging in the first time.
• Click Create User or Create and Create Another. See Also: See ' and ' in Oracle Application Express Administration Guide To log in to your workspace: • In a Web browser, navigate to the Oracle Application Express Login page.
Because your setup uses the Oracle Application Express Listener, go to: hostname: port/apex/ Where: • hostname is the name of the system where Oracle Application Express Listener is installed. • port is the port number assigned when configuring the Oracle Application Express Listener. In a default installation, this number is 8080.
To learn more, see. • apex is the service name defined when configuring the Oracle Application Express Listener. The Login page appears. • Under Login, enter the following: • Workspace field - Enter the name of your workspace.
• Username field - Enter your user name. • Password field - Enter your case-sensitive password. • Click Login. Note that, depending on your setup, you might be required to change your password when you log in for the first time. 3.4.2 Download and Install Oracle Application Express To install Oracle Application Express: • For installations where the development will be in English only, download the file apex_4.2_en.zip from the Oracle Application Express download page. Where the development will include languages other than English, download apex_4.2.zip from the Oracle Application Express download page.
See: Note that the actual file name may differ if a more recent release has shipped since this document was published. • Unzip downloaded zip file: • If English only, unzip apex_4.2_en.zip as follows, preserving directory names: • UNIX and Linux: $unzip apex_4.2_en.zip • Windows: Double click the file apex_4.2_en.zip in Windows Explorer • If multiple languages, unzip apex_4.2.zip as follows, preserving directory names: • UNIX and Linux: $unzip apex_4.2.zip • Windows: Double click the file apex_4.2.zip in Windows Explorer. Note: You should keep the directory tree where you unzip the files short and not under directories that contain spaces. For example, within Windows unzip to C: TEMP.
• Change your working directory to apex. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.
For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Disable any existing password complexity rules for the default profile. See 'Configuring Password Protection' in. • Select the appropriate installation option. Full development environment provides complete access to the Application Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified. To learn more, see.
Available installation options include: • Full development environment. Run apexins.sql passing the following four arguments in the order shown: @apexins.sql tablespace_apex tablespace_files tablespace_temp images Where: • tablespace_apex is the name of the tablespace for the Oracle Application Express application user. • tablespace_files is the name of the tablespace for the Oracle Application Express files user. • tablespace_temp is the name of the temporary tablespace or tablespace group.
• images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/. Example: @apexins.sql SYSAUX SYSAUX TEMP /i/. Note: If you receive the following error, please exit SQL*Plus and change your working directory to apex: SP2-0310: unable to open file 'apexins.sql' • Runtime environment. Run apxrtins.sql passing the following arguments in the order shown: @apxrtins.sql tablespace_apex tablespace_files tablespace_temp images Where: • tablespace_apex is the name of the tablespace for the Oracle Application Express application user. • tablespace_files is the name of the tablespace for the Oracle Application Express files user. • tablespace_temp is the name of the temporary tablespace or tablespace group.
• images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/. Example: @apxrtins.sql SYSAUX SYSAUX TEMP /i/. See Also: for more information about SQL*Plus When Oracle Application Express installs, it creates three new database accounts: • APEX_040200 - The account that owns the Oracle Application Express schema and metadata. • FLOWS_FILES - The account that owns the Oracle Application Express uploaded files. • APEX_PUBLIC_USER - The minimally privileged account used for Oracle Application Express configuration with Oracle Application Express Listener or Oracle HTTP Server and mod_plsql.
'This account is created to enable a later switch to a different HTTP server. If you are upgrading from a previous release, then FLOWS_FILES already exists and APEX_PUBLIC_USER is created if it does not already exist. Tip: You use the ADMIN account to log in to Oracle Application Express Administration Services and manage an entire Oracle Application Express instance. To change the password for the ADMIN account: • Change your working directory to the apex directory where you unzipped the installation software. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run apxchpwd.sql. For example: @apxchpwd.sql When prompted, enter a password for the ADMIN account.
Note: If you are upgrading and have previously configured the embedded PL/SQL gateway, skip this section and go to. To run the apex_epg_config.sql configuration script: • Change your working directory to the apex directory where you unzipped the Oracle Application Express software. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run apex_epg_config.sql passing the file system path to the base directory where the Oracle Application Express software was unzipped as shown in the following example: • On Windows: @apex_epg_config.sql SYSTEM_DRIVE: TEMP • On UNIX and Linux: @apex_epg_config.sql / tmp • Enter the following statement to unlock the ANONYMOUS account: ALTER USER ANONYMOUS ACCOUNT UNLOCK. Tip: If you are not upgrading from a prior release of Oracle Application Express, this step is unnecessary. The images will be loaded by running apex_epg_config.sql as described in the prior section.
3.4.4.3 Verifying the Oracle XML DB Protocol Server Port The embedded PL/SQL gateway runs in the Oracle XML DB Protocol Server in the Oracle database. You can determine if the Oracle XML DB Protocol Server is enabled by verifying the associated port number. To verify the port number where the Oracle XML DB Protocol Server is running: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Enter the following statement to verify the port number: SELECT DBMS_XDB.GETHTTPPORT FROM DUAL; If the port number returns 0, the Oracle XML DB Protocol Server is disabled. • To enable it, follow the instructions in. 3.4.4.4 Enabling Oracle XML DB Protocol Server The embedded PL/SQL gateway runs in the Oracle XML DB Protocol Server in the Oracle database. To enable Oracle XML DB Protocol Server: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Enter a statement similar to the following: EXEC DBMS_XDB.SETHTTPPORT( port); For example: EXEC DBMS_XDB.SETHTTPPORT(8080).
3.4.5 Enable Network Services in Oracle Database 11 g By default, the ability to interact with network services is disabled in Oracle Database 11 g Release 1 or 2. Therefore, if you are running Oracle Application Express with Oracle Database 11 g Release 1 or 2, you must use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the APEX_040200 database user.
Failing to grant these privileges results in issues with: • Sending outbound mail in Oracle Application Express. Users can call methods from the APEX_MAIL package, but issues arise when sending outbound email. • Using Web services in Oracle Application Express.
• PDF/report printing. 3.4.5.1 Granting Connect Privileges The following example demonstrates how to grant connect privileges to any host for the APEX_040200 database user. This example assumes you connected to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to '*' and give APEX_040200 -- the 'connect' privilege if APEX_040200 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml', 'ACL that lets power users to connect to everywhere', 'APEX_040200', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*'); END; / COMMIT; The following example demonstrates how to provide less privileged access to local network resources. This example would enable indexing the Oracle Application Express Online Help and could possibly enable email and PDF printing if those servers were also on the local host. DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to 'localhost' and give APEX_040200 -- the 'connect' privilege if APEX_040200 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = 'localhost' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to 'localhost'. WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml', 'ACL that lets users to connect to localhost', 'APEX_040200', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost'); END; / COMMIT. 3.4.5.2 Troubleshooting an Invalid ACL Error If you receive an ORA-44416: Invalid ACL error after running the previous script, use the following query to identify the invalid ACL: REM Show the dangling references to dropped users in the ACL that is assigned REM to '*'. SELECT ACL, PRINCIPAL FROM DBA_NETWORK_ACLS NACL, XDS_ACE ACE WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL AND NACL.ACLID = ACE.ACLID AND NOT EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL); Next, run the following code to fix the ACL: DECLARE ACL_ID RAW(16); CNT NUMBER; BEGIN -- Look for the object ID of the ACL currently assigned to '*' SELECT ACLID INTO ACL_ID FROM DBA_NETWORK_ACLS WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; -- If just some users referenced in the ACL are invalid, remove just those -- users in the ACL.
Otherwise, drop the ACL completely. SELECT COUNT(PRINCIPAL) INTO CNT FROM XDS_ACE WHERE ACLID = ACL_ID AND EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL); IF (CNT >0) THEN FOR R IN (SELECT PRINCIPAL FROM XDS_ACE WHERE ACLID = ACL_ID AND NOT EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL)) LOOP UPDATE XDB.XDB$ACL SET OBJECT_VALUE = DELETEXML(OBJECT_VALUE, '/ACL/ACE[PRINCIPAL=' R.PRINCIPAL ']') WHERE OBJECT_ID = ACL_ID; END LOOP; ELSE DELETE FROM XDB.XDB$ACL WHERE OBJECT_ID = ACL_ID; END IF; END; / REM commit the changes. COMMIT; Once the ACL has been fixed, you must run the first script in this section to apply the ACL to the APEX_040200 user. 3.4.8 About Running Oracle Application Express in Other Languages The Oracle Application Express interface is translated into German, Spanish, French, Italian, Japanese, Korean, Brazilian Portuguese, Simplified Chinese, and Traditional Chinese.
A single instance of Oracle Application Express can be installed with one or more of these translated versions. Developers can choose to run the Application Express development environment in any of the installed languages by simply selecting the language from the Application Builder log in screen or home page. In order to install other languages you must use the apex_4.2.zip file which contains the extra files referenced below.
If you previously downloaded apex_4.2_en.zip, then you do not need to re-install Oracle Application Express. Simply download apex_4.2.zip and unzip the file into the same directory where you unzipped apex_4.2_en.zip. The translated version of Oracle Application Express should be loaded into a database that has a character set that supports the specific language. If you attempt to install a translated version of Oracle Application Express into a database that does not support the character encoding of the language, the installation may fail or the translated Oracle Application Express instance may appear corrupt when run. The database character set AL32UTF8 supports all the translated versions of Oracle Application Express.
You can manually install translated versions of Oracle Application Express using SQL*Plus. The installation files are encoded in AL32UTF8. 3.4.8.1 Installing a Translated Version of Oracle Application Express Whether you are installing for the first time or upgrading from a previous release, you must run the load_ lang.sql script to run a translated version of Oracle Application Express. The installation scripts are located in subdirectories identified by a language code in the unzipped distribution apex/builder. For example, the German version is located in apex/builder/de and the Japanese version is located in apex/builder/ja. Within each of directory, there is a language loading script identified by the language code (for example, load_de.sql or load_ja.sql). To install a translated version of Oracle Application Express: • Set the NLS_LANG environment variable, making sure that the character set is AL32UTF8.
For example: • Bourne or Korn shell: NLS_LANG=American_America.AL32UTF8 export NLS_LANG • C shell: setenv NLS_LANG American_America.AL32UTF8 • For Windows based systems: set NLS_LANG=American_America.AL32UTF8 • Navigate to the directory under apex/builder based on the language you need to install. For example for German, navigate to apex/builder/de. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Execute the following statement: ALTER SESSION SET CURRENT_SCHEMA = APEX_040200; • Execute the appropriate language specific script.
For example: @load_ lang.sql Where lang is the specific language (for example, load_de.sql for German or load_ja.sql for Japanese). 3.4.9 Configuring the SHARED_SERVERS Parameter The embedded PL/SQL gateway uses the shared server architecture of the Oracle database.
To achieve acceptable performance when using the embedded PL/SQL gateway, ensure the SHARED_SERVERS database initialization parameter is set to a reasonable value (that is, not 0 or 1). For a small group of concurrent users, Oracle recommends a value of 5 for SHARED_SERVERS. Consider the following example: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run the following statement: ALTER SYSTEM SET SHARED_SERVERS = 5 SCOPE=BOTH.
3.4.10 Create a Workspace and Add Oracle Application Express Users You access the Oracle Application Express home page by logging in to a workspace using a Web browser. Your Web browser must have JavaScript enabled.
A workspace is a virtual private database allowing multiple users to work within the same Oracle Application Express installation while keeping their objects, data and applications private. Each workspace has a unique ID and name. An instance administrator can create a workspace manually within Oracle Application Express Administration Services or have users submit requests.
Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. See ' and ' in Oracle Application Express Administration Guide.
3.4.10.1 Creating a Workspace Manually To create an Oracle Application Express workspace manually: • Log in to Oracle Application Express Administration Services. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. You log in using the ADMIN account and password created or reset during the installation process. • In a Web browser, navigate to the Oracle Application Express Administration Services application.
Because your setup uses the embedded PL/SQL gateway, go to: hostname: port/apex/apex_admin Where: hostname is the name of the system where Oracle XML DB Protocol server is installed. Port is the port number assigned to HTTP on the Oracle XML DB Protocol server. In a default installation, this number is 8080. Apex is the database access descriptor (DAD) defined in the configuration file. • On the Login page: • In Username, enter admin.
• In Password, enter the Oracle Application Express administrator account password you specified in. • Click Login to Administration.
See Also: See 'Logging in to Oracle Application Express Administration Services' in. Next, create a workspace. • Click Manage Workspaces.
• Under Workspace Actions, click Create Workspace. The Create Workspace Wizard appears. • For Identify Workspace, enter the following: • Workspace Name - Enter a unique workspace name.
• Workspace ID - Leave Workspace ID blank to have the new Workspace ID automatically generated. A Workspace ID must be a positive integer greater than 100000. • Workspace Description - Enter a workspace description. • Click Next.
• For Identify Schema, specify whether you are re-using an existing schema or creating a new one. If you are using an existing schema: • For Re-use existing schema, select Yes. • Select a schema from the list.
• Click Next. If you are creating a new schema: • For Re-use existing schema, select No. • Enter a schema name and password. • Specify a space quota.
• Click Next. • For Identify Administrator, enter the Workspace administrator information and click Next. • Confirm your selections and click Create Workspace. 3.4.10.2 Creating Oracle Application Express Users To create an Oracle Application Express user account: • Log in to Oracle Application Express Administration Services as described in the previous section.
See 'Logging in to Oracle Application Express Administration Services' in. • Click the Manage Workspaces icon. The Administration page appears.
• Click Manage Developers and Users. • Click Create User. The Create User page appears.
• Under User Attributes, enter: • Username - Enter the username used to log in to the system. Restrictions include: • Maximum length of 100 characters • No spaces • Only these special characters are permitted: ampersand (@) and period (.) • Email Address - Enter the valid email address for this user. • First Name - Enter the first or given name to further identify the user. • Last Name - Enter the last or family name to further identify the user. • Description - Enter comments about this user. • Default Date Format - Enter the default Oracle date format for the user.
This controls the default date format within SQL Workshop. • Under Account Privileges: • Workspace - Select a workspace from the list. • Default Schemas - Specify the default schema used for data browsing, application creation, and SQL script execution. When using workspaces that have more than one schema available, this schema is the default. This setting does not control security, only the user's preference. • User is a workspace administrator - Specify if this user should have workspace administrator privileges. Administrators are given access to all components.
Additionally, they can manage user accounts, groups, and development services. Components may not be available if they are switched off by Instance Administrators. • User is a developer - Specify if this user should have developer privileges. Developers must have access to either Application Builder, SQL Workshop, or both. These components may not be available if they are switched off by the Instance Administrator.
• Application Builder Access - Determines whether a developer has access to the Application Builder. • SQL Workshop Access - Determines whether a developer has access to the SQL Workshop. • Team Development Access - Determines whether a developer has access to the Team Development. • Set Account Availability - Select Locked to prevent the account from being used.
Select Unlocked to allow the account to be used. If the user has exceeded the maximum login failures allowed, specified in Workspace Preferences, then their account will be locked automatically. • Under Password: • Password - Enter a case sensitive password. • Confirm Password - Enter the password again. • Require Change of Password On First Use - Select No to allow the user to use the same password until it expires. Select Yes to require the user to change the password immediately when logging in the first time.
• Click Create User or Create and Create Another. See Also: See ' and ' in Oracle Application Express Administration Guide To log in to your workspace: • In a Web browser, navigate to the Oracle Application Express Login page.
Because your setup uses the embedded PL/SQL gateway, go to: hostname: port/apex/ Where: • hostname is the name of the system where Oracle XML DB Protocol server is installed. • port is the port number assigned to HTTP on the Oracle XML DB Protocol server. In a default installation, this number is 8080. • apex is the database access descriptor (DAD) defined in the configuration file.
For users who have upgraded from earlier releases, or who have a custom configuration, this value may be htmldb or something else. Verify your DAD with your Oracle Application Express administrator. The Login page appears. • Under Login, enter the following: • Workspace field - Enter the name of your workspace. • Username field - Enter your user name. • Password field - Enter your case-sensitive password.
• Click Login. Note that, depending on your setup, you might be required to change your password when you log in for the first time. 3.5.2 Download and Install Oracle Application Express To install Oracle Application Express: • For installations where the development will be in English only, download the file apex_4.2_en.zip from the Oracle Application Express download page. Where the development will include languages other than English, download apex_4.2.zip from the Oracle Application Express download page.
See: Note that the actual file name may differ if a more recent release has shipped since this document was published. • Unzip downloaded zip file: • If English only, unzip apex_4.2_en.zip as follows, preserving directory names: • UNIX and Linux: $unzip apex_4.2_en.zip • Windows: Double click the file apex_4.2_en.zip in Windows Explorer • If multiple languages, unzip apex_4.2.zip as follows, preserving directory names: • UNIX and Linux: $unzip apex_4.2.zip • Windows: Double click the file apex_4.2.zip in Windows Explorer. Note: You should keep the directory tree where you unzip the files short and not under directories that contain spaces. For example, within Windows unzip to C: TEMP. • Change your working directory to apex. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.
For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Disable any existing password complexity rules for the default profile. See 'Configuring Password Protection' in.
• Select the appropriate installation option. Full development environment provides complete access to the Application Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified. To learn more, see. Available installation options include: • Full development environment.
Run apexins.sql passing the following four arguments in the order shown: @apexins.sql tablespace_apex tablespace_files tablespace_temp images Where: • tablespace_apex is the name of the tablespace for the Oracle Application Express application user. • tablespace_files is the name of the tablespace for the Oracle Application Express files user. • tablespace_temp is the name of the temporary tablespace or tablespace group.
• images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/. Example: @apexins.sql SYSAUX SYSAUX TEMP /i/. Note: If you receive the following error, please exit SQL*Plus and change your working directory to apex: SP2-0310: unable to open file 'apexins.sql' • Runtime environment.
Run apxrtins.sql passing the following arguments in the order shown: @apxrtins.sql tablespace_apex tablespace_files tablespace_temp images Where: • tablespace_apex is the name of the tablespace for the Oracle Application Express application user. • tablespace_files is the name of the tablespace for the Oracle Application Express files user. • tablespace_temp is the name of the temporary tablespace. • images is the virtual directory for Oracle Application Express images.
To support future Oracle Application Express upgrades, define the virtual image directory as /i/. Example: @apxrtins.sql SYSAUX SYSAUX TEMP /i/. See Also: for more information about SQL*Plus When Oracle Application Express installs, it creates three new database accounts: • APEX_040200 - The account that owns the Oracle Application Express schema and metadata.
• FLOWS_FILES - The account that owns the Oracle Application Express uploaded files. • APEX_PUBLIC_USER - The minimally privileged account used for Oracle Application Express configuration with Oracle Application Express Listener or Oracle HTTP Server and mod_plsql. If you are upgrading from a previous release, then FLOWS_FILES already exists and APEX_PUBLIC_USER is created if it does not already exist. Tip: You use the ADMIN account to log in to Oracle Application Express Administration Services and manage an entire Oracle Application Express instance.
To change the password for the ADMIN account: • Change your working directory to the apex directory where you unzipped the installation software. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run apxchpwd.sql. For example: @apxchpwd.sql When prompted, enter a password for the ADMIN account. Tip: If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary.
To unlock the APEX_PUBLIC_USER account: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run the following statement: ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK. Tip: If you are upgrading from a prior release of Oracle Application Express, this step is unnecessary. To change the password for the APEX_PUBLIC_USER account: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.
For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run the following statement: ALTER USER APEX_PUBLIC_USER IDENTIFIED BY new_password Where new_password is the new password you are setting for APEX_PUBLIC_USER. You will use this password when creating the DAD in the sections that follow. 3.5.5.2.1 About Password Expiration in Oracle Database 11 g In the default profile in Oracle Database 11 g, the parameter PASSWORD_LIFE_TIME is set to 180. If you are using Oracle Database 11 g with Oracle Application Express, this causes the password for APEX_PUBLIC_USER to expire in 180 days. As a result, your Oracle Application Express instance will become unusable until you change the password. To prevent this behavior, create another profile in which the PASSWORD_LIFE_TIME parameter is set to unlimited and alter the APEX_PUBLIC_USER account and assign it to the new profile. 3.5.5.3.1 Copying the Images Directory After an Upgrade During an upgrade, you overwrite your existing images directory.
Before you begin the upgrade, to ensure that you can revert to the previous version, Oracle recommends that you create a copy of your existing images directory for Oracle Application Express, indicating the release number of the images (for example, images_3_1). To locate the images directory on the file system, review the following files for the text alias /i/: • Oracle Application Server 10 g—see the marvel.conf files. • Oracle HTTP Server distributed with Oracle Database 11 g—see the dads.conf files. When you locate the images directory path, copy the existing images directory to a backup location. 3.5.5.3.2 Copying the Images Directory in a New Installation After installation, copy the directory apex/images. • Oracle Application Server 10 g: • On Windows: xcopy /E /I ORACLE_HOME apex images ORACLE_HTTPSERVER_HOME Apache images • On UNIX and Linux: cp -rf $ ORACLE_HOME/apex/images ORACLE_HTTPSERVER_HOME/Apache • Oracle HTTP Server distributed with Oracle Database 11 g: • On Windows: xcopy /E /I ORACLE_HOME apex images ORACLE_HTTPSERVER_HOME ohs images • On UNIX and Linux: cp -rf $ ORACLE_HOME/apex/images ORACLE_HTTPSERVER_HOME/ohs In the preceding syntax examples: • ORACLE_HOME is the directory where the Oracle Application Express software was unzipped, for example C: TEMP if installing on Windows.
• ORACLE_HTTPSERVER_HOME is the existing Oracle Application Server or Oracle HTTP Server Oracle home. 3.5.5.4.1 Editing the dads.conf File If this is a new installation of Oracle Application Express, you must edit the dads.conf or marvel.conf file. The dads.conf file contains the information about the Database Access Descriptor (DAD) to access Oracle Application Express. To edit the dads.conf file: • Use a text editor and open the dads.conf. • Oracle Application Server 10 g: • On Windows see: ORACLE_HTTPSERVER_HOME Apache modplsql conf dads.conf • On UNIX and Linux see: ORACLE_HTTPSERVER_HOME/Apache/modplsql/conf/dads.conf • Oracle HTTP Server distributed with Oracle Database 11 g: • On Windows see: ORACLE_HTTPSERVER_HOME ohs modplsql conf dads.conf • On UNIX and Linux see: ORACLE_HTTPSERVER_HOME/ohs/modplsql/conf/dads.conf • In the dads.conf file, replace ORACLE_HTTPSERVER_HOME, host, port, service_name, and apex_public_user_password with values appropriate for your environment. Note that the apex_public_user_password is the password you changed in. Note that the path listed is only an example.
The path in the dads.conf file should reference the file system path described in. 3.5.5.4.2 Stopping and Restarting Oracle HTTP Server To stop and restart Oracle HTTP Server: • Windows: If database is 10g and lower, execute the following: ORACLE_HTTPSERVER_HOME opmn bin opmnctl stopproc ias-component=HTTP_Server ORACLE_HTTPSERVER_HOME opmn bin opmnctl startproc ias-component=HTTP_Server • UNIX and Linux If database is 10g and lower, execute the following: ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl stopproc ias-component=HTTP_Server ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl startproc ias-component=HTTP_Server.
3.5.5.5 Disabling Oracle XML DB Protocol Server If you were previously using the embedded PL/SQL Gateway and now wish to use Oracle HTTP server and mod_plsql, you need to disable the Oracle XML DB Protocol server. To disable Oracle XML DB Protocol server: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run the following command: EXEC DBMS_XDB.SETHTTPPORT(0). 3.5.6 Enable Network Services in Oracle Database 11 g By default, the ability to interact with network services is disabled in Oracle Database 11 g Release 1 or 2. Therefore, if you are running Oracle Application Express with Oracle Database 11 g Release 1 or 2, you must use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the APEX_040200 database user.
Failing to grant these privileges results in issues with: • Sending outbound mail in Oracle Application Express. Users can call methods from the APEX_MAIL package, but issues arise when sending outbound email. • Using Web services in Oracle Application Express.
• PDF/report printing. 3.5.6.1 Granting Connect Privileges The following example demonstrates how to grant connect privileges to any host for the APEX_040200 database user. Requirements Capture Tools there. This example assumes you connected to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to '*' and give APEX_040200 -- the 'connect' privilege if APEX_040200 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml', 'ACL that lets power users to connect to everywhere', 'APEX_040200', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*'); END; / COMMIT; The following example demonstrates how to provide less privileged access to local network resources. This example would enable indexing the Oracle Application Express Online Help and could possibly enable email and PDF printing if those servers were also on the local host. DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to 'localhost' and give APEX_040200 -- the 'connect' privilege if APEX_040200 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = 'localhost' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to 'localhost'. WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml', 'ACL that lets users to connect to localhost', 'APEX_040200', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost'); END; / COMMIT. 3.5.6.2 Troubleshooting an Invalid ACL Error If you receive an ORA-44416: Invalid ACL error after running the previous script, use the following query to identify the invalid ACL: REM Show the dangling references to dropped users in the ACL that is assigned REM to '*'. SELECT ACL, PRINCIPAL FROM DBA_NETWORK_ACLS NACL, XDS_ACE ACE WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL AND NACL.ACLID = ACE.ACLID AND NOT EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL); Next, run the following code to fix the ACL: DECLARE ACL_ID RAW(16); CNT NUMBER; BEGIN -- Look for the object ID of the ACL currently assigned to '*' SELECT ACLID INTO ACL_ID FROM DBA_NETWORK_ACLS WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; -- If just some users referenced in the ACL are invalid, remove just those -- users in the ACL. Otherwise, drop the ACL completely. SELECT COUNT(PRINCIPAL) INTO CNT FROM XDS_ACE WHERE ACLID = ACL_ID AND EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL); IF (CNT >0) THEN FOR R IN (SELECT PRINCIPAL FROM XDS_ACE WHERE ACLID = ACL_ID AND NOT EXISTS (SELECT NULL FROM ALL_USERS WHERE USERNAME = PRINCIPAL)) LOOP UPDATE XDB.XDB$ACL SET OBJECT_VALUE = DELETEXML(OBJECT_VALUE, '/ACL/ACE[PRINCIPAL=' R.PRINCIPAL ']') WHERE OBJECT_ID = ACL_ID; END LOOP; ELSE DELETE FROM XDB.XDB$ACL WHERE OBJECT_ID = ACL_ID; END IF; END; / REM commit the changes.
COMMIT; Once the ACL has been fixed, you must run the first script in this section to apply the ACL to the APEX_040200 user. 3.5.9 About Running Oracle Application Express in Other Languages The Oracle Application Express interface is translated into German, Spanish, French, Italian, Japanese, Korean, Brazilian Portuguese, Simplified Chinese, and Traditional Chinese. A single instance of Oracle Application Express can be installed with one or more of these translated versions. Developers can choose to run the Application Express development environment in any of the installed languages by simply selecting the language from the Application Builder log in screen or home page. In order to install other languages you must use the apex_4.2.zip file which contains the extra files referenced below.
If you previously downloaded apex_4.2_en.zip, then you do not need to re-install Oracle Application Express. Simply download apex_4.2.zip and unzip the file into the same directory where you unzipped apex_4.2_en.zip. The translated version of Oracle Application Express should be loaded into a database that has a character set that supports the specific language. If you attempt to install a translated version of Oracle Application Express into a database that does not support the character encoding of the language, the installation may fail or the translated Oracle Application Express instance may appear corrupt when run. The database character set AL32UTF8 supports all the translated versions of Oracle Application Express.
You can manually install translated versions of Oracle Application Express using SQL*Plus. The installation files are encoded in AL32UTF8. 3.5.9.1 Installing a Translated Version of Oracle Application Express Whether you are installing for the first time or upgrading from a previous release, you must run the load_ lang.sql script to run a translated version of Oracle Application Express. The installation scripts are located in subdirectories identified by a language code in the unzipped distribution apex/builder. For example, the German version is located in apex/builder/de and the Japanese version is located in apex/builder/ja. Within each of directory, there is a language loading script identified by the language code (for example, load_de.sql or load_ja.sql).
To install a translated version of Oracle Application Express: • Set the NLS_LANG environment variable, making sure that the character set is AL32UTF8. For example: • Bourne or Korn shell: NLS_LANG=American_America.AL32UTF8 export NLS_LANG • C shell: setenv NLS_LANG American_America.AL32UTF8 • For Windows based systems: set NLS_LANG=American_America.AL32UTF8 • Navigate to the directory under apex/builder based on the language you need to install.
For example for German, navigate to apex/builder/de. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Execute the following statement: ALTER SESSION SET CURRENT_SCHEMA = APEX_040200; • Execute the appropriate language specific script.
For example: @load_ lang.sql Where lang is the specific language (for example, load_de.sql for German or load_ja.sql for Japanese). 3.5.11 Create a Workspace and Add Oracle Application Express Users You access the Oracle Application Express home page by logging in to a workspace using a Web browser. Your Web browser must have JavaScript enabled. A workspace is a virtual private database allowing multiple users to work within the same Oracle Application Express installation while keeping their objects, data and applications private. Each workspace has a unique ID and name.
An instance administrator can create a workspace manually within Oracle Application Express Administration Services or have users submit requests. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance.
See ' and ' in Oracle Application Express Administration Guide. 3.5.11.1 Creating a Workspace Manually To create an Oracle Application Express workspace manually: • Log in to Oracle Application Express Administration Services. Oracle Application Express Administration Services is a separate application for managing an entire Oracle Application Express instance. You log in using the ADMIN account and password created or reset during the installation process. • In a Web browser, navigate to the Oracle Application Express Administration Services application. Because your setup uses Apache and mod_plsql, go to: hostname: port/pls/apex/apex_admin Where: hostname is the name of the system where Oracle HTTP Server is installed. Port is the port number assigned to Oracle HTTP Server.
In a default installation, this number is 7777. Pls is the indicator to use the mod_plsql cartridge. Apex is the database access descriptor (DAD) defined in the mod_plsql configuration file. • On the Login page: • In Username, enter admin. • In Password, enter the Oracle Application Express administrator account password you specified in. • Click Login to Administration.
See Also: See 'Logging in to Oracle Application Express Administration Services' in. Next, create a workspace. • Click Manage Workspaces. • Under Workspace Actions, click Create Workspace. The Create Workspace Wizard appears. • For Identify Workspace, enter the following: • Workspace Name - Enter a unique workspace name. • Workspace ID - Leave Workspace ID blank to have the new Workspace ID automatically generated.
A Workspace ID must be a positive integer greater than 100000. • Workspace Description - Enter a workspace description. • Click Next. • For Identify Schema, specify whether you are re-using an existing schema or creating a new one. If you are using an existing schema: • For Re-use existing schema, select Yes. • Select a schema from the list.
• Click Next. If you are creating a new schema: • For Re-use existing schema, select No. • Enter a schema name and password. • Specify a space quota. • Click Next.
• For Identify Administrator, enter the Workspace administrator information and click Next. • Confirm your selections and click Create Workspace. 3.5.11.2 Creating Oracle Application Express Users To create an Oracle Application Express user account: • Log in to Oracle Application Express Administration Services as described in the previous section. See 'Logging in to Oracle Application Express Administration Services' in. • Click the Manage Workspaces icon.
The Administration page appears. • Click Manage Developers and Users.
• Click Create User. The Create User page appears. • Under User Attributes, enter: • Username - Enter the username used to log in to the system. Restrictions include: • Maximum length of 100 characters • No spaces • Only these special characters are permitted: ampersand (@) and period (.) • Email Address - Enter the valid email address for this user. • First Name - Enter the first or given name to further identify the user. • Last Name - Enter the last or family name to further identify the user.
• Description - Enter comments about this user. • Default Date Format - Enter the default Oracle date format for the user. This controls the default date format within SQL Workshop. • Under Account Privileges: • Workspace - Select a workspace from the list.
• Default Schemas - Specify the default schema used for data browsing, application creation, and SQL script execution. When using workspaces that have more than one schema available, this schema is the default.
This setting does not control security, only the user's preference. • User is a workspace administrator - Specify if this user should have workspace administrator privileges. Administrators are given access to all components. Additionally, they can manage user accounts, groups, and development services. Components may not be available if they are switched off by Instance Administrators. • User is a developer - Specify if this user should have developer privileges.
Developers must have access to either Application Builder, SQL Workshop, or both. These components may not be available if they are switched off by the Instance Administrator.
• Application Builder Access - Determines whether a developer has access to the Application Builder. • SQL Workshop Access - Determines whether a developer has access to the SQL Workshop. • Team Development Access - Determines whether a developer has access to the Team Development. • Set Account Availability - Select Locked to prevent the account from being used. Select Unlocked to allow the account to be used. If the user has exceeded the maximum login failures allowed, specified in Workspace Preferences, then their account will be locked automatically.
• Under Password: • Password - Enter a case sensitive password. • Confirm Password - Enter the password again.
• Require Change of Password On First Use - Select No to allow the user to use the same password until it expires. Select Yes to require the user to change the password immediately when logging in the first time.
• Click Create User or Create and Create Another. See Also: See ' and ' in Oracle Application Express Administration Guide To log in to your workspace: • In a Web browser, navigate to the Oracle Application Express Login page. Because your setup uses the HTTP server, go to: hostname: port/pls/apex/ Where: • hostname is the name of the system where Oracle HTTP Server is installed. • port is the port number assigned to the Oracle HTTP Server. In a default installation, this number is 7777. • pls is the indicator to use the mod_plsql cartridge. • apex is the database access descriptor (DAD) defined in the configuration file.
For users who have upgraded from earlier releases, or who have a custom configuration, this value may be htmldb or something else. Verify your DAD with your Oracle Application Express administrator. The Login page appears.
• Under Login, enter the following: • Workspace field - Enter the name of your workspace. • Username field - Enter your user name. • Password field - Enter your case-sensitive password. • Click Login. Note that, depending on your setup, you might be required to change your password when you log in for the first time. 3.6.1.1 Verify if a Prior Installation Exists To verify if a prior installation exists: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS. 3.6.1.2 Remove Schemas from Prior Installations To remove schemas from prior installations: • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.
For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Execute a statement similar to the following example: DROP USER FLOWS_030000 CASCADE. 3.6.2 Fix Invalid ACL in Oracle Database 11g After following the instructions in, you may need to fix an invalid ACL if you are running Oracle Database 11 g and you enabled network services for the prior Oracle Application Express schema. To fix an invalid ACL: • Change your working directory to the apex directory where you unzipped the installation software. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Execute a statement similar to following: EXEC DBMS_NETWORK_ACL_ADMIN.DELETE_PRIVILEGE('power_users.xml', 'FLOWS_030000'). 3.7 Performance Optimization Tasks Performance of web applications heavily depend on their size and how often a browser has to request static content like images, CSS and JavaScript files.
To improve performance, most web servers allow you to enable on-the-fly file compression and settings on how long browsers can cache a file. Please see your web server manual on how to enable gzip compression and setting the expired header attribute for optimal performance of your Application Express application. 3.8 About the Oracle Application Express Runtime Environment The Oracle Application Express runtime environment enables users to run a production application without supporting the ability to change or edit the application. It includes only the packages necessary to run your applications, making it a more hardened environment. It does not provide a Web interface for administration. You administer the Oracle Application Express runtime environment using SQL*Plus or SQL Developer and the APEX_INSTANCE_ADMIN API. To learn more see, 'Managing a Runtime Environment' and in.
3.8.1 Converting a Runtime Environment to a Full Development Environment To convert an Oracle Application Express runtime environment to a full development environment: • Change your working directory to the apex directory where you unzipped the installation software. • Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run apxdvins.sql. For example: @apxdvins.sql • Follow the instructions in. 3.8.2 Converting a Full Development Environment to a Runtime Environment Export all Websheet applications prior to converting a full development environment to a runtime environment. When you convert a development environment to runtime, existing Websheet data grids and reports will be deleted from all workspaces.
Converting the environment back to a full development environment will not restore these Websheet data grids or reports. To convert an Oracle Application Express full development environment to a runtime environment: • Change your working directory to the apex directory where you unzipped the installation software.
• Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example: • On Windows: SYSTEM_DRIVE: sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • On UNIX and Linux: $ sqlplus /nolog SQL>CONNECT SYS as SYSDBA Enter password: SYS_password • Run apxdevrm.sql. For example: @apxdevrm.sql.
Installing PLSQL packages for DBMS_NETWORK_ACL_ADMIN You can check whether they exist first, run this as user sys: select * from dba_objects where name =. If they don't exist on Oracle RDBMS (I don't know whether maybe express edition excludes them, but that seems illogical), your database is not installed well. The easiest way is to re-install the database.
In that case you don't need to replace the software, only create a new database. The advanced way is to reinstall parts of the data dictionary. If you have never done it before, you can assume that the database will end up corrupt. You can try for instance executing?/dbs/catqm.sql. By the path where ORACLE_HOME lives and then rdbms/admin. Such as $ORACLE_HOME/rdbms/admin on Linux.
Remember to close the database for other users. Maintaining ACL The extra comments led to the conclusion that ACL are missing. This is the approach I use to maintain them in a package. Please be careful, even 11.2.0.3 has a bad habit of often crashing the session of the connected user on ACL maintenance despite preventive measures. This script allows access to all ports between 1 and 32767. You probably want to restrict this to applicable ports for your application. For ease of use I've pasted it here for all 32K ports.
Maintenance of ACL can be non-trivial and can lead to security risks (which we gracefully accepted upto release 11 of Oracle:-). Involve your sysadmin or networkadmin in case of doubt. -- -- When ORA-24247 errors continue despite creation of a network ACL, -- first remove the ACL fully as user SYS using: -- -- begin -- dbms_network_acl_admin.drop_acl('/sys/acls/invantive-producer.xml'); -- end; -- -- This occurs incidentally on Oracle 11g R1. -- prompt Create Access Control Lists.
Declare l_principal varchar2(30):= upper('&&itgen_user_owner_login'); l_acl varchar2(300); l_acl_full_path varchar2(300); l_dummy pls_integer; -- -- To temporary disable this code, sometimes it causes installation -- issues. -- l_skip_acl_maintenance boolean:= false; -- -- To temporarily disable granting the ACL access. -- l_skip_acl_grants boolean:= false; begin l_acl:= 'invantive-producer.xml'; l_acl_full_path:= '/sys/acls/' l_acl; -- if not l_skip_acl_maintenance then -- -- Drop superfluous network ACLs for users and roles that no longer exist. -- -- Dropping network ACLs is tricky. Queries on the view dba_network_acls -- often lead to ORA-600.
This query seems to work reliable on Oracle 11g R1. -- -- First delete all ACL privileges for which no ACL exists. -- During this, we will ignore problems.
-- for r in ( select nae.acl, nae.principal from dba_network_acl_privileges nae where nae.principal not in ( select usr.username from dba_users usr union all select rle.role from dba_roles rle ) ) loop begin dbms_network_acl_admin.delete_privilege ( r.acl, r.principal ); dbms_output.put_line('Dropped superfluous ACL ' r.acl ' for ' r.principal '.' ); exception when others then dbms_output.put_line('Ignoring error ' sqlerrm); end; end loop; -- -- Then try another time, not ignoring problems. -- for r in ( select nae.acl, nae.principal from dba_network_acl_privileges nae where nae.principal not in ( select usr.username from dba_users usr union all select rle.role from dba_roles rle ) ) loop dbms_network_acl_admin.delete_privilege ( r.acl, r.principal ); dbms_output.put_line('Dropped superfluous ACL ' r.acl ' for ' r.principal '.' ); end loop; -- -- Now create new network ACL when it does not yet exist.
-- begin select 1 into l_dummy from resource_view rvw where rvw.any_path = l_acl_full_path; dbms_output.put_line('ACL ' l_acl ' already present. ); exception when no_data_found then dbms_network_acl_admin.create_acl ( acl =>l_acl, description =>'Normal Access by Invantive Producer', principal =>'SYS', is_grant =>true, privilege =>'connect', start_date =>null, end_date =>null ); dbms_network_acl_admin.assign_acl ( acl =>l_acl, host =>'*', lower_port =>1 /* ATTENTION! You may want to tighten this! */, upper_port =>32767 /* ATTENTION! You may want to tighten this! */ ); dbms_output.put_line('Created ACL ' l_acl ' for port 1 till 32767.' ); end; else dbms_output.put_line('Skipped maintenance of Access Control Lists.'
); end if; -- if not l_skip_acl_grants then -- -- Update the privilges for the ACL when not correct. -- for r_usr in ( select l_principal principal from dual union all -- -- Any unspecified Invantive schema.
-- -- For SYS, itgen_schemas_r can contain multiple rows. -- select sma_r.name principal from itgen_schemas_r sma_r ) loop begin select 1 into l_dummy from dba_network_acl_privileges nae where nae.acl = l_acl_full_path and nae.principal = r_usr.principal and nae.privilege = 'connect' and nae.is_grant = 'true' and nae.invert = 'false' and nae.start_date is null and nae.end_date is null; dbms_output.put_line('Connect privileges already granted to ' l_principal '.
); exception when no_data_found then dbms_network_acl_admin.add_privilege ( acl =>l_acl, principal =>l_principal, is_grant =>true, privilege =>'connect', start_date =>null, end_date =>null ); dbms_output.put_line('Connect privileges granted to ' l_principal '.' ); end; end loop; -- commit; else dbms_output.put_line('Skipped grants of Access Control Lists.' ); end if; end; /.