Professional Documents
Culture Documents
Install Oracle REST Data Services (ORDS) For Oracle APEX
Install Oracle REST Data Services (ORDS) For Oracle APEX
Install Oracle REST Data Services (ORDS) For Oracle APEX
1- Introduction
2- What is Oracle REST Data Services?
3- Interaction between Oracle and Oracle APEX ORDS
4- Download Oracle ORDS
5- Config ORDS for APEX
6- Deploying ORDS
1- Introduction
Ti liu c vit da trn:
Oracle 11g, 12c
ORDS 3.x
2- What is Oracle REST Data Services?
Oracle REST Data Services (ORDS) is a data service which is used to replace Oracle HTTP server
and mod_plsql. It bases on Java EE that provides RESTful service and increases security capability. it
can deploy on WebLogic, Tomcat, Glassfish or independently.
3- Interaction between Oracle and Oracle APEX ORDS
Normally, there are two ways to install Oracle APEX.
Method 1: Configure the Embedded PL/SQL Gateway: This is the way to configure Oracle
APEX which can run onOracle XML DB HTTP Server, it is a HTTP that is available when you install
Oracle 11g or higher.
Method 2: Install Oracle APEX on a specific web server such as WebLogic, Tomcat or Glassfish, ...
Run command to grant connect privileges to any host for the APEX_050000 database user.
?
1
2
3 Declare
4 Acl_Path Varchar2(4000);
5 Begin
6 -- Look for the ACL currently assigned to '*' and give APEX_050000
-- the "connect" privilege if APEX_050000 does not have the privilege yet.
7 Select Acl
8 Into Acl_Path
9 From Dba_Network_Acls
10
Where Host = '*'
11
And Lower_Port Is Null
12
And Upper_Port Is Null;
13 If Dbms_Network_Acl_Admin.Check_Privilege(Acl_Path
14 ,'APEX_050000'
15 ,'connect') Is Null Then
16 Dbms_Network_Acl_Admin.Add_Privilege(Acl_Path
,'APEX_050000'
17 ,True
18 ,'connect');
19 End If;
20 Exception
21 -- When no ACL has been assigned to '*'.
When No_Data_Found Then
22 Dbms_Network_Acl_Admin.Create_Acl('power_users.xml'
23 ,'ACL that lets power users to connect to
24 everywhere'
25 ,'APEX_050000'
,True
26
,'connect');
27 Dbms_Network_Acl_Admin.Assign_Acl('power_users.xml'
28 ,'*');
29 End;
30 /
31
Commit;
32
33
34
Grant connect for APEX_050000 user (If database is Oracle 11g):
?
1 Declare
2 Acl_Path Varchar2(4000);
Begin
3 -- Look for the ACL currently assigned to '*' and give APEX_050000
4 -- the "connect" privilege if APEX_050000
5 --does not have the privilege yet.
6 Select Acl
7 Into Acl_Path
8 From Dba_Network_Acls
9 Where Host = '*'
10 And Lower_Port Is Null
11 And Upper_Port Is Null;
12 If Dbms_Network_Acl_Admin.Check_Privilege(Acl_Path
,'APEX_050000'
13 ,'connect') Is Null Then
14 Dbms_Network_Acl_Admin.Add_Privilege(Acl_Path
15 ,'APEX_050000'
16 ,True
17 ,'connect');
End If;
18 Exception
19 -- When no ACL has been assigned to '*'.
20 When No_Data_Found Then
21 Dbms_Network_Acl_Admin.Create_Acl('power_users.xml'
,'ACL that lets power users to connect to
22 everywhere'
23 ,'APEX_050000'
24 ,True
25 ,'connect');
26 Dbms_Network_Acl_Admin.Assign_Acl('power_users.xml'
,'*');
27 End;
28 /
29
30 Commit;
31
32
33
34
Grant connect for APEX_050000 user (If database is Oracle 12c):
Procedures CREATE_ACL, ASSIGN_ACL, ADD_PRIVILEGE and CHECK_PRIVILEGE in
DBMS_NETWORK_ACL_ADMIN are deprecated in Oracle Database 12c. Oracle recommends using
APPEND_HOST_ACE instead.
?
1
-- S dng cho Oracle 12c.
2
3
BEGIN
4 DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
5 host => '*',
6 ace => xs$ace_type(privilege_list => xs$name_list('connect'),
7 principal_name => 'APEX_050000',
principal_type => xs_acl.ptype_db));
8 END;
9 /
10
6- Deploying ORDS
Note: you must sure that you have installed Jave version 7 or higher and declare PATH variable. You
can see how to install Java at:
http://o7planning.org/en/10377/installing-and-configuring-java
Add the path to bin folder of Java at the end of PATH
;C:\DevPrograms\Java\jdk1.8.0_65\bin
Unzip the file ord - **. zip that you have downloaded to a folder
You can see that in the folder unzipped have ords.war file
Now, we will install Oracle ORDS independently (It is not necessary to deploy on Weblogic, Tomcat or
other web server)
CD to ords folder:
Next, login sqlplus as sysdba.
Your Oracle APEX is running on Oracle XML DB HTTP Server, you should disable it with the
command:
?
1 -- Disable Oracle APEX on Oracle XML DB HTTP Server.
2
3 EXEC DBMS_XDB.SETHTTPPORT(0);
4
5
6 -- Note: You can enable it with command:
7
8 EXEC DBMS_XDB.SETHTTPPORT(8080)
Exit sqlplus. And CD to ords:
Run command:
?
1 # Run command:
2
3 java -jar ords.war
4
5 # Or:
6
7 java -jar ords.war install
Enter the address of the machine that contains the database (default is localhost):
SQLPlus will ask whether you use Oracle APEX or not, if yes let's enter 1, then press "enter" to
continue.
Entering a password for user will be created (APEX_PUBLIC_USER):
Next, enter 1 to specify password for 2 newly created user database (APEX_LISTENER,
APEX_REST_PUBLIC_USER).
Select 1 to start ORDS in standalone mode:
For the 1st time, it will ask where to place configure file:
ORDS has been successfully deployed.
Don't close the window above, you can use APEX with new url:
http://localhost:8080/ords