SlideShare uma empresa Scribd logo
1 de 28
Copyright © 2019 Oracle and/or its affiliates. All rights reserved. |
RESTful Services
Oracle Autonomous Database
Jeff Smith
Master Product Manager
Jeff.d.smith@oracle.com || @thatjeffsmith
Database Tools, Oracle Corp
1
{
"items":
[
{
"employee_id": 100,
"first_name": "Suppo0rt",
"last_name": "King",
"email": "Suppo0rt",
"phone_number": "515.123.4567",
"hire_date": "2018-08-21T11:09:58Z",
"job_id": "AD_PRES",
"salary": 49243.75,
"commission_pct": null,
"manager_id": null,
"department_id": 90,
"column1": null,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/ords/hr/peeps/100“
}
]
},
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
ATP-Dedicated, Too!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 4
Introduction and
getting started
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
REST Data Services (ORDS)
• Publish REST APIs for your schemas
• Write your own services SQL & PL/SQL
• REST Enable tables, views, PL/SQL objects
• Secure with privs/roles
• Authenticate with DB users or ORDS OAUTH2 workflow
5
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Stuff in your DB…available via HTTPS!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
GET https://host/ords/human/peeps/ SELECT *
FROM
EMPLOYEES
HTTP/1.1 200 OK
{ "employee_id": 100,
"first_name": "Kris"
,"last_name": "Rice",
, “email": “krisrice@oracle.com",
{json}
URI SQL & PLSQLMap & BindHTTP Request
HTTP Response Transform to JSON SQL Result Set / Standard OUT
Oracle REST Data Services
Anatomy of an ORDS Request and Response
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Available Development & Management Interfaces
SQLDev
APEX
PL/SQL API
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Day 0: Database User with Web Access out-of-the-box
HTTPS Access – to your data,
objects, and APEX apps
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Getting Started
• ADMIN account is available by default for HTTPS Access
• SQL Developer Web, APEX, and RESTful Services
10
admin
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Use ADMIN for admin, not for development
• Treat it as SYSTEM/SYS
• Do NOT use for application schema
What TO DO
1. CREATE USER JEFF…;
2. REST ENABLE
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Determining your REST Service URLs
https://some-id.adb.co-citry-1.oraclecloudapps.com/ords/tjs/_sdw/?nav=worksheet
https://some-id.adb.co-citry-1.oraclecloudapps.com/ords
• /schema/module/service-pattern/
• /schema/rest-enabled-object/
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 13
REST Service Options –
Automatic or Manual
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Automatic: REST Enabling a TABLE
AUTO REST Advantages
•CRUD APIs, no SQL to
write
•Single ORDS package
call to create
•Maintained by US
•Feature Packed
•Optimized
• GET
• PUT
• POST
• DELETE
• DESC
• DOCS
/ords/hr/employees
/ords/hr/employees/
/ords/hr/employees/:id
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
• Schema level Metadata
• Table Metadata
• Get ( Select )
• Query ( Filtering/Order/ASOF )
• Insert
• Update
• Delete
• Load CSV
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
•All rows /
•One row /:id – PK Value
–No PK, default to ROWID
–Multi-column PK /x,y,z
•Some rows /?q={json}
Querying the TABLE
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
METHOD : PUT /:PK
REQUEST BODY : JSON
RESPONSE: 200 OK
•Location (Header)
•JSON (Body)
Table Columns in the POST body
{“column_name” : column_value }
UPDATE a row
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
RESTful Services: Your SQL & PL/SQL
RESTful Service Advantages
•You’re in charge
•Inputs, outputs, error
handling, response codes,
formatting
•Full access to SQL/PLSQL
•Easily exported, source
controlled
•Transparent
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Not just for SELECTs & Reading Data
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Security and Authentication
• Services are secured with PRIVILEGES
• ROLES are assigned PRIVILEGES and granted to users
• USERS are authenticated DB USER sessions or come in via
our OAUTH2 mechanism
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Defining Privileges
22
Protect a module or URI pattern
The ‘SQL Developer’ role is inherited by
every database authenticated REST request
in ORDS….so if I give the privilege to this
ROLE, my JEFF/P@$$w0rd BASIC Auth
request to /ords/jeff/ will be authorized.
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Trying to access a REST API w/no credentials…
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Same request w/credentials…
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
OAUTH2 – what we recommend vs DB User/BASIC Auth
25
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 26
Live Demo
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
ORDS in Autonomous, what it’s mean?
• Installed and ready to use at startup
• ADMIN user is REST enabled, but don’t use it for apps
• All the ORDS features you know on-prem, avail in OCI
• We handle upgrades and maintenance
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 28
Questions?

Mais conteúdo relacionado

Mais procurados

Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
Kyle Hailey
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
Simon Huang
 
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex GorbachevBenchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Alex Gorbachev
 

Mais procurados (20)

Oracle Enterprise Manager
Oracle Enterprise ManagerOracle Enterprise Manager
Oracle Enterprise Manager
 
Introduction to Oracle Cloud Infrastructure Services
Introduction to Oracle Cloud Infrastructure ServicesIntroduction to Oracle Cloud Infrastructure Services
Introduction to Oracle Cloud Infrastructure Services
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best Practices
 
Data Guard Architecture & Setup
Data Guard Architecture & SetupData Guard Architecture & Setup
Data Guard Architecture & Setup
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step Procedure
 
Exadata master series_asm_2020
Exadata master series_asm_2020Exadata master series_asm_2020
Exadata master series_asm_2020
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
 
Oracle RAC 19c with Standard Edition (SE) 2 - Support Update
Oracle RAC 19c with Standard Edition (SE) 2 - Support UpdateOracle RAC 19c with Standard Edition (SE) 2 - Support Update
Oracle RAC 19c with Standard Edition (SE) 2 - Support Update
 
Oracle RAC 12c Overview
Oracle RAC 12c OverviewOracle RAC 12c Overview
Oracle RAC 12c Overview
 
Oracle Cloud Infrastructure Overview Deck.pptx
Oracle Cloud Infrastructure Overview Deck.pptxOracle Cloud Infrastructure Overview Deck.pptx
Oracle Cloud Infrastructure Overview Deck.pptx
 
Oracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAsOracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAs
 
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and AdministerOracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
 
Step By Step to Install Oracle Business Intelligence
Step By Step to Install Oracle Business IntelligenceStep By Step to Install Oracle Business Intelligence
Step By Step to Install Oracle Business Intelligence
 
Performance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and UnderscoresPerformance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and Underscores
 
Whats new in Autonomous Database in 2022
Whats new in Autonomous Database in 2022Whats new in Autonomous Database in 2022
Whats new in Autonomous Database in 2022
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
 
Oracle Database 12c : Multitenant
Oracle Database 12c : MultitenantOracle Database 12c : Multitenant
Oracle Database 12c : Multitenant
 
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex GorbachevBenchmarking Oracle I/O Performance with Orion by Alex Gorbachev
Benchmarking Oracle I/O Performance with Orion by Alex Gorbachev
 
gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”gDBClone - Database Clone “onecommand Automation Tool”
gDBClone - Database Clone “onecommand Automation Tool”
 

Semelhante a RESTful Services for your Oracle Autonomous Database

Semelhante a RESTful Services for your Oracle Autonomous Database (20)

Oracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDSOracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDS
 
10thMeetup-20190420-REST API Design Principles 되새기기
10thMeetup-20190420-REST API Design Principles 되새기기10thMeetup-20190420-REST API Design Principles 되새기기
10thMeetup-20190420-REST API Design Principles 되새기기
 
API Design Principles Essential 
API Design Principles Essential API Design Principles Essential 
API Design Principles Essential 
 
REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)
 
Oracle Database Management REST API
Oracle Database Management REST APIOracle Database Management REST API
Oracle Database Management REST API
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015
 
Oracle APEX勉強会 - 認証と認可の実装を学ぶ
Oracle APEX勉強会 - 認証と認可の実装を学ぶOracle APEX勉強会 - 認証と認可の実装を学ぶ
Oracle APEX勉強会 - 認証と認可の実装を学ぶ
 
Data meets AI - ATP Roadshow India
Data meets AI - ATP Roadshow IndiaData meets AI - ATP Roadshow India
Data meets AI - ATP Roadshow India
 
Automating Cloud Operations - Everything you wanted to know about cURL and RE...
Automating Cloud Operations - Everything you wanted to know about cURL and RE...Automating Cloud Operations - Everything you wanted to know about cURL and RE...
Automating Cloud Operations - Everything you wanted to know about cURL and RE...
 
Oracle APEX Introduction (release 18.1)
Oracle APEX Introduction (release 18.1)Oracle APEX Introduction (release 18.1)
Oracle APEX Introduction (release 18.1)
 
Southeast Linuxfest -- MySQL User Admin Tips & Tricks
Southeast Linuxfest -- MySQL User Admin Tips & TricksSoutheast Linuxfest -- MySQL User Admin Tips & Tricks
Southeast Linuxfest -- MySQL User Admin Tips & Tricks
 
Oracle database 12c_and_DevOps
Oracle database 12c_and_DevOpsOracle database 12c_and_DevOps
Oracle database 12c_and_DevOps
 
Soa suite12c presentation @AMIS by Simone Geib
Soa suite12c presentation @AMIS by Simone GeibSoa suite12c presentation @AMIS by Simone Geib
Soa suite12c presentation @AMIS by Simone Geib
 
Apex atp customer_presentation_wwc march 2019
Apex atp customer_presentation_wwc march 2019Apex atp customer_presentation_wwc march 2019
Apex atp customer_presentation_wwc march 2019
 
APEX Boston Meetup - October 1st, 2019
APEX Boston Meetup - October 1st, 2019APEX Boston Meetup - October 1st, 2019
APEX Boston Meetup - October 1st, 2019
 
Con9573 managing the oim platform with oracle enterprise manager
Con9573 managing the oim platform with oracle enterprise manager Con9573 managing the oim platform with oracle enterprise manager
Con9573 managing the oim platform with oracle enterprise manager
 
Oracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesOracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API Examples
 
Confoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSetConfoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSet
 
Nonblocking Database Access in Helidon SE
Nonblocking Database Access in Helidon SENonblocking Database Access in Helidon SE
Nonblocking Database Access in Helidon SE
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
 

Mais de Jeff Smith

Mais de Jeff Smith (20)

Oracle REST Data Services: POUG Edition
Oracle REST Data Services: POUG EditionOracle REST Data Services: POUG Edition
Oracle REST Data Services: POUG Edition
 
Oracle SQL Developer Tips and Tricks: Data Edition
Oracle SQL Developer Tips and Tricks: Data EditionOracle SQL Developer Tips and Tricks: Data Edition
Oracle SQL Developer Tips and Tricks: Data Edition
 
Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl
 
Oracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query ResultsOracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query Results
 
Debugging PL/SQL from your APEX Applications with Oracle SQL Developer
Debugging PL/SQL from your APEX Applications with Oracle SQL DeveloperDebugging PL/SQL from your APEX Applications with Oracle SQL Developer
Debugging PL/SQL from your APEX Applications with Oracle SQL Developer
 
Oracle SQL Developer Data Modeler - for SQL Server
Oracle SQL Developer Data Modeler - for SQL ServerOracle SQL Developer Data Modeler - for SQL Server
Oracle SQL Developer Data Modeler - for SQL Server
 
What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018
 
Oracle SQL Developer: You're Doing it Wrong!
Oracle SQL Developer: You're Doing it Wrong!Oracle SQL Developer: You're Doing it Wrong!
Oracle SQL Developer: You're Doing it Wrong!
 
Social Media - Why a Database Person Should Care
Social Media  - Why a Database Person Should CareSocial Media  - Why a Database Person Should Care
Social Media - Why a Database Person Should Care
 
Oracle SQL Developer Reports
Oracle SQL Developer ReportsOracle SQL Developer Reports
Oracle SQL Developer Reports
 
Oracle SQL Developer: 3 Features You're Not Using But Should Be
Oracle SQL Developer: 3 Features You're Not Using But Should BeOracle SQL Developer: 3 Features You're Not Using But Should Be
Oracle SQL Developer: 3 Features You're Not Using But Should Be
 
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & TricksPennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
 
PL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL DeveloperPL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL Developer
 
Debugging PL/SQL with Oracle SQL Developer
Debugging PL/SQL with Oracle SQL DeveloperDebugging PL/SQL with Oracle SQL Developer
Debugging PL/SQL with Oracle SQL Developer
 
REST Enabling Your Oracle Database
REST Enabling Your Oracle DatabaseREST Enabling Your Oracle Database
REST Enabling Your Oracle Database
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
 
If You Oracle Then You Should Twitter Too
If You Oracle Then You Should Twitter TooIf You Oracle Then You Should Twitter Too
If You Oracle Then You Should Twitter Too
 
SQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle DatabaseSQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle Database
 
Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?
 
My Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler FeaturesMy Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler Features
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

RESTful Services for your Oracle Autonomous Database

  • 1. Copyright © 2019 Oracle and/or its affiliates. All rights reserved. | RESTful Services Oracle Autonomous Database Jeff Smith Master Product Manager Jeff.d.smith@oracle.com || @thatjeffsmith Database Tools, Oracle Corp 1 { "items": [ { "employee_id": 100, "first_name": "Suppo0rt", "last_name": "King", "email": "Suppo0rt", "phone_number": "515.123.4567", "hire_date": "2018-08-21T11:09:58Z", "job_id": "AD_PRES", "salary": 49243.75, "commission_pct": null, "manager_id": null, "department_id": 90, "column1": null, "links": [ { "rel": "self", "href": "http://localhost:8080/ords/hr/peeps/100“ } ] },
  • 2. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
  • 3. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | ATP-Dedicated, Too!
  • 4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 4 Introduction and getting started
  • 5. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | REST Data Services (ORDS) • Publish REST APIs for your schemas • Write your own services SQL & PL/SQL • REST Enable tables, views, PL/SQL objects • Secure with privs/roles • Authenticate with DB users or ORDS OAUTH2 workflow 5
  • 6. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Stuff in your DB…available via HTTPS!
  • 7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | GET https://host/ords/human/peeps/ SELECT * FROM EMPLOYEES HTTP/1.1 200 OK { "employee_id": 100, "first_name": "Kris" ,"last_name": "Rice", , “email": “krisrice@oracle.com", {json} URI SQL & PLSQLMap & BindHTTP Request HTTP Response Transform to JSON SQL Result Set / Standard OUT Oracle REST Data Services Anatomy of an ORDS Request and Response
  • 8. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Available Development & Management Interfaces SQLDev APEX PL/SQL API
  • 9. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Day 0: Database User with Web Access out-of-the-box HTTPS Access – to your data, objects, and APEX apps
  • 10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Getting Started • ADMIN account is available by default for HTTPS Access • SQL Developer Web, APEX, and RESTful Services 10 admin
  • 11. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Use ADMIN for admin, not for development • Treat it as SYSTEM/SYS • Do NOT use for application schema What TO DO 1. CREATE USER JEFF…; 2. REST ENABLE
  • 12. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Determining your REST Service URLs https://some-id.adb.co-citry-1.oraclecloudapps.com/ords/tjs/_sdw/?nav=worksheet https://some-id.adb.co-citry-1.oraclecloudapps.com/ords • /schema/module/service-pattern/ • /schema/rest-enabled-object/
  • 13. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 13 REST Service Options – Automatic or Manual
  • 14. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Automatic: REST Enabling a TABLE AUTO REST Advantages •CRUD APIs, no SQL to write •Single ORDS package call to create •Maintained by US •Feature Packed •Optimized • GET • PUT • POST • DELETE • DESC • DOCS /ords/hr/employees /ords/hr/employees/ /ords/hr/employees/:id
  • 15. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
  • 16. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | • Schema level Metadata • Table Metadata • Get ( Select ) • Query ( Filtering/Order/ASOF ) • Insert • Update • Delete • Load CSV
  • 17. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | •All rows / •One row /:id – PK Value –No PK, default to ROWID –Multi-column PK /x,y,z •Some rows /?q={json} Querying the TABLE
  • 18. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | METHOD : PUT /:PK REQUEST BODY : JSON RESPONSE: 200 OK •Location (Header) •JSON (Body) Table Columns in the POST body {“column_name” : column_value } UPDATE a row
  • 19. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | RESTful Services: Your SQL & PL/SQL RESTful Service Advantages •You’re in charge •Inputs, outputs, error handling, response codes, formatting •Full access to SQL/PLSQL •Easily exported, source controlled •Transparent
  • 20. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Not just for SELECTs & Reading Data
  • 21. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Security and Authentication • Services are secured with PRIVILEGES • ROLES are assigned PRIVILEGES and granted to users • USERS are authenticated DB USER sessions or come in via our OAUTH2 mechanism
  • 22. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Defining Privileges 22 Protect a module or URI pattern The ‘SQL Developer’ role is inherited by every database authenticated REST request in ORDS….so if I give the privilege to this ROLE, my JEFF/P@$$w0rd BASIC Auth request to /ords/jeff/ will be authorized.
  • 23. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Trying to access a REST API w/no credentials…
  • 24. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Same request w/credentials…
  • 25. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | OAUTH2 – what we recommend vs DB User/BASIC Auth 25
  • 26. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 26 Live Demo
  • 27. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | ORDS in Autonomous, what it’s mean? • Installed and ready to use at startup • ADMIN user is REST enabled, but don’t use it for apps • All the ORDS features you know on-prem, avail in OCI • We handle upgrades and maintenance
  • 28. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 28 Questions?