SQL> select dbms_xdb.getHTTPPort from dual;
Now if we see any result then fine else we can set the HTTP port by executing the below code:
EXEC dbms_xdb.sethttpport(8082);
Now if we open the URL on our local we will see the below screen for login:
Connected to Oracle Database 11g Release 11.2.0.1.0
Connected as SYS
SQL> SELECT comp_name, version, status FROM dba_registry WHERE comp_id='APEX';
COMP_NAME VERSION STATUS
------------------------------------------------------------------------
Oracle Application Express 3.2.1.00.10 VALID
SQL> select dbms_xdb.getHTTPPort from dual;
GETHTTPPORT
-----------
8082
Connected to Oracle Database 11g Release 11.2.0.1.0
Connected as SYS
SQL> EXEC dbms_xdb.sethttpport(0);
PL/SQL procedure successfully completed
SQL>
CREATE TABLESPACE APEX DATAFILE 'E:\app\sloba\oradata\db11gr2\apex_01.dbf'
SIZE 200M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 1000M LOGGING
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
You can ignore the above step if you want to use APEX on any specific table space already created for your schema. to start the installation we have to execute the script
apexins that is present under APEX folder:
Directory of E:\app\sloba\product\11.2.0\dbhome_1\apex
01/20/2015 05:38 PM <DIR> .
01/20/2015 05:38 PM <DIR> ..
03/02/2013 07:19 AM 5,882 apexins.sql
To execute this script we need to pass some parameters:
@apexins <apex_tbs> <apex_files_tbs> <temp_tbs> <images>
Details on the parameter are as below:
E:\app\sloba\product\11.2.0\dbhome_1\apex>sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 20 18:00:43 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
SQL>
SQL> @apexins APEX APEX TEMP /i/
Disconnected from Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
Now change the ADMIN password by running
apxchpwd.sql. Login to Oracle as SYS user and run the script to change the password :
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 20 18:24:47 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
SQL>@apxchpwd
Make sure you follow this set of rules to create a new password for ADMIN user:
* Password must contain at least 6 characters.
* Password must contain at least one numeric character (0123456789).
* Password must contain at least one punctuation character
(!"#$%&()``*+,-/:;?_).
* Password must contain at least one upper-case alphabetic character.
* Password must not contain username.
SQL> @apxchpwd
Enter a value below for the password for the Application Express ADMIN user.
Enter a password for the ADMIN user []
Session altered.
...changing password for ADMIN
PL/SQL procedure successfully completed.
SQL> SELECT comp_name, version, status FROM dba_registry WHERE comp_id='APEX';
COMP_NAME VERSION STATUS
------------------------------ ----------------------------------
Oracle Application Express 4.2.6.00.03 VALID
From the above you can see that the version is changed from 3.2.1.00.10 to 4.2.6.00.03 and the status says it’s valid. Now run the Embedded PL/SQL Gateway configuration by executing the below scripts under SYS user:
SQL> @apex_epg_config.sql E:\app\sloba\product\11.2.0\dbhome_1
SQL> @apxldimg.sql E:\app\sloba\product\11.2.0\dbhome_1
Connected to Oracle Database 11g Release 11.2.0.1.0
Connected as SYS
SQL>
SQL> ALTER USER anonymous ACCOUNT UNLOCK;
User altered
SQL> ALTER USER xdb ACCOUNT UNLOCK;
User altered
SQL> ALTER USER apex_public_user ACCOUNT UNLOCK;
User altered
SQL> ALTER USER flows_files ACCOUNT UNLOCK;
User altered
SQL>
Configure the database parameters for using APEX:
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;
/
Execution:
Connected to Oracle Database 11g Release 11.2.0.1.0
Connected as SYS
SQL>
SQL> DECLARE
2 ACL_PATH VARCHAR2(4000);
3 BEGIN
4 -- Look for the ACL currently assigned to '*' and give APEX_040200
5 -- the "connect" privilege if APEX_040200
6 -- does not have the privilege yet.
7 SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
8 WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
9 IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200',
10 'connect') IS NULL THEN
11 DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
12 'APEX_040200', TRUE, 'connect');
13 END IF;
14 EXCEPTION
15 -- When no ACL has been assigned to '*'.
16 WHEN NO_DATA_FOUND THEN
17 DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
18 'ACL that lets power users to connect to everywhere',
19 'APEX_040200', TRUE, 'connect');
20 DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
21 END;
22 /
PL/SQL procedure successfully completed
SQL> COMMIT;
Commit complete
SQL>
Go the browser and check if we are able to open the application or not:
http://localhost:8082/apex/apex_admin
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)