Upload
others
View
11
Download
0
Embed Size (px)
Citation preview
Oracle Database
Amazon AWS
/k21academy /k21academy /k21academy [email protected]/k21academy
Atul KumarOracle ACE & Author
Rajeev KCloud Expert
Atul Kumar
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
2
Rajeev.K
➢ Expert in Oracle Database & Cloud
➢ 12+ Years Experience Managing Team of 25+
➢ Based in USA working with top Consultancy
➢ Trained 300+ trainees and 30+ corporate clients
➢ Oracle Certified Professional
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
3
Kirti JainIDAM ExpertAtul Kumar
Oracle ACE & Author
http://k21academy.com/joincloud
Join Private Facebook Group
➢ Get Support: [email protected] (New Mail for Different Issue)
➢ Add Yourself in WhatsApp Group (Live Sessions Only)
➢ Unlimited Retake for Next 3 Years
➢ Before Coming to Class: Watch Video & Look at Activity Guide
➢ Ask as Many Questions as you can & make session interactive
➢ Remind Us to Record the Session
➢ Do Hands-On
➢ Feedback Good/Bad to Trainer for improvement
Making Best of Your Training
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
5
Getting Help
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
6
Agenda: Module
➢ Overview: Oracle Database on Amazon (AWS)
➢ Amazon RDS for Oracle
➢ Provisioning RDS Instance
➢ RDS Key Feature
➢ Managing an Oracle RDS Instance
➢ DBA System Tasks
➢ DBA Database Tasks
➢ DBA Log Tasks
➢ DBA Miscellaneous Tasks
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
7
Overview
Oracle Database on Amazon AWS
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
8
Overview: Oracle DB on AWS
➢ Terminology
➢ AWS stands for Amazon Web Services
➢ EC2 stands for Elastic Compute Cloud
➢ S3 stands for Simple Storage Service
➢ Amazon offers two options for running Oracle Database on AWS
➢ Amazon Relational Database Service (Amazon RDS) for Oracle which is a
managed database service that helps simplify the provisioning and
management of Oracle Database
➢ Running a self-managed Oracle Database directly on Amazon Elastic Compute
Cloud (Amazon EC2)
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
9
AWS To Use When Deploying Oracle
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
10
Hosting Databases On-Premise
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
11
Hosting Databases In Amazon EC2
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
12
Amazon RDS for Oracle
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
13
Hosting Databases On Amazon RDS
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
14
➢ Amazon RDS for Oracle
➢ AWS recommends RDS first
➢ Focus on tasks that bring value
to your business
➢ Focus on high level tuning
tasks and schema optimization
➢ Lack of in-house expertise
managing databases
Choosing The Right Solution
➢ Oracle on Amazon EC2
➢ You need full control over the DB
instances
➢ Control over backups, replication
➢ and clustering
➢ Use features and options not
available in Amazon RDS
➢ Size and performance needs exceed
Amazon RDS offering
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
15
➢ A web service that makes it easier to set up, operate, and scale a relational
database in the cloud
➢ Amazon RDS manages backups, software patching, automatic failure detection,
and recovery
➢ Amazon RDS doesn't provide shell access to DB instances, and it restricts
access to certain system procedures and tables that require advanced privileges
➢ In addition to the security in your database package, you can help control who
can access your RDS databases by using AWS Identity and Access Management
(IAM) to define users and permissions
➢ You can also help protect your databases by putting them in a virtual private
cloud.
Amazon RDS For Oracle
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
16
Provisioning RDS Instance
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
17
➢ Select Oracle Database Edition
➢ Choose Instance Class
➢ Specify Database Details
➢ Configure Advanced Settings
➢ You are Done
Create RDS Instance For Oracle
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
18
RDS Key Features
➢ Scaling Compute & Storage
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
19
RDS Key Features: Scale Up
➢ Scaling Compute & Storage
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
20
RDS Key Features: HA
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
21
RDS Key Features: Backup & Patch
➢ Backup & Patches
➢ Automated or manual backups
➢ Restore any backup to a point in time
➢ Automated patch management
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
22
RDS Key Features: DR
➢ Disaster Recovery (DR)
➢ Cross-region snapshot copy for greater durability & ease of migration
➢ Copy a database snapshot to a different AWS Region
➢ Restore in the case of a regional disaster
➢ Or use it to migrate a database to a different region
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
23
RDS Key Features: DR
➢ Replicate Data Across Regions to have a warm standby ready to fail over to
➢ AWS Database Migration Service
➢ Oracle GoldenGate
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
24
RDS Key Features: Security
➢ A security group controls the access to a DB instance
➢ Allowing access to IP address ranges or Amazon EC2 instances that you
specify
➢ Amazon RDS uses DB security groups, VPC security groups, and EC2
security groups
➢ A DB security group controls access to EC2-Classic DB instances that are
not in a VPC
➢ A VPC security group controls access to DB instances and EC2 instances
inside a VPC
➢ An EC2 security group controls access to an EC2 instance
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
25
Managing an Oracle RDS Instance
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
26
Managing an Oracle RDS Instance
➢ Common DBA Tasks for Oracle DB Instances
➢ DBA System Tasks
➢ DBA Database Tasks
➢ DBA Log Tasks
➢ DBA Miscellaneous Tasks
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
27
DBA Tasks for Instance
➢ Changing the Global Name of a Database
➢ Creating and Sizing Tablespaces
➢ Setting the Default Tablespace
➢ Checkpointing the Database
➢ Setting the Database Time Zone
➢ Working with Oracle External Tables
➢ Validating DB Instance Files
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
28
DBA Tasks for Instance
➢ Killing a session
➢ Traditional Approach
➢ alter system kill session ‘ sid, serial#’ IMMEDIATE;
➢ RDS Approach
➢ You can’t invoke the “alter system” command in RDS
➢ You have to use the utilities provided by the RDS ( rdsadmin.rdsadmin_util)
➢ exec rdsadmin.rdsadmin_util.kill(sid, serial#);
➢ Flushing the Shared Pool
➢ Traditional Approach
➢ alter system flush shared_pool;
➢ RDS Approach
➢ exec rdsadmin.rdsadmin_util.flush_shared_pool;www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
29
DBA Tasks for Instance
➢ Changing the Global Name of a Database
➢ Creating and Sizing Tablespaces
➢ Setting the Default Tablespace
➢ Checkpointing the Database
➢ Setting the Database Time Zone
➢ Working with Oracle External Tables
➢ Validating DB Instance Files
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
30
DBA Tasks for Instance
➢ Creating and Sizing Tablespaces
➢ Amazon RDS only supports Oracle Managed Files (OMF) for data files, log
files and control files
➢ When you create data files and log files, you can't specify the physical file
names
➢ create tablespace users2 datafile size 1G autoextend on maxsize 10G;
➢ create temporary tablespace temp01;
➢ alter tablespace users2 resize 200M;
➢ alter tablespace users2 add datafile size 100000M autoextend on next
250m maxsize UNLIMITED;
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
31
DBA Tasks for Instance
➢ Setting the Default Temporary Tablespace
➢ Traditional Approach:
➢ ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp01
➢ RDS Approach:
➢ exec
rdsadmin.rdsadmin_util.alter_default_temp_tablespace(tablespace_na
me => 'temp01');
➢ Checkpointing the Database
➢ Use the Amazon RDS procedure rdsadmin.rdsadmin_util.checkpoint to
checkpoint the database
➢ exec rdsadmin.rdsadmin_util.checkpoint;
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
32
DBA Tasks for Instance
➢ Working with Oracle External Tables
➢ You can store external table files in directory objects
➢ Create a directory object, or use one that is predefined in the Oracle
database, such as the DATA_PUMP_DIR directory
➢ You can query the ALL_DIRECTORIES view to list the directory objects for
your Amazon RDS Oracle DB instance
➢ Directory objects point to the main data storage space (Amazon EBS
volume) used by your instance
➢ The space used along with data files, redo logs, audit, trace, and other
files counts against allocated storage
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
33
DBA Tasks for Instance
➢ Working with Oracle External Tables➢ Use case: Move data that is in an Amazon RDS Oracle DB instance into an
external data file
➢ Populate the external data file by creating an external table and selecting the
data from the table in the databaseCREATE TABLE orders_xt
ORGANIZATION EXTERNAL
(
TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY DATA_PUMP_DIR
LOCATION ('orders_xt.dmp')
)
AS SELECT * FROM orders;
➢ Data is populated in the orders_xt.dmp file in the DATA_PUMP_DIR directory
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
34
DBA Log Tasks
➢ Setting Force Logging
➢ Setting Supplemental Logging
➢ Switching Online Log Files
➢ Adding and Dropping Online Redo Logs
➢ Resizing Online Redo Logs
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
35
DBA Log Tasks
➢ Switching Online Log Files➢ exec rdsadmin.rdsadmin_util.switch_logfile;
➢ Adding Online Redo Logs➢ exec rdsadmin.rdsadmin_util.add_logfile(p_size => '100M');
➢ Dropping Online Redo Logs➢ exec rdsadmin.rdsadmin_util.drop_logfile(grp => 3);
➢ Retaining Archived Redo Logsbegin
rdsadmin.rdsadmin_util.set_configuration(
name => 'archivelog retention hours',
value => '24’);
end;
/
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
36
DBA Log Tasks
Log Type Retention Schedule
Alert Logs The text alert log is rotated daily with 30 day retention managed by Amazon RDS. The
XML alert log is retained for at least 7 days and can be accessed using
the ALERTLOG view.
Audit Files The default retention period for audit files is 7 days. Amazon RDS may delete audit files
older than 7 days.
Trace files The default retention period for trace files is 7 days. Amazon RDS may delete trace files
older than 7 days.
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
37
DBA Miscellaneous Tasks
➢ Manage Oracle Directories
➢ Manage and operate on database parameter file
➢ Enable database options like SPATIAL, EM Express, TDE etc
➢ Monitoring AWS RDS Instances
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
38
Manage Oracle Directories
➢ Create New Directories in the Main Data Storage Space
➢ exec rdsadmin.rdsadmin_util.create_directory(p_directory_name => 'product_descriptions’);
➢ select DIRECTORY_PATH from DBA_DIRECTORIES where DIRECTORY_NAME =
'product_descriptions';
➢ Listing Files in a DB Instance Directory
➢ select * from table (rdsadmin.rds_file_util.listdir(p_directory => 'product_descriptions'));
➢ Reading Files in a DB Instance Directory
➢ select * from table (rdsadmin.rds_file_util.read_text_file( p_directory =>
'product_descriptions', p_filename => 'rice.txt'));
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
39
Manage & Operate DB Param File
➢ How to change DB parameters in Amazon RDS using AWS Management
Console
➢ In order to Change a DB parameter on Amazon RDS, you must use a "Parameter
Group“
➢ A Parameter Group is a set of parameters identified by a name
➢ A "Parameter Group" can be shared with several Oracle Database Instances
➢ Amazon allows you to create only one single group and to re-use that group
across several database instances
➢ Implement standardized databases
➢ You can have a Parameter Group for all your Dev databases, another
Parameter Group for all your Test Databases, and so on
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
40
Manage & Operate DB param file
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
41
Manage & Operate DB Param File
➢ How to change DB parameters in Amazon RDS using AWS Management
Console
➢ At the time of the creation Amazon will assign a default Parameter Group usually
called "default.oracle-ee-12.1
➢ The default Parameter Group cannot be modified; You cannot change the value
of any parameter inside that default one
➢ You should create a new Parameter Group any time after the database creation
to change the parameter file
➢ AWS Management Console -> Parameter Groups and click on Button
"Create Parameter Group"
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
42
Manage & Operate DB Param File
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
43
Enable Database Options & Features
➢ Option Groups
➢ Amazon RDS uses option groups to
enable and configure database features
listed below
➢ Oracle Application Express
➢ Oracle Enterprise Manager
➢ Oracle Label Security
➢ Oracle Locator
➢ Oracle Multimedia
➢ Oracle Native Network Encryption
➢ Oracle SQLT
➢Oracle SSL
➢Oracle Spatial
➢Oracle Statspack
➢Oracle Time Zone
➢Oracle Transparent
Data Encryption
➢Oracle UTL_MAIL
➢UTL_MAIL
➢Oracle XML DB
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
44
Enable Database Options & Features
➢ Working with Option Groups
➢ Amazon RDS uses option groups to enable and configure features
➢ An option group can specify features, called options, that are available for a
particular Amazon RDS DB instance
➢ Options can have settings that specify how the option works
➢ RDS provides an empty default option group for each new DB instance
➢ You cannot modify this default option group
➢ To apply an option to a DB instance, you must do the following:
➢ Create a new option group, or copy or modify an existing option group
➢ Add one or more options to the option group
➢ Associate the option group with the DB instance
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
45
Enable Database Options & Features
➢ Enable EM Express
➢ Amazon RDS supports Oracle Enterprise Manager (OEM) Database
Express through the use of the OEM option
➢ OEM enabled database is not supported on the following DB instance
classes: db.t2.micro, db.t2.small, db.m1.small
➢ To add the OEM option to a DB instance:
➢ Determine the option group you want to use (You can create a new option
group or use an existing option group)
➢ Add the OEM option to the option group, and configure the option settings
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
46
Enable Database Options & Features
➢ Apply the option group to a new or existing DB instance
➢ After you enable the OEM option, you can begin using the OEM Database
tool from your web browser
➢ https://mydb.f9rbfa893tft.us-east-1.rds.amazonaws.com:5500/em
Note: mydb.f9rbfa893tft.us-east-1.rds.amazonaws.com is the endpoint for
your Amazon RDS DB instance with OEM port as 5500
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
47
Monitoring Amazon RDS
➢ Amazon RDS Events: Notifies when changes occur with a DB instance, DB cluster, DB
snapshot, DB cluster snapshot, DB parameter group, or DB security group.
➢ Database log files: View, download, or watch database log files using the Amazon
RDS console or Amazon RDS API actions. You can also query some database log files
that are loaded into database tables.
➢ Amazon RDS Enhanced Monitoring: Look at metrics in real time for the operating
system that your DB instance or DB cluster runs on
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
48
Monitoring Amazon RDS
➢ Amazon CloudWatch for additional monitoring capabilities
➢ RDS automatically sends metrics to CloudWatch every minute for each
active database instance
➢ Amazon CloudWatch Alarms to watch a metric over a specific time period,
and perform one or more actions based on the value of the metric relative
to a threshold you set
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
49
Summary
➢ Overview: Oracle database on Amazon Web Services
➢ Amazon RDS for Oracle
➢ Provisioning RDB instance
➢ RDS Key Feature
➢ Managing an Oracle RDS Instance
➢ DBA System Tasks
➢ DBA Database Tasks
➢ DBA Log Tasks
➢ DBA Miscellaneous Tasks
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
50
http://facebook.com/k21Academy
http://twitter.com/k21Academy
https://www.linkedin.com/company/k21academy
https://www.youtube.com/k21academy
Find Us
www.k21academy.com/joincloud © Copyright 2018 | K21 Academy | All Rights Reserved
51