harvard university oracle database administration session 1 csci e-256 introduction the role of the...

50
Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Post on 19-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Oracle Database Administration

Session 1CSCI E-256 Introduction

The Role of the DBA

Page 2: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Introduction

What is Database ? What is Database Administration ? What is an Oracle DBA ? What do they do ? How do they do it ?

Page 3: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Database Most people view a database as the collection

of data from a business An application presents this data to the users

in a manageable way. The application can insert, delete or update

the data. The database structures hold and manipulate

this data

Page 4: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Database

The Data is stored in Relational Tables, defined by Columns

Data is stored as Rows in a table These tables can then be related to each

other, using relationships The database enforces these relationships

Page 5: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Types of Database Online Transaction Processing (OLTP) –

Amazon.com Decision Support (DSS) – OLTP database

used for reports Operational Data Store (ODS) – OLTP

database plus summary data Data Warehouse – special set of structures,

star schema

Page 6: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

OLTP

Online Transaction Processing Data dependency Model Many-to-many relationships Many-to-one relationships If we have more detailed data, it must be

better Normalization

Page 7: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Operational Data Store (ODS)

An ODS has been defined as – Subject oriented– Integrated– Volatile– Current valued– Comprised of only corporate detailed data

Page 8: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Data Warehouse

A Data Warehouse is a collection of integrated, subject-oriented databases designed to support the DSS (decision support) function, where each unit of data is relevant for some moment in time

W. H. Inmon

The data should be– Well defined – Consistent– Non-volatile (read-only)

Page 9: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Data Warehouse Any information, from anywhere, of anytime,

from internal and external data sources This includes operational, historical and

legacy data It can also include data from Internet service

providers and subscription databases It must include Metadata ( data about data)

Page 10: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Applications

Most are Web based.

SQL (sequel) is a language used to interface with various rdbms environments

Embedded SQL (Java, C++, etc)

Page 11: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Oracle DBA What is the Role of the DBA

– Planning, design and development – Ongoing maintenance– Data Administrator– Security

Newer Issues– Uptime– Backups with shorter windows– Larger environments– More visible

Page 12: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Oracle DBA Roles

The Systems or Operational DBA The Architect The Applications DBA The Data DBA The Internet DBA – Webmaster

Page 13: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The DBA Tasks

Software Installation Software Additions Software Upgrades Database Creation Database Standards Performance Security

Page 14: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

DBA Tasks

Software Installation– Setup the initial environment

Software Additions Software Upgrades

– What are the current releases

Page 15: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

DBA Tasks

Log SR’s (Service Request) Applying Patches System Tuning

– System level– Database level– Application level

Page 16: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Database Issues Move/Copy a database Development Issues Database Standards Security policies

DBA Tasks

Page 17: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

DBA Tasks

Education of others Reading, magazines… Third Party Software Monitoring Tools Automation

Page 18: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

heir Time

Load Data 6%

MaintainSoftware 6%

Install 6% Create and Configure 12%

Manage DatabaseSystem 55%

How DBAs spend their time

Page 19: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Past and the Present Environment

Limited scalability, no resource sharing Must be configured for peak loads, when

implemented Single points of failure Slow to adjust to the new needs of the

business Islands of computation

Page 20: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Storage Grid Database Grid

Application Server

Grid

Grid

Control

Grid Computing

Page 21: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Grid Vision Computing as a utility

– A network of clients and service providers– Cloud Computing

Virtualization– Nothing more virtual than a utility– Massive potential

Client-side: Simplicity– Request computation or information and receive it

Server-side: Sophistication– Availability, reliability, security– Capacity on demand, load balancing

Page 22: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The E-256 Course ….

System level issues Installation of the RDBMS software Adding more software options Upgrading to a new level of the RDBMS and

the issues related to this Applying patches to the RDBMS

Page 23: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Create a database “instance” Database Security, create users, roles … Create database objects, tables, indexes, etc. Examine the storage parameters the

database objects above Oracle utilities, export, import, etc Database Networking Issues

The E-256 Course ….

Page 24: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

How to manage the database using database “views”

How to “backup” the database How to “recover” the database Performance management How to get help from Oracle Oracle Enterprise Manager

The E-256 Course ….

Page 25: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Approach

Where does the database fit in the big picture The technical architecture of an application Frameworks (examples)

– Management – Performance– Backup/Recovery– Security

Page 26: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Approach

Knowledge Work Research Methods Scenario Thinking Project Management An Intentional Methodology

Page 27: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Instance

What is an Oracle database A database instance (server) is a set of

memory structures and background processes, that access a set of database files

The memory structure is the SGA (System Global Area)

Page 28: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The computer system– The operating system– Memory – Storage– Processors– Daemons

printers Networks

– Files

The Physical World

Page 29: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Logical World A Tablespace is a logical division of a

database. Each tablespace is made up of one or more

files, called datafiles. A datafile belongs to one tablespace A table is a logical structure, inside a

tablespace

Page 30: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Oracle Flexible Architecture (OFA)

/u01 - Oracle Base and Oracle Home /u01/app/oracle Oracle Base directory /u02 - The Application Home /u03 - General Usage /u04 - Oracle Datafiles

Page 31: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Oracle Flexible Architecture (OFA)

/u05 thru /u09 /u04/oradata/<SID> Example: /u04/oradata/test SID is the database identifier

Page 32: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Oracle Directory Structure

bdum p udum p pfile cdum p arch create

<SID_NAM E>

adm in

netw ork dbs bin

$ORACLE_HOME

product

/u01/app/oracle ($ORACLE_BASE)

Page 33: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Database Structures

Three Types– Internal to the Database

– Memory Based (SGA and Processes)

– External to the Database

Page 34: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Internal Database Structure Examples Table

– The only way to store data in a database

Indexes– It is a partial copy of a table, used to help speed

up accessing the data in the table

Views– A method of looking at “some” of the data in a

table or group of tables

Page 35: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Procedures– Blocks of PL/SQL statements, called by

applications– They do not return a value to the calling program

Functions– Like a procedure, but can return a value to the

calling program.

Internal Database Structures

Page 36: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Packages– These hold procedures and functions in logical

groups– A package can have PUBLIC and PRIVATE

elements– Public, would be procedures for a USERS usage– Private may be called by other procedures in the

package

Internal Database Structures

Page 37: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Triggers– Procedures that execute when a specific event

occurs– Used to augment referential integrity, enforce

additional integrity– Statement triggers– Row triggers

Internal Database Structures

Page 38: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Sequences– Sequential lists of unique numbers– Used as primary Keys

Users Schemas Database Links Undo Segments (rollback segments)

Internal Database Structures

Page 39: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Memory Structures

– System Global Area (SGA) Part of the System Memory

– Unix level processes

Page 40: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

PMON SMON

DBW0 LGWR

Library Cache Dictionary

Cache

ARCH

DatafilesRedo Log Files Archived Redo

Log Files

Data Cache Redo Log BuffersShared Pool

1

23 4

Page 41: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The System

Information on a computer is stored in bytes Bytes are grouped into Blocks The Operating System usually has 512 bytes

in a block 1K = 1024 bytes Oracle data is also stored in bytes Oracle data blocks are in 2k,4k,8k,16, or 32k

bytes

Page 42: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The System

Oracle data blocks are multiples of the Operating System blocks

The computer memory uses the same block sizes as the disk storage

Space allocation

Page 43: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Security

Users and Roles Security Patching Advanced Security Option

– Sql*net encryption

Application level security– Sql injection

Page 44: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

The Learning Environment

Distance Option Blog Method TA session Online TA session Elluminate Website Books

Page 45: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Website

Website at http://courses.fas.harvard.edu/ext/22750

www.elluminate.com

Page 46: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

How do you know you got it Understand the Concepts Be able to create a maintainable database Walk-away with a framework approach Understand where that database fits within the

technology stack The Future

– Security– Auditing– High Availability– Semantic Web

Page 47: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Security Framework

Confidentiality

Availability

Integrity

Page 48: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Environment Boundaries

Database

System Layer

Subnet layer

Network Layer

Domain Edge

Database Layer

Network Layer

Global Network

Page 49: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Strategic and Tactical

Prevent

Remediate

Monitor

React

detect

Policy

Complience

Page 50: Harvard University Oracle Database Administration Session 1 CSCI E-256 Introduction The Role of the DBA

Harvard University

Overall Strategic and TacticalPrevent

Remediate

Monitor

React

detect

Policy

Complience

Prevent

Remediate

Monitor

React

detect

Policy

Complience

System Level

Database Level