59
Oracle Autonomous Database What’s the DBA’s Role? Biju Thomas @biju_thomas 27-Sep-2019

Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Oracle Autonomous DatabaseWhat’s the DBA’s Role?

Biju Thomas

@biju_thomas

27-Sep-2019

Page 2: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Biju Thomas

3

❖ Principal Solutions Architect @ OneNeck IT Solutions❖ Over 20 years of Oracle Database development and administration expertise❖ Over 10 years of Oracle E-Business Suite Architecture & Tuning expertise❖ First book published in September 2000, seventh in 2015❖ DBA blog since 1997 – www.bijoos.com❖ Daily Oracle Tidbits #oratidbit❖ Oracle ACE Director

Page 3: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Oracle Cloud - Prelude

• Late entrant to the Cloud market

• Transition from product company to services company. Consumption-based, service-driven with a retail model discipline.

• Subscription/consumption model for the cloud should be applicable for databases to be relevant in the new world.

• Oracle internally transitioning to its own cloud to improve operational capabilities.

• Oracle develops and maintains its own Oracle Cloud infrastructure.

• Existing public clouds are not capable of supporting the kinds of enterprise applications, databases and workloads that Oracle customers run.

4

Page 4: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 5: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

What is Autonomous Database?

• Comprised of Oracle Database 18c Enterprise Edition (with all database options and management packs included from a software packaging perspective)

• Oracle Exadata X7-2 as the deployment platform• Real Application Clusters, Oracle Active Data Guard, In-Memory

• Dedicated PDB. The memory, flash cache, and other resources on an Oracle Exadata system are not dedicated.

• Oracle Cloud Automated Database Operations components (scripts, best practices, procedures, etc.)

• Patched per Oracle’s schedule• No downtime, no announcement.

Page 6: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

“There is nothing to learn, there is nothing to do”

Autonomous Database CLOUD SERVICE

Page 7: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Columnar Format Row Format

Data Summaries Automated Indexes

Optimizes Complex SQL Optimizes Response Time

Plan Stability

Runaway Query Prevention

Plan Stability

Runaway Query Prevention

Page 8: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

ATP – Dedicated Autonomous Database• An Autonomous Exadata

Infrastructure• Hardware rack which includes

compute nodes and storage servers tied together by a high speed, low latency InfiniBand network and intelligent Exadata software.

• An Autonomous Container Database• Container Database for multiple user

databases

• An Autonomous Transaction Processing Database • User Database configured for a

transactional workload

Page 9: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

• CREATE/ALTER TABLESPACE command not available.

• RMAN not available.

• Oracle Database Result Cache is enabled by default for all SQL statements.

• Do not have direct access to the database node or to the local file system.

• ADW Specific:• Compression is enabled by default for ADW. Uses Hybrid Columnar Compression for

all tables by default.

• Parallelism is enabled by default. Degree of parallelism for SQL statements is set based on the number of OCPUs in the system and the database service the user is connecting to.

• Parallel DML is enabled by default.

ATP / ADW

Autonomous Database Properties

Page 10: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Create Autonomous Database

The Easy Part!

Page 11: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 12: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 13: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 14: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 15: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 16: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 17: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 18: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Connecting to Autonomous Database

SQL Developer, SQL*Plus, SQLcl, ODBC, JDBC

Page 19: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 20: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 21: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 22: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Extract tnsnames.ora and sqlnet.ora files

Adjust sqlnet.ora with correct Wallet path

Page 23: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Creating Schemas and Users

No privileges to create a tablespace, profile or database link **.

• All users default tablespace is DATA.

• All objects will get created on DATA – physical properties ignored.

• DB links to ADW/ATP allowed.

• “Admin” can create database link using API

18c Database: Schema accounts available.

• Create user <x> NO AUTHENTICATION.

“Admin” needs to create the user.

• Provide Wallet to user to connect to database.

• Assign appropriate role.

Account locked for 24 hours after ten (10) failed login attempts.

• “Admin” can unlock the account.

Page 24: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Using Data Pump for Export & Import

Page 25: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Data Pump on ADW/ATP• User must have DWROLE or DATAPUMP_CLOUD_IMP or DATAPUMP_CLOUD_EXP.

• Supported Clouds• OCI Object Storage & Object Storage Classic• Azure Blob Storage, Amazon S3

• Steps:• Generate token to authenticate to cloud• Create Credential (DBMS_CLOUD.CREATE_CREDENTIAL)• Use impdp or expdp from your (client) machine, file location is a URL.

• dumpfile=https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/adwc/adwc_user/export%u.dmp

• dumpfile=https://s3-us-east-1.amazonaws.com/my-aws-bucket/ebsfull%.dmp

• Use additional recommended parameters to conform to ADW/ATP• transform=segment_attributes:n

• transform=dwcs_cvt_iots:y

• transform=constraint_use_default_index:y

• exclude=index, cluster, indextype, materialized_view, materialized_view_log, materialized_zonemap, db_link

• Move log file to Cloud Storage (DBMS_CLOUD.PUT_OBJECT)

Documentation

Page 26: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

What is DBMS_CLOUD Package for?

• To interact with Cloud storage (OCI, AWS, Azure)

• To manage credentials• Create, drop, enable, disable, update

• To create and validate external table

• To load (copy) data to a table from external file

• To copy files (data) from database server to cloud storage and vice versa

• To list the objects (files) on a cloud bucket

• To list and delete files on the database server

• To create additional directories (DATA_PUMP_DIR is default)

https://antognini.ch/2018/07/dbms_cloud-package-a-reference-guide

Page 27: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Local MachineOn-Prem

Cloud StorageAWS / Azure / Oracle Cloud

Exadata running ADW/ATPDATA_PUMP_DIR

DELETE_OBJECT LIST_OBJECTS

PUT_OBJECT

COPY_DATA → CREATE_EXTERNAL_TABLE →

DELETE_FILEGET_OBJECT →

LIST_FILES

SQL DeveloperSQLclExpdpImpdp

DBMS_CLOUD

Page 28: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

What is DBMS_CLOUD_ADMIN Package for?• Enable or disable application continuity.

• Create or drop database links.

• Grant tablespace quota to a user.

Page 29: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

DESCRIBE DBMS_CLOUD:PROCEDURE COPY_DATAPROCEDURE CREATE_CREDENTIALPROCEDURE CREATE_DIRECTORYPROCEDURE CREATE_EXTERNAL_TABLEPROCEDURE DELETE_ALL_OPERATIONSPROCEDURE DELETE_FILEPROCEDURE DELETE_OBJECTPROCEDURE DELETE_OPERATIONPROCEDURE DISABLE_CREDENTIALPROCEDURE DROP_CREDENTIALPROCEDURE DROP_DIRECTORYPROCEDURE ENABLE_CREDENTIALFUNCTION GET_METADATA RETURNS CLOBFUNCTION GET_OBJECT RETURNS BLOBPROCEDURE GET_OBJECT

DESCRIBE DBMS_CLOUD:FUNCTION LIST_FILES RETURNS TABLEFUNCTION LIST_OBJECTS RETURNS TABLEPROCEDURE PUT_OBJECTPROCEDURE RESIGNAL_USER_ERRORPROCEDURE UPDATE_CREDENTIALPROCEDURE VALIDATE_EXTERNAL_TABLE

DESCRIBE DBMS_CLOUD_ADMIN:PROCEDURE CONFIGURE_DATABASE_VAULTPROCEDURE CREATE_DATABASE_LINKPROCEDURE DISABLE_APP_CONTPROCEDURE DROP_DATABASE_LINKPROCEDURE ENABLE_APP_CONTPROCEDURE GRANT_TABLESPACE_QUOTA

Page 30: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Available Tuning Tools

Service Console

• CPU Utilization, Response, time, Running SQL

• Real time and historic database activity

• Monitored SQL / Download Report

SQL Developer

• Instance Viewer

• Realtime SQL Monitor

Optimizer

• Gather table/schema statistics

• Enable hints at a session level

Oracle Management Cloud

• Get alerted on issues

Performance Hub

Page 31: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Cloud Dashboard: Metrics

Page 32: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 33: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 34: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 35: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

• No Tuning Pack.

• Partition tables in ADW

• Scale up number of CPUs / Autoscaling

• Use a different service

Database Tuning Possibilities

Page 36: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 37: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

ADW ATP• HIGH

• Highest resources, lowest concurrency

• Queries run in parallel

• MEDIUM• Less resources, higher concurrency• Queries run in parallel

• LOW• Least resources, highest

concurrency• Queries run serially

• TPURGENT• The highest priority application connection service for time

critical operations.

• TP• typical application connection service for transaction processing

operations.• No parallelism.

• HIGH• Highest priority when the system is under resource pressure.• Queries run serially unless you specify a parallel degree through

a session parameter, using a statement hint, or by specifying a parallel degree on the underlying tables.

• MEDIUM• Medium priority when the system is under resource pressure.• Queries run serially unless you specify a parallel degree through

a session parameter, using a statement hint, or by specifying a parallel degree on the underlying tables. Degree of parallelism is limited to four (4).

• LOW• Lowest priority when the system is under resource pressure.• Queries run serially.

Page 38: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 39: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

• cs_resource_manager.update_plan_directive(consumer_group => 'HIGH', io_megabytes_limit => 1000, elapsed_time_limit => 120);

• cs_resource_manager.update_plan_directive(consumer_group => 'HIGH', io_megabytes_limit => null, elapsed_time_limit => null);

• A session may be terminated if it stays idle for more than five (5) minutes

Manage Runaway SQL

Page 40: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

• ADW• Gathers optimizer statistics automatically for tables loaded with direct-path load

operations.• If you have tables modified using conventional DML operations you can run commands to

gather optimizer statistics for those tables.• Ignores optimizer hints and PARALLEL hints in SQL statements by default. To change at

session level:• ALTER SESSION SET OPTIMIZER_IGNORE_HINTS=FALSE;

• ALTER SESSION SET OPTIMIZER_IGNORE_PARALLEL_HINTS=FALSE;

• ATP• Gathers optimizer statistics automatically so that you do not need to perform this task

manually. Automatic statistics gathering runs in a standard maintenance window.• Honors optimizer hints and PARALLEL hints in SQL statements by default. To change at

session level:• ALTER SESSION SET OPTIMIZER_IGNORE_HINTS=TRUE;

• ALTER SESSION SET OPTIMIZER_IGNORE_PARALLEL_HINTS=TRUE;

Statistics Gathering & Hints

Page 41: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Using AWR / ADDM / OEM

• Generate an AWR report on the Performance Hub of OMC.

• AWR at a PDB Level using DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML,

DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_TEXT

• Query V$ACTIVE_SESSION_HISTORY, DBA_HIST_ACTIVE_SESS_HISTORY

• SQL Developer DBA Menu

• No OEM Access (use OMC instead)

• No access to Alert log

Page 42: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

(Adhoc) BackupRecovery

Page 43: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 44: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Miscellaneous Admin Activities

• Clone ADW or ATP• Full database or database metadata

• Setup network Access Control List (ACL) to restrict access to a specific ADW/ATP database. • The database only accepts connections from addresses

specified on the ACL and rejects all other client connections.

• Set up a Service Gateway to allow connectivity to ADW/ATP from private IP addresses in private subnets without requiring an Internet Gateway in your VCN.

• Enable or disable application continuity.

• Analyze audit events with standard log analysis tools or using the Audit service Console, the Audit APIs, or the Java SDK.

Page 45: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 46: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 47: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 48: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 49: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB
Page 50: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

• https://blogs.oracle.com/datawarehousing/managing-autonomous-data-warehouse-using-oci-curl

• Provision, start, stop, scale, backup, restore, …

• Reference: OCI API Documentation• https://docs.cloud.oracle.com/iaas/api/#/en/database/20160918/Autonomo

usDatabase/

Managing Autonomous Database Using oci-curl

Page 51: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Can I use ADW only a few days a month?

Page 52: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Use Goldengate with ADW / ATP?

https://docs.oracle.com/goldengate/c1230/gg-winux/GGODB/replicating-data-oracle-autonomous-data-warehouse-cloud.htm

Page 53: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

What is Oracle Data Visualization Desktop?

Page 54: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/experienced-database-users.html

RESTRICTIONS…. Many!

Page 55: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

PDB Lockdown Profiles

Page 56: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Summary

• D(b)A’s Role

• No DB Administration / Configuration

• Not much Tuning options

• Recovery (if ever)

• User Management

• Integration

• Data copy / replication / loading

• Connectivity

• Cloud Network / Security

• Create external tables, database links

• Application & SQL Tuning

• Open SR if issues found

Page 57: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

https://go.oracle.com/LP=78880

Page 58: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

Oracle ACE Program

Page 59: Oracle Autonomous Database...Sep 27, 2019  · •Oracle Exadata X7-2 as the deployment platform •Real Application Clusters, Oracle Active Data Guard, In-Memory •Dedicated PDB

THANK YOU!

Daily #oratidbit on Facebook and Twitter

Tweets: @biju_thomasFacebook: facebook.com/oraclenotes

Blog: bijoos.com/oraclenotes

www.OneNeck.com