Oracle Embedded PL/SQL Gateway
To use the Embedded PL/SQL Gateway for APEX...
Assume APEX related variables are set correctly in the .profile.cd ${APXDIR}/apex
sqlplus / as sysdba @apex_epg_config.sql ${APXDIR}
ALTER USER ANONYMOUS ACCOUNT UNLOCK;
To confirm which HTTP Port to connect to (this port will also support EM Database Express for 12c)...
select DBMS_XDB.GETHTTPPORT from dual;
If it is set to "0", or you need to change the value, use..
The port can be set to any unused port of your choosing, common choices are 8080 or 9090EXEC DBMS_XDB.sethttpport(8080);
The URL will be of the form...
http://myserver:8080/apex
http://myserver:8080/apex/f?p=4550:1
To disable HTTP on the Oracle XML DB Protocol Server (e.g. to prevent end user access during an APEX upgrade):
Note the current HTTP Portselect DBMS_XDB_CONFIG.GETHTTPPORT from dual;
EXEC DBMS_XDB.SETHTTPPORT(0);
connect / as sysdba
EXEC DBMS_EPG.CREATE_DAD('TEST','/apps/*');
EXEC DBMS_EPG.SET_DAD_ATTRIBUTE('TEST','database-username','SCOTT');
EXEC DBMS_EPG.AUTHORIZE_DAD('TEST','SCOTT');
EXEC DBMS_EPG.AUTHORIZE_DAD('TEST');
connect scott
create or replace procedure hello AS
BEGIN
htp.htmlopen; -- generates <HTML>
htp.headopen; -- generates <HEAD>
htp.title('Hello'); -- generates <TITLE>Hello</TITLE>
htp.headclose; -- generates </HEAD>
htp.bodyopen; -- generates <BODY>
htp.header(1, 'Hello World ' ||SYSTIMESTAMP); -- generates <H1> Hello World </H1>
htp.bodyclose; -- generates </BODY>
htp.htmlclose; -- generates </HTML>
END;
/
If you connect to http://yourserver:8080/apps/hello then you should see a page showing "Hello World" following by a Timestamp.
@$ORACLE_HOME/rdbms/admin/epgstat
Example output from a working installation...
+--------------------------------------+| XDB protocol ports: || XDB is listening for the protocol || when the protocol port is non-zero. |+--------------------------------------+SHOW PARAMETER SHARED_SERVERS
If necessary...
alter system set shared_servers = 10 scope=both;
exec dbms_xdb_config.setListenerLocalAccess (l_access => FALSE);
For 11g and earlier use this instead...
exec dbms_xdb.setListenerLocalAccess (l_access => FALSE);
lsnrctl stat ${LISTENER_NAME} | grep HTTP