Oracle Database Management REST API

Jeff Smith
Jeff SmithDistinguished Product Manager at Oracle Corp
Copyright © 2019 Oracle and/or its affiliates. All rights reserved. |
Oracle Database
Management REST API
Jeff Smith
Senior Principal Product Manager
Jeff.d.smith@oracle.com || @thatjeffsmith
Database Tools, Oracle Corp
1
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
At a Glance
• Manage & Monitor your Oracle Database
• Supports 11gR2, 12, 18, & 19c
• REST Endpoints backed by ORDS
• General, Data Dictionary, Monitoring,
Performance, & PDB Lifecycle Management
• Database User Authentication via REST Enabled Schemas
2
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Getting Started
• Install ORDS 19.1 or higher and configure your database
• Enable the DB API
• REST Enable an ADMIN Schema w/DBA (11g) or PDB_DBA (12c+) role
• OpenAPI {Swagger/JSON} doc available at
/ords/hr/_/db-api/latest/metadata-catalog/openapi.json
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Configuring User for DB API
Option #1, Mid Tier User:
Option #2, DB User:
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
API Docs
Oracle Docs Swagger.JSON Mounted to API
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: All Invalid Objects - Docs
• Find the right end point
• Try it out
6
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: All Invalid Objects – Method + URL
GET http://localhost:8080/ords/hr/_/db-api/latest/database/objects/
• ORDS is running Standalone localhost:8080/ords
• HR is the REST Enable Schema with DBA /hr
• DB API mounted to _/db-api
• Version of API /latest
– /latest or /stable => current version
– /19.1.0 => specific version
• Objects URI /database/objects/
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: All Invalid Objects - Response
{
"items": [
{
"owner": "SYS",
"object_name": "I_FILE#_BLOCK#",
"subobject_name": null,
"object_id": 9,
"data_object_id": 9,
"object_type": "INDEX",
"created": "2017-01-26T18:52:53Z",
"last_ddl_time": "2017-01-26T18:52:53Z",
"timestamp": "2017-01-26:13:52:53",
"status": "VALID",
"temporary": "N",
"generated": "N",
"secondary": "N",
"namespace": 4,
"edition_name": null,
"sharing": "NONE",
"editionable": null,
"oracle_maintained": "Y",
"application": "N",
"default_collation": null,
"duplicated": "N",
"sharded": "N",
"created_appid": null,
"created_vsnid": null,
"modified_appid": null,
"modified_vsnid": null,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/SYS,I_FILE%23_BLOCK%23"
}
]
},
DBA_OBJECTS in {JSON} with links to individual objects
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: All Invalid Objects - Paging
"hasMore": true,
"limit": 25,
"offset": 0,
"count": 25,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/"
},
{
"rel": "describedby",
"href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/metadata-catalog/"
},
{
"rel": "first",
"href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/"
},
{
"rel": "next",
"href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/?offset=25"
}
]
}
Paged Results (default pagesize 25)
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: All Invalid Objects - Filtering
Getting ONLY Invalid Objects
Query Parameters on the URI
/ords/hr/_/db-api/19.1.0/database/objects/?q={"$eq":{"status":"INVALID"}}
New query is now
SELECT *
FROM DBA_OBJECTS
WHERE STATUS = ‘INVALID’;
Query Filtering Docs
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Data Pump
• Inputs
– What directory?
– What type of export?
– How many threads?
– What are we exporting?
• Response
– Links to get status/log
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Data Pump – Export 2 Tables in Local Schema (HR)
{
"datapump_dir": "DATA_PUMP_DIR",
"filter": "HOCKEY_STATS, UNTAPPD",
"job_mode": "TABLE",
"threads": 2
}
POST BODY Response
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Data Pump – Resources Created
"links": [
…,
{
"rel": "related",
"href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/datapump/jobs/HR,DATAPUMP_REST_EXPORT_20190105140710/EXPDAT-2019-05-01-14_07_11.LOG"
},
{
"rel": "self",
"href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/datapump/jobs/HR,DATAPUMP_REST_EXPORT_20190105140710/"
}
]
Job Log File
The Job and its metadata
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Data Pump – Log File
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Data Pump – Job Details
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Data Pump – Download the DMP!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Example: Data Pump – What it looks like in the database
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
What’s Next?
• OS Monitoring Endpoints (CPU, DISK, MEMORY, PROCESSES)
• DBCA
• Data Pump (complete)
Features Planned for CY2019
18
1 of 18

More Related Content

What's hot(20)

Migrating Oracle to PostgreSQLMigrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQL
Amazon Web Services2.3K views
Introduction to Amazon DynamoDBIntroduction to Amazon DynamoDB
Introduction to Amazon DynamoDB
Amazon Web Services6.9K views
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insights
Kirill Loifman2K views
Real Application TestingReal Application Testing
Real Application Testing
oracleonthebrain2.3K views
Hadoop data managementHadoop data management
Hadoop data management
Subhas Kumar Ghosh1.3K views
Oracle GoldenGate Oracle GoldenGate
Oracle GoldenGate
oracleonthebrain19.1K views
Cloudera Hadoop DistributionCloudera Hadoop Distribution
Cloudera Hadoop Distribution
Thisara Pramuditha975 views
DevNation Live: Kafka and DebeziumDevNation Live: Kafka and Debezium
DevNation Live: Kafka and Debezium
Red Hat Developers2.6K views
SAS Visual Analytics OverviewSAS Visual Analytics Overview
SAS Visual Analytics Overview
SAS Institute India Pvt. Ltd4.2K views
Graph Databases & OrientDBGraph Databases & OrientDB
Graph Databases & OrientDB
Arpit Poladia1.6K views
AWS DynamoDB and Schema DesignAWS DynamoDB and Schema Design
AWS DynamoDB and Schema Design
Amazon Web Services4.6K views
Azure datafactoryAzure datafactory
Azure datafactory
Dimko Zhluktenko430 views
New Features in OBIEE 12c New Features in OBIEE 12c
New Features in OBIEE 12c
Michelle Kolbe9.3K views
Introducing DynamoDBIntroducing DynamoDB
Introducing DynamoDB
Amazon Web Services3.6K views
AWS DynamoDBAWS DynamoDB
AWS DynamoDB
Suman Debnath181 views

Similar to Oracle Database Management REST API(20)

Recently uploaded(20)

[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh36 views
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)
CSUC - Consorci de Serveis Universitaris de Catalunya59 views
ThroughputThroughput
Throughput
Moisés Armani Ramírez31 views
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum120 views

Oracle Database Management REST API

  • 1. Copyright © 2019 Oracle and/or its affiliates. All rights reserved. | Oracle Database Management REST API Jeff Smith Senior Principal Product Manager Jeff.d.smith@oracle.com || @thatjeffsmith Database Tools, Oracle Corp 1
  • 2. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | At a Glance • Manage & Monitor your Oracle Database • Supports 11gR2, 12, 18, & 19c • REST Endpoints backed by ORDS • General, Data Dictionary, Monitoring, Performance, & PDB Lifecycle Management • Database User Authentication via REST Enabled Schemas 2
  • 3. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Getting Started • Install ORDS 19.1 or higher and configure your database • Enable the DB API • REST Enable an ADMIN Schema w/DBA (11g) or PDB_DBA (12c+) role • OpenAPI {Swagger/JSON} doc available at /ords/hr/_/db-api/latest/metadata-catalog/openapi.json
  • 4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Configuring User for DB API Option #1, Mid Tier User: Option #2, DB User:
  • 5. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | API Docs Oracle Docs Swagger.JSON Mounted to API
  • 6. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: All Invalid Objects - Docs • Find the right end point • Try it out 6
  • 7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: All Invalid Objects – Method + URL GET http://localhost:8080/ords/hr/_/db-api/latest/database/objects/ • ORDS is running Standalone localhost:8080/ords • HR is the REST Enable Schema with DBA /hr • DB API mounted to _/db-api • Version of API /latest – /latest or /stable => current version – /19.1.0 => specific version • Objects URI /database/objects/
  • 8. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: All Invalid Objects - Response { "items": [ { "owner": "SYS", "object_name": "I_FILE#_BLOCK#", "subobject_name": null, "object_id": 9, "data_object_id": 9, "object_type": "INDEX", "created": "2017-01-26T18:52:53Z", "last_ddl_time": "2017-01-26T18:52:53Z", "timestamp": "2017-01-26:13:52:53", "status": "VALID", "temporary": "N", "generated": "N", "secondary": "N", "namespace": 4, "edition_name": null, "sharing": "NONE", "editionable": null, "oracle_maintained": "Y", "application": "N", "default_collation": null, "duplicated": "N", "sharded": "N", "created_appid": null, "created_vsnid": null, "modified_appid": null, "modified_vsnid": null, "links": [ { "rel": "self", "href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/SYS,I_FILE%23_BLOCK%23" } ] }, DBA_OBJECTS in {JSON} with links to individual objects
  • 9. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: All Invalid Objects - Paging "hasMore": true, "limit": 25, "offset": 0, "count": 25, "links": [ { "rel": "self", "href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/" }, { "rel": "describedby", "href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/metadata-catalog/" }, { "rel": "first", "href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/" }, { "rel": "next", "href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/objects/?offset=25" } ] } Paged Results (default pagesize 25)
  • 10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: All Invalid Objects - Filtering Getting ONLY Invalid Objects Query Parameters on the URI /ords/hr/_/db-api/19.1.0/database/objects/?q={"$eq":{"status":"INVALID"}} New query is now SELECT * FROM DBA_OBJECTS WHERE STATUS = ‘INVALID’; Query Filtering Docs
  • 11. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Data Pump • Inputs – What directory? – What type of export? – How many threads? – What are we exporting? • Response – Links to get status/log
  • 12. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Data Pump – Export 2 Tables in Local Schema (HR) { "datapump_dir": "DATA_PUMP_DIR", "filter": "HOCKEY_STATS, UNTAPPD", "job_mode": "TABLE", "threads": 2 } POST BODY Response
  • 13. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Data Pump – Resources Created "links": [ …, { "rel": "related", "href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/datapump/jobs/HR,DATAPUMP_REST_EXPORT_20190105140710/EXPDAT-2019-05-01-14_07_11.LOG" }, { "rel": "self", "href": "http://localhost:8080/ords/hr/_/db-api/19.1.0/database/datapump/jobs/HR,DATAPUMP_REST_EXPORT_20190105140710/" } ] Job Log File The Job and its metadata
  • 14. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Data Pump – Log File
  • 15. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Data Pump – Job Details
  • 16. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Data Pump – Download the DMP!
  • 17. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Example: Data Pump – What it looks like in the database
  • 18. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | What’s Next? • OS Monitoring Endpoints (CPU, DISK, MEMORY, PROCESSES) • DBCA • Data Pump (complete) Features Planned for CY2019 18