REST API & CLI for ExaCS Title: REST API & CLI for ExaCS Author: Oracle Corporation Subject: REST...

download REST API & CLI for ExaCS Title: REST API & CLI for ExaCS Author: Oracle Corporation Subject: REST API

If you can't read please download the document

  • date post

    04-Jul-2020
  • Category

    Documents

  • view

    0
  • download

    0

Embed Size (px)

Transcript of REST API & CLI for ExaCS Title: REST API & CLI for ExaCS Author: Oracle Corporation Subject: REST...

  • 1Copyright © 2019, Oracle and/or its affiliates. All rights reserved.Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    REST API & CLI for ExaCS Level 300

    Bal Sharma

    May 2019

  • 2Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Safe Harbor Statement

    The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

  • 3Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Objectives

    After completing this lesson, you should be able to:

    • Describe the API & CLI available for ExaCS operations

    • Understand dbaascli and examples.

    • Understand how to setup OCI CLI & examples.

    • ExaCLI and examples.

    • Dbaasapi use case and example

    • Demo

  • 4Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Exadata Cloud Service CLIs/APIs - Command Line Utilities

    dbaascli

    OCI CL

    exacli

    dbaasapi

    bkup_api

    • Supports a variety of life-cycle and administration operations- Database Patching, SW library Updates,

    Oracle Home maintenance, PDB operations, TDE Management etc

    • Almost all of the operations which can be performed from console –Database System Launch, DB creation/deletion

    VCN and related resource operation, CPU scaling etc

    • Used to execute specific cellcli commands from compute node to the Exadata Storage Servers that are

    associated with your ExaCS environment. Use case is for getting Storage Cell metrices and diagnostics info.

    • Manual Database operations, though recommended method is to use OCI CL or console for DB tasks such as

    DB creation & deletion.

    • Supports Backup life cycle – Creating configuration, Changing configuration, Backup, restore operations

  • 5Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Dbaascli-Manage life cycle operation of databases

    dbaascli is a command line interface for different tools to be used with Oracle Cloud DB. This command line

    interface supports logging, command history and autocomplete.

    Note: You must specify the dbname as an additional parameter for all commands:

    --dbname - where is the name of the instance that you want to work with.

    A variety of life-cycle and administration operations are supported such as:

    • Starting and stopping a database

    • Starting and stopping the Oracle Net listener

    • Viewing information about Oracle Homes

    • Moving a database to another Oracle Home

    • Deleting an unused Oracle Home

    • Performing database configuration changes

    • Managing Oracle Database software images

    • Managing pluggable databases (PDBs)

    • Performing database recovery

    • Rotating the master encryption key

  • 6Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Updating Cloud Tooling on Exadata Cloud Service Cloud tooling include the fixes for existing issues and new features so it is highly recommended to upgrade the

    cloud tooling once new version or release is available. This is important before trying Patching using dbaascli.

    Note: When updating the cloud tooling on database deployments hosting a Data Guard configuration, you must

    perform the update on both nodes; that is, on the one hosting the primary database and on the one hosting

    the standby database.

    Check your current version of cloud tooling

    [root@xdprod-n53zg1 ~]# rpm -qa|grep -i dbaastools

    dbaastools_exa-1.0-1+18.2.3.1.0_190415.1015.x86_64

    Check for cloud tooling updates

    [root@xdprod-n53zg1 ~]# dbaascli patch tools list

    Upgrade to Latest Cloud Tooling

    [root@xdprod-n53zg1 ~]# dbaascli patch tools apply --patchid LATEST

    Repeat the same steps on another instance if it is data guard setup for dbaascli cloud tooling upgrade

    Note: How to upgrade DBAAS Cloud Tooling using dbaascli (Doc ID 2350471.1)

    Configuring Automatic Cloud Tooling Updates

    #dbaascli patch tools auto enable

    Disabling Automatic Cloud Tooling Updates

    # dbaascli patch tools auto disable

  • 7Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Dbaascli- uses

    To use the dbaascli utility:

    • Connect to a compute node associated with the Exadata Cloud Service deployment.

    • Commands using the dbhome, dbimage, cswlib, or orec subcommands must be run with root administrator

    privileges. In this case, first connect as the opc user and then start a root-user command shell by executing

    the sudo —s command.

    • Otherwise, connect as the oracle user.

    • Run the dbaascli utility using a command of the form:

    # dbaascli subcommand subcommand-options

    Ref: https://docs.oracle.com/en/cloud/paas/exadata-cloud/csexa/dbaascli.html

    DBAAS>

    result of list Very Long Text, press q to quitAvailable commands: cleandb enable cns dbdisable cns dbenable cns dbstatus cns disable cns enable cns getprop cns setprop cns status

    database bounce database changepassword database move database start database status database stop dataguard failover dataguard reinstate dataguard status ……….

    https://docs.oracle.com/en/cloud/paas/exadata-cloud/csexa/dbaascli.html

  • 8Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Dbaascli- uses

    dbaascli database bounce --dbname dbname

    # dbaascli cswlib list

    #dbaascli cswlib download [--version software_version] [--bp software_bp]

    dbaascli database changepassword --dbname dbname

    dbaascli database move --dbname dbname --ohome oracle_home

    dbaascli database start --dbname dbname

    dbaascli database status --dbname dbname

    dbaascli database stop --dbname dbname

    dbaascli database update --dbname dbname --redosize redo_size [--groups num_groups] [--precheck]

    dbaascli database update --dbname dbname --db_unique_name dbname_uniquename [--precheck]

    dbaascli dbhome info

    dbaascli dbhome purge

    # dbaascli dbimage list

    dbaascli listener bounce --dbname dbname

    dbaascli listener start --dbname dbname

    dbaascli listener status --dbname dbname

    dbaascli listener stop --dbname dbname

    dbaascli pdb checkdb --dbname dbname

    dbaascli pdb checknode --node nodenum --dbname dbname

    $ dbaascli pdb checkpdb --pdbname pdbname --dbname dbname

  • 9Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Use Case: dbaascli- Update Your Software Library to Include the

    non-CDB Images

    By default, Exadata Cloud Service, creates an Oracle Database 12c (or later) database

    using the multitenant architecture with a container database (CDB) and pluggable databases

    (PDBs). Many existing databases, especially E-Business Suite implementations, use the

    non-CDB database architecture.

    Use the following command to display software library updates available:

    [root@xdprod-n53zg2 ~]# dbaascli patch tools list—Check

    for latest tool, if not latest update using apply clause.

    root@xdprod-n53zg1 ~]# dbaascli cswlib list

    DBAAS CLI version 18.2.3.1.0

    Executing command cswlib list

    ############ List of Available BP #############

    -APR2017 (For DB Versions 12201 12102 11204)

    -JAN2018 (For DB Versions 12201 12102 11204)

    -APR2018 (For DB Versions 12201 12102 11204)

    -JUL2018 (For DB Versions 18000 12201 12102 11204)

    -OCT2018 (For DB Versions 18000 12201 12102 11204)

    -JAN2019 (For DB Versions 18000 12201 12102 11204)

    -NCAPR2018 (For DB Versions 12201 12102)

    -NCJAN2019 (For DB Versions 12201 12102)

    Upgrade the software library on your service with the required non-CDB image version and BP.

  • 10Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    Use Case: dbaascli- Patching operation on databases

    You can patch Oracle databases on ExaCS using dbaascli utility.

    Database Patch list -

    dbaascli patch db list --oh hostname:/u02/app/oracle/product/12.1.0/dbhome_2

    Database Patch prereq

    dbaascli patch db prereq --patchid --instance1 hostname:

    dbaascli patch db prereq --patchid --dbnames

    dbaascli patch db prereq --patchid --dbnames -alldbs

    dbaascli patch db prereq --patchid --dbnames= -alldbs

    Database Patch apply -

    dbaascli patch db apply --patchid --instance1 hostname: --dbnames

    --run_datasql 1

    dbaascli patch db apply --patchid --dbnames

    dbaascli patch db apply --patchid --dbnames -alldbs

    Database patch Rollback -

    dbaascli patch db switchback --patchid --instance1 hostname: --dbnames -

    -run_datasql 1

    dbaascli patch db switchback --patchid --dbnames -alldbs

    dbaascli patch db switchback --patchid --dbnames

  • 11Copyright © 2019, Oracle and/or its affiliates