m odule 3: w eek 6 d atabase management 1 itec 450 fall 2012

30
MODULE 3: WEEK 6 DATABASE MANAGEMENT 1 I T E C 4 5 0 F a l l 2 0 1 2

Upload: aubrie-hicks

Post on 12-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

ITEC

45

0

1

MODULE 3: WEEK 6DATABASE MANAGEMENT

Fall 2

01

2

Page 2: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

2

ITEC

45

0

ACCESS DATABASE – SQL PLUS

Fall 2

01

2

Page 3: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

3

ITEC

45

0

SQL PLUS LOGIN

Fall 2

01

2

Page 4: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

4

ITEC

45

0

SQL PLUS COMMANDS

Fall 2

01

2

Page 5: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

5

ITEC

45

0

OEM (HTTPS://{HOSTNAME}:1158/EM)

Fall 2

01

2

Page 6: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

6

ITEC

45

0THE DATA DICTIONARY

Looking at Data Dictionary Components Using Data Dictionary Views Useful Dynamic Performance Views Examining Table Structure Using SQL*Plus

and iSQL*Plus

Fall 2

01

2

Page 7: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

7

ITEC

45

0

LOOKING AT DATA DICTIONARY

Fall 2

01

2

Page 8: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

8

ITEC

45

0

LOOKING AT DATA DICTIONARY

Generally, USER, ALL, and DBA views are in sets USER_TABLES, ALL_TABLES, DBA_TABLES

Each view has nearly identical columns USER version omits OWNER column; it also

sometimes omits columns to simplify the view V$ and GV$ views are in sets There are few views that don’t begin these prefixes For simplicity, all views (except DBA ones) prefix

public synonyms and public permission to query

Fall 2

01

2

Page 9: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

9

ITEC

45

0

USING DATA DICTIONARY VIEWS

Frequently used (static) data dictionary views: USER_TABLES, USER_VIEWS ALL_DEPENDENCIES USER_ERRORS USER_INDEXES, USER_IND_COLUMNS DBA_SOURCE USER_TAB_PRIVS, ALL_TAB_PRIVS_MADE USER_TAB_PRIVS_MADE DBA_USERS PRODUCT_COMOPONET_VERSION

Fall 2

01

2

Page 10: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

10

ITEC

45

0USEFUL DYNAMIC PERFORMANCE

VIEWS

Begin with V$ and have a counterpart GV$ view V$SYSSTAT V$SQL V$SESSTAT V$SESSION_WAIT V$FILESTAT V$FILESTAT

Primary use: tuning the database system Oracle provides options for gathering/viewing

stats Statistics are used to tune a database This book does not cover the details of DB tuning

Fall 2

01

2

Page 11: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

ITEC

45

0

11

MODULE 3 DATABASE MANAGEMENTSection 1 Database Change Management

Fall 2

01

2

Page 12: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

12

ITEC

45

0

DRIVERS FOR CHANGE MANAGEMENT

Change is inevitable but necessary for business survival and success.

Missed a requirement – an existing system is missing a feature

Identified a defect Scalability demand, marketplace changes Policy and politics – process, procedure or

methodology; legislation changes

Fall 2

01

2

Page 13: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

13

ITEC

45

0

CHANGE MANAGEMENT REQUIREMENTS Proactively change – the earlier to make

change, the lower cost to achieve it Planning analysis – intelligently examining

the change whether it is necessary, and planning to do it right the first time

Impact analysis – comprehensive impact and risk analysis

Execution – standardization of procedure, availability consideration, quick and efficient delivery

Fall 2

01

2

Page 14: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

14

ITEC

45

0

TYPES OF DATABASE CHANGES DBMS software – versions and releases for

new features, functions, bug fixes, support models

Hardware configuration – memory, CPU, storage device

Logical and physical design for an application

Physical database structures

Fall 2

01

2

Page 15: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

15

ITEC

45

0

IMPACT OF DATABASE CHANGES

Data Definition Language is mainly used for database changes.

Create, alter, and drop schema objects require exclusive access to the specified object

The change is implicitly committed The change may cause dependent objects

become invalid, which may need to recompile or reauthorize schema objects

Recovery from a database change is challenging, and has to be well-planned.

Fall 2

01

2

Page 16: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

16

ITEC

45

0

EXECUTION OF DATABASE CHANGES

Maintain current database structures – source control and version control

Migration process Request database change Standardized change requests Managing database changes from one

database environment to another Condense a series of changes by comparing

database structures, and migrate the differences

Fall 2

01

2

Page 17: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

17

ITEC

45

0

EXAMPLES OF DATABASE CHANGES

Change Management: planning (necessary?) impacts, and execution (recovery?)

Add a new column to the end of a table Resize a column from char (8) to char (12) Re-create a new package, procedure, or

function Add a new column to the middle of a table

Fall 2

01

2

Page 18: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

ITEC

45

0

18

MODULE 3 DATABASE MANAGEMENTSection 2 High Availability Requirement and Architecture

Fall 2

01

2

Page 19: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

19

ITEC

45

0

DRIVERS OF AVAILABILITY

Availability is the condition where a given resource can be accessed by its consumers.

Mandate for 24x7 availability Shrinking maintenance window Full-time availability: airline reservation

systems, credit card approval Cost of downtime

Fall 2

01

2

Page 20: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

20

ITEC

45

0

AVAILABILITY PROBLEMS

Disasters: loss of the data center System failures

Server infrastructure problems: network , loss of the server hardware, storage, operating system

Software failure: DBMS, application, corruption of data

Data failures Procedure problems: security and authorization,

loss of database objects Human errors: loss of data, DBA mistakes

Fall 2

01

2

Page 21: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

21

ITEC

45

0

AVAILABILITY SOLUTIONS

Automate DBA functions Exploit high-availability DBMS features Exploit clustering technology Hardware redundancy design

Fall 2

01

2

Page 22: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

22

ITEC

45

0

HIGH AVAILABILITY DBMS FEATURES Solutions to disasters

Oracle data guard – a single primary database and one or more standby database

SQL Server database mirroring – a single copy of the mirrored database that must reside on a different server instance, usually on a separate physical server in a different location

Hardware replication: EMC SRDF Solutions to system failures

Oracle Real Application Clusters SQL Server transactional replication DB2 Data Sharing

Solutions to data failures Backup and recovery capability Flashback database: view data at a point-in-time in the past Partition: decompose large tables and indexes into smaller

and more manageable pieces

Fall 2

01

2

Page 23: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

23

ITEC

45

0

CLUSTERING TECHNOLOGY

A cluster is a group of interconnected servers for increasing the reliability of servers.

Oracle standby database:

Fall 2

01

2

Page 24: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

24

ITEC

45

0ORACLE REPLICATION

Fall 2

01

2

Page 25: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

25

ITEC

45

0

SQL SERVER DATABASE MIRRORING

Database mirroring maintains an exact copy of the database on the mirror.

It works at the level of the physical log record (by sending the actual log records to the mirror server).

Fall 2

01

2

Page 26: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

26

ITEC

45

0

SQL SERVER TRANSACTIONAL REPLICATION ARCHITECTURE

Fall 2

01

2

Page 27: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

27

ITEC

45

0

ORACLE REAL APPLICATION CLUSTER (RAC)

Oracle database with RAC architecture build higher levels of availability on top of the standard Oracle features.

Fall 2

01

2

Page 28: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

28

ITEC

45

0

HARDWARE REDUNDANCY DESIGN

No single point of failures on CPU, Memory, I/O controller, Network, etc.

Clustered software to failover to another server in seconds

RAID technology (Redundant Arrays of Inexpensive Disks) – one large logical storage unit with a set of physical disk drives

Fall 2

01

2

Page 29: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

29

ITEC

45

0

RAID TECHNOLOGY

RAID example with 4 disks and striping.

Pages 1-4 can be read/written simultaneously

Fall 2

01

2

Page 30: M ODULE 3: W EEK 6 D ATABASE MANAGEMENT 1 ITEC 450 Fall 2012

30

ITEC

45

0

WRAP UP

Assignment 6-1: Research Paper: Database High Availability

Fall 2

01

2