0% found this document useful (0 votes)
192 views3 pages

Ords

This document contains SQL commands and scripts to configure an Oracle Application Express (APEX) instance, Oracle REST Data Services (ORDS), and set up authentication and authorization. It creates an APEX tablespace, runs APEX installation scripts, configures the ORDS port and APEX port, unlocks users, enables object access, defines roles and privileges, and sets up SSL.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views3 pages

Ords

This document contains SQL commands and scripts to configure an Oracle Application Express (APEX) instance, Oracle REST Data Services (ORDS), and set up authentication and authorization. It creates an APEX tablespace, runs APEX installation scripts, configures the ORDS port and APEX port, unlocks users, enables object access, defines roles and privileges, and sets up SSL.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

SELECT STATUS FROM DBA_REGISTRY WHERE COMP_ID = 'APEX';

CREATE TABLESPACE apex DATAFILE SIZE 500M AUTOEXTEND ON NEXT 1M;


@apexins apex apex temp /i/
@apxchpwd.sql gfsaA$4818
-- Change default port 8080, we will use for apache tomcat
exec dbms_xdb.sethttpport(8181)
@apex_rest_config.sql gfsaA$4818 gfsaA$4818
@apex_epg_config.sql c:\tmp
@apex_epg_config.sql c:\TEMP

@apex_epg_config.sql C:\oraclexe\apex

<role rolename=�manager-gui�/>
<user username=�tomcat� password=�Abc1234$#� roles=�manager-gui�/>
<role rolename=�admin-gui�/>
<user username=�tomcat� password=�Abc1234$#� roles=�admin-gui�/>

http://localhost:8181/apex
-----------
ALTER USER SYS IDENTIFIED BY password ACCOUNT UNLOCK;
ALTER USER SYS IDENTIFIED BY xx ACCOUNT UNLOCK CONTAINER=ALL;
--ALTER SESSION SET CONTAINER = pdb1;
ALTER USER APEX_LISTENER IDENTIFIED BY gfsaA$4818 ACCOUNT UNLOCK;
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY gfsaA$4818 ACCOUNT UNLOCK;
ALTER USER APEX_REST_PUBLIC_USER IDENTIFIED BY gfsaA$4818 ACCOUNT UNLOCK;
ALTER USER ORDS_PUBLIC_USER IDENTIFIED BY gfsaA$4818 ACCOUNT UNLOCK;
------------------
ALTER USER APEX_INSTANCE_ADMIN_USER IDENTIFIED BY gfsaA$4818 ACCOUNT UNLOCK;
ALTER USER FLOWS_FILES IDENTIFIED BY gfsaA$4818 ACCOUNT UNLOCK;
ALTER USER APEX_180200 IDENTIFIED BY gfsaA$4818 ACCOUNT UNLOCK;

java -jar ords.war uninstall


java -jar ords.war
copy all /tmp/apex/images/* $CATALINA_HOME/webapps/i/
copy ords.war $CATALINA_HOME/webapps/
----------
http://localhost:8080/ords/

java -jar ords.war setup --database orclpdb


java -jar ords.war map-url --type base-path /orclpdb orclpdb
BEGIN
ORDS.enable_object (
p_enabled => TRUE,
p_schema => 'TESTUSER2',
p_object => 'PROC1',
p_object_type => 'PROCEDURE',
p_object_alias => 'proc1'
);

COMMIT;
END;
/
CREATE OR REPLACE PROCEDURE proc1(x number,y out varchar2) AS
y1 varchar2(20);
y2 varchar2(20);
y3 varchar2(20);
BEGIN
select ename into y1 from emp where empno=x;
update emp set ename='gami' where empno=x;
select ename into y2 from emp where empno=x;
commit;
select ename into y3 from emp where empno=x;
y:=y1||'*'||y2||'*'||y3;
END;
/
curl -i -X POST --data-binary @c:\tmp\empty-payload.json -H "Content-Type:
application/json" http://localhost:8080/ords/orclpdb/testuser2/proc1/

BEGIN
ORDS.create_role(
p_role_name => 'emp_role'
);

COMMIT;
END;
/
DECLARE
l_arr OWA.vc_arr;
BEGIN
l_arr(1) := 'emp_role';

ORDS.define_privilege (
p_privilege_name => 'emp_priv',
p_roles => l_arr,
p_label => 'EMP Data',
p_description => 'Allow access to the EMP data.'
);

COMMIT;
END;
/
BEGIN
ORDS.create_privilege_mapping(
p_privilege_name => 'emp_priv',
p_pattern => '/testuser2/*'
);

COMMIT;
END;
/
java -jar ords.war user emp_user emp_role

http://localhost:8080/ords/orclpdb/testuser2/proc1/
http://desktop-870u604:8080/ords/orclpdb/testuser2/func1/

exec ords.enable_schema(p_schema => 'HR', p_url_mapping_type => 'BASE_PATH',


p_url_mapping_pattern => 'hr');
commit;
----exec ords.define_service(p_module_name => 'examples.routes', p_base_path =>
'/examples/routes/', p_pattern => 'greeting/:name', p_source => 'select ''Hello ''
|| :name || '' from '' || nvl(:whom,sys_context(''USERENV'',''CURRENT_USER''))
"greeting" from dual');
SQL> show user
USER is "HR"
exec ords.define_service(p_module_name => 'examples', p_base_path => 'examples/',
p_method => 'GET', p_pattern => 'greeting/', p_source => 'select sysdate from
dual');

curl https://localhost:8443/ords/orclpdb/hr/examples/greeting/

keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -dname


"CN=`localhost`, OU=IT, O=saba, L=Birmingham, ST=West Midlands, C=GB"-storepass
gfsaA1 -validity 3600 -keysize 2048 -keypass gfsaA1

You might also like