Oracle® REST Data Services Installation, Configuration, and Development Guide
Total Page:16
File Type:pdf, Size:1020Kb
Oracle® REST Data Services Installation, Configuration, and Development Guide Release 19.4 F25726-01 June 2020 Oracle REST Data Services Installation, Configuration, and Development Guide, Release 19.4 F25726-01 Copyright © 2011, 2020, Oracle and/or its affiliates. Primary Authors: Mamata Basapur, Chuck Murray Contributors: Colm Divilly, Sharon Kennedy, Ganesh Pitchaiah, Kris Rice, Elizabeth Saunders, Jason Straub, Vladislav Uvarov This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or “commercial computer software documentation” pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government’s use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government. This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle. Contents Preface Audience xvii Documentation Accessibility xvii Related Documents xviii Conventions xviii Third-Party License Information xviii Changes in This Release for Oracle REST Data Services Installation, Configuration, and Development Guide Changes in Oracle REST Data Services Release 19.4 xix 1 Installing Oracle REST Data Services 1.1 About Oracle REST Data Services 1-1 1.2 Understanding the Installation Process 1-1 1.2.1 Supported Java EE Application Servers 1-2 1.2.2 System Requirements 1-2 1.2.3 About Installing Oracle REST Data Services 1-2 1.3 Configuring and Installing Oracle REST Data Services 1-3 1.3.1 About Using the Command-Line Interface 1-3 1.3.2 About the Database Users Used by Oracle REST Data Services 1-3 1.3.3 Privileges Required for Oracle REST Data Services 1-4 1.3.4 Downloading, Configuring and Installing Oracle REST Data Services 1-6 1.3.4.1 ORDS Installer Privileges Script 1-6 1.3.4.2 Advanced Installation Using Command-Line Prompts 1-7 1.3.4.3 ORDS Parameter File 1-12 1.3.4.4 Simple Installation Using a Parameter File 1-25 1.3.4.5 Silent Installation Using a Parameter File 1-26 1.3.4.6 Changing Default Configuration from the Command Line 1-27 1.3.4.7 Validating the Oracle REST Data Services Installation 1-28 1.3.4.8 If You Want to Reinstall or Uninstall (Remove) Oracle REST Data Services 1-29 iii 1.3.5 Using SQL Developer Oracle REST Data Services Administration (Optional) 1-29 1.3.5.1 About SQL Developer Oracle REST Data Services Administration 1-30 1.3.5.2 Configuring an Administrator User 1-30 1.3.6 Using OAuth2 in Non-HTTPS Environments 1-30 1.4 Running in Standalone Mode 1-31 1.4.1 Starting in Standalone Mode 1-31 1.4.1.1 Converting a Private Key to DER (Linux and Unix) 1-32 1.4.2 Stopping the Server in Standalone Mode 1-33 1.4.3 Configuring a Doc Root for Non-Application Express Static Resources 1-33 1.5 Deploying to Oracle WebLogic Server 1-34 1.5.1 About Oracle WebLogic Server 1-34 1.5.2 Downloading, Installing, and Configuring Oracle REST Data Services 1-35 1.5.3 Configuring Oracle Application Express Images 1-35 1.5.4 Launching the Administration Server Console 1-35 1.5.5 Installing the Oracle WebLogic Server Deployment 1-36 1.5.6 Configuring WebLogic to Handle HTTP Basic Challenges Correctly 1-38 1.5.7 Verifying the State and Health of ords and i 1-39 1.6 Deploying to Apache Tomcat 1-39 1.6.1 About Apache Tomcat 1-39 1.6.2 Downloading, Installing, and Configuring Oracle REST Data Services 1-39 1.6.3 Configuring Oracle Application Express Images 1-40 1.6.4 Installing the Apache Tomcat Deployment 1-40 1.7 Upgrading Oracle REST Data Services 1-41 1.8 Using a Bequeath Connection to Install, Upgrade, Validate, or Uninstall Oracle REST Data Services 1-42 1.9 Authorizing Oracle REST Data Services to Access Oracle Data Guard Protected Users 1-42 2 Configuring Oracle REST Data Services (Advanced) 2.1 Configuring Multiple Databases 2-1 2.1.1 About the Request URL 2-1 2.1.2 Configuring Additional Databases 2-2 2.1.3 Routing Based on the Request Path Prefix 2-3 2.1.3.1 Example of Routing Based on the Request Path Prefix 2-3 2.1.4 Routing Based on the Request URL Prefix 2-4 2.1.4.1 Example of Routing Based on the Request URL Prefix 2-4 2.2 Using the Multitenant Architecture with Oracle REST Data Services 2-4 2.2.1 Installing Oracle REST Data Services in a CDB Environment 2-5 2.2.1.1 Installation Enabling Multiple Releases 2-6 2.2.2 Upgrading Oracle REST Data Services in a CDB Environment 2-7 iv 2.2.2.1 Migrating Oracle REST Data Services in the CDB to Enable Multiple Releases 2-8 2.2.3 Making All PDBs Addressable by Oracle REST Data Services (Pluggable Mapping) 2-8 2.2.4 Uninstalling Oracle REST Data Services in a CDB Environment 2-9 2.3 Support for Oracle RAC Fast Connection Failover 2-10 2.4 Configuring Security, Caching, Pre- and Post Processing, Environment, and Excel Settings 2-11 2.5 Configuring REST-Enabled SQL Service Settings 2-11 2.6 Configuring the Maximum Number of Rows Returned from a Query 2-11 2.7 Configuring the Custom Error Pages 2-12 2.8 Developing RESTful Services for Use with Oracle REST Data Services 2-12 3 Installing and Configuring Customer Managed ORDS on Autonomous Database 3.1 About Customer Managed Oracle REST Data Services on Autonomous Database 3-1 3.2 Downloading Wallet and Verifying Connection to Autonomous Database 3-2 3.3 Creating Customer Managed Oracle REST Data Services User Role 3-3 3.4 Downloading and Configuring Oracle REST Data Services 3-4 3.5 Preparing and Starting ORDS 3-5 4 Developing Oracle REST Data Services Applications 4.1 Introduction to Relevant Software 4-2 4.1.1 About Oracle Application Express 4-2 4.1.2 About RESTful Web Services 4-2 4.2 Getting Started with RESTful Services 4-2 4.2.1 RESTful Services Terminology 4-3 4.2.2 About Request Path Syntax Requirements 4-4 4.2.3 "Getting Started" Documents Included in Installation 4-4 4.2.4 About cURL and Testing RESTful Services 4-5 4.2.5 Automatic Enabling of Schema Objects for REST Access (AutoREST) 4-5 4.2.5.1 Examples: Accessing Objects Using RESTful Services 4-6 4.2.5.2 Filtering in Queries 4-17 4.2.5.3 Auto PL/SQL 4-25 4.2.6 Manually Creating RESTful Services Using SQL and PL/SQL 4-31 4.2.6.1 About Oracle REST Data Services Mechanisms for Passing Parameters 4-32 4.2.6.2 Using SQL/JSON Database Functions 4-42 4.2.7 About Working with Dates Using Oracle