Welcome to Salem Houali ‘s Oracle Developer Notes

Install and use ORDS with Oracle Database12c

Based on Oracle® REST Data Services Release 18.2
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bits

SODA for REST uses the representational state transfer (REST) architectural style to implement Simple Oracle Document Access (SODA). You can use this API to perform create, read, update, and delete (CRUD) operations on documents of any kind, and you can use it to query JSON documents.

Installing SODA for REST

1. Ensure that you have one of the following Oracle Database releases installed:
• Oracle Database 12c Release 2 (12.2) or later
• Oracle Database 12c Release 1 (12.1.0.2) with Merge Label Request (MLR) bundle patch 20885778
(patch 20885778 obsoletes patch 20080249) Obtain this patch from My Oracle Support (My Oracle Support).
2. Start the database.
3. Download Oracle REST Data Services (ORDS), and extract the zip file.
4. Configure ORDS.


java -jar C:\ORDS\ords.war
Specify a Folder for ORDS-data configuration

The following is displayed after ORDS – start in standalone mode.
Entrez 1 pour démarrer en mode autonome ou 2 pour quitter lapplication [1]:1 Entrez 1 si vous utilisez HTTP ou 2 si vous utilisez HTTPS [1]:1 2018-07-15 18:51:31.026:INFO::main: Logging initialized @92456ms to org.eclipse.jetty.util.log.StdErrLog juil. 15, 2018 6:51:31 PM “””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””” “”””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””” “””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””” 2018-07-15 18:51:32.149:INFO:oejs.Server:main: Started @93578ms
juil. 15, 2018 7:01:02 PM oracle.json.web.RestRequest runRequest INFOS: Running JSON/REST request GET

Connect to the database schema (user account) that you want ORDS to access.
begin
 ords.enable_schema;
COMMIT;
end;

Connect as sysdba and execute the following command:
GRANT SODA_APP TO database-schema;

Only if you are in a development environment:
Remove the default security constraints:
BEGIN
ords.delete_privilege_mapping(
                            ‘oracle.soda.privilege.developer’,
                            ‘/soda/*’
                            );
COMMIT;
END;
In a web browser, open:
http://localhost:8080/ords/database-schema/soda/latest/
If the installation succeeded, you see:
Example: Let’s create a service on our employees-table
begin
ords.create_service(
p_module_name => 'examples.employees' ,
p_base_path => '/examples/employees/',
p_pattern => '.' ,
p_items_per_page => 7,
p_source => 'select * from employees order by employee_id desc');
commit;
end;
curl -i http://linecode:8080/ords/hr/examples/employees/
HTTP/1.1 200 OK Date: Mon, 16 Jul 2018 00:57:21 GMT Content-Type: application/json ETag: “j3pT5JSxqYSy62ovSxbwk8SkIu1mdOCwnr8Ox1S6r5ZNXCM2eSKS6s4qk+5nnf4m5tCN3rs7pScKzXI2Qzkmew==” Transfer-Encoding: chunked

4 Responses to “Install and use ORDS with Oracle Database12c”

Leave a Reply