Using Oracle Nosql Database Cloud Service
Total Page:16
File Type:pdf, Size:1020Kb
Oracle® Cloud Using Oracle NoSQL Database Cloud Service Latest Cloud Release E90090-24 August 2021 Oracle Cloud Using Oracle NoSQL Database Cloud Service, Latest Cloud Release E90090-24 Copyright © 2018, 2021, Oracle and/or its affiliates. Primary Author: Vandanadevi Rajamani 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, Java, and MySQL 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 viii Documentation Accessibility viii Related Resources viii Conventions viii Diversity and Inclusion ix 1 Getting Started About the Service 1-1 Region Availability 1-2 Service Limits 1-2 Service Quotas 1-2 Service Events 1-3 Service Metrics 1-5 Before You Begin 1-6 Typical Workflow 1-7 Key Features 1-7 Always Free Service 1-8 Developer Overview 1-9 Cloud Concepts 1-10 Functional difference between the NoSQL Cloud Service and On-premise database 1-12 Quick Start Tutorials 1-13 2 Connecting your Application Acquiring Credentials 2-1 Connecting your Application using Java 2-3 Connecting your Application using Python 2-4 Connecting your Application using Node.js 2-4 Connecting your Application using Go 2-4 Data Regions and Associated Service Endpoints 2-4 iii 3 Developing in Oracle Cloud Table Design 3-1 Supported Data Types 3-2 Table Fields 3-3 Primary Keys and Shard Keys 3-5 Time to Live 3-6 Table States and Life Cycles 3-7 Table Management 3-8 Data Definition Language Reference 3-8 Using Tables in Java 3-10 About the Oracle NoSQL Database Java SDK 3-10 About Compartments 3-10 Obtaining a NoSQL Handle 3-11 Creating Tables and Indexes 3-12 Adding Data 3-14 Adding JSON Data 3-15 Reading Data 3-16 Using Queries 3-17 Deleting Data 3-18 Modifying Tables 3-19 Dropping Tables and Indexes 3-21 Handling Errors 3-21 Using Tables in Python 3-22 Using Tables in Node.js 3-22 Using Tables in Go 3-22 Query Language Reference 3-22 Oracle NoSQL Database Cloud Service Limits 3-23 Estimating Capacity 3-25 Handling Capacity 3-29 4 Developing in Oracle NoSQL Database Cloud Simulator Downloading the Oracle NoSQL Database Cloud Simulator 4-1 Oracle NoSQL Database Cloud Simulator Compared With Oracle NoSQL Database Cloud Service 4-2 5 Using Plugins for Development About IntelliJ Plugin 5-1 Setting Up IntelliJ Plug-in 5-1 Creating a NoSQL Project in IntelliJ 5-2 iv Connecting to Oracle NoSQL Database Cloud Simulator from IntelliJ 5-2 Connecting to Oracle NoSQL Database Cloud Service from IntelliJ 5-3 Managing Tables Using the IntelliJ Plugin 5-5 About Eclipse Plugin 5-6 6 Using the Console to Manage Tables Accessing the Service from the Infrastructure Console 6-1 Managing Table Data 6-1 Inserting Data Into Tables 6-1 Inserting Data Into Tables: Simple Input Mode 6-2 Inserting Data Into Tables: Advanced JSON Input Mode 6-2 Viewing Table Data 6-3 Updating Table Data 6-3 Deleting Table Data 6-4 Downloading Table Data 6-4 Managing Tables and Indexes 6-5 Creating Tables 6-5 Creating Table: Simple Input Mode 6-5 Creating Table: Advanced DDL Input Mode 6-9 Creating Indexes 6-11 Editing Tables 6-12 Altering Tables 6-14 Adding Table Columns: Simple Input Mode 6-15 Adding Table Columns: Advanced DDL Input Mode 6-16 Deleting Table Columns 6-16 Moving Tables 6-17 Deleting Tables 6-17 Deleting Indexes 6-18 Monitoring Tables and Indexes 6-18 Viewing Tables 6-19 Viewing Indexes 6-19 Viewing Table Details 6-19 Viewing Table DDL 6-19 Viewing Table Metrics 6-20 7 Managing Subscriptions Setting up Your Service 7-1 Estimating Your Monthly Cost 7-2 v Creating a Compartment 7-2 8 Managing Table Access and Security About Oracle NoSQL Database Cloud Service Security Model 8-1 Typical Process to Manage Security for Oracle NoSQL Database Cloud Service 8-3 Setting Up Users, Groups, and Policies 8-3 Policy Reference 8-4 Resource-Types 8-4 Supported Variables 8-5 Details for Verb + Resource-Type Combinations 8-5 Permission Required for Each NoSQL Cloud Driver Request 8-7 Permission Required for Each REST API Operation 8-8 Typical Policy Statements to Manage Tables 8-9 Accessing NoSQL Tables Across Tenancies 8-10 Giving Another User Permission to Manage NoSQL Tables 8-12 9 Using Oracle NoSQL Database Migrator Overview 9-1 Terminology used with Oracle NoSQL Database Migrator 9-2 Using Oracle NoSQL Database Migrator 9-4 Sources and Sinks 9-9 Supported Sources and Sinks 9-9 Source and Sink Security 9-10 Source Configuration Templates 9-11 JSON File 9-11 JSON File in OCI Object Storage Bucket 9-13 MongoDB-Formatted JSON File 9-17 MongoDB-Formatted JSON File in OCI Object Storage bucket 9-18 Oracle NoSQL Database 9-22 Oracle NoSQL Database Cloud Service 9-24 Sink Configuration Templates 9-28 JSON File 9-28 JSON File in OCI Object Storage Bucket 9-31 Oracle NoSQL Database 9-35 Oracle NoSQL Database Cloud Service 9-39 Transformation Configuration Templates 9-46 ignoreFields 9-46 renameFields 9-47 aggregateFields 9-47 vi Use Case Demonstrations 9-48 Migrate from Oracle NoSQL Database Cloud Service to a JSON file 9-49 Migrate from Oracle NoSQL Database On-Premise to Oracle NoSQL Database Cloud Service 9-54 Migrate from MongoDB-Formatted JSON file to an Oracle NoSQL Database Cloud Service 9-56 Troubleshooting the Oracle NoSQL Database Migrator 9-58 Oracle NoSQL Database Migrator Vs. Import/Export Utility 9-61 Transitioning from Import/Export to NoSQL Database Migrator 9-68 vii Preface Preface This document describes how to use Oracle NoSQL Database Cloud Service and provides references to related documentation. Audience This document is intended for developers who want to create tables and query data in Oracle NoSQL Database Cloud Service. This document is also intended for Oracle Cloud administrators who want to manage users and their privileges in Oracle NoSQL Database Cloud Service. Documentation Accessibility For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup? ctx=acc&id=docacc. Access to Oracle Support Oracle customers that have purchased support have access to electronic support through My Oracle Support.