oracle database administration

58
Harvard University Oracle Database Administration Session 14 Product Review Course Review

Upload: databaseguys

Post on 20-Jul-2015

311 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Oracle Database Administration

Harvard University

Oracle Database AdministrationSession 14

Product ReviewCourse Review

Page 2: Oracle Database Administration

Harvard University

Product ReviewDataGuardStreamsRACPartitioning

Page 3: Oracle Database Administration

Harvard University

DataGuardDataguard is an Oracle technology used for data

protection, High Availability and Disaster RecoveryIt requires one primary database and you may have

up to 9 standby databasesThe standby databases can be physically located

anywhere, as long as they have a connection to the primary. The primary and standby can be on the same server

DataGuard technology ships with the Oracle database and is available automatically after installation

Page 4: Oracle Database Administration

Harvard University

DataGuard

A standby database is a consistent copy of the primary database

It is initially created from a backup copy of the primary database; the backup copy may be hot or cold

DataGuard processes maintain the standby database by applying redo data from the primary to it

Dataguard uses managed recovery or logminer technology depending upon the type of standby you have

Page 5: Oracle Database Administration

Harvard University

DataGuardThe standby database can be a physical

standby or a logical standbyA physical standby is an identical copy of the

primary database – down to the block levelA physical standby database is not open for

access – it remains in a mounted state (except in 11g you can have an Active Physical Standby database)

Page 6: Oracle Database Administration

Harvard University

DataGuard

A logical standby has the same logical data as the primary, but its physical structures can be different – it can contain schemas not in the primary

A logical standby is open for read access to the “guarded” schemas and read/write access to other schemas

Non System schemas from the primary are “guarded” in the standby – i.e. they are the schemas in the standby updated by DataGuard processes

Page 7: Oracle Database Administration

Harvard University

Page 8: Oracle Database Administration

Harvard University

DataGuard Requirements

Each server in a DataGuard configuration must be running the same OS

Each server should have the same number of CPUsEach server should have the same physical memory

sizeEach must run the same Oracle release (i.e. 10g,

11g) although patch set may be differentEach server should have the same number and size

of database file systems

Page 9: Oracle Database Administration

Harvard University

DataGuard - ConfigurationBoth the primary and the standby databases are

configured for DataGuard using init.ora parametersTo update the standby with changes from the primary,

log writer transfers archive logs to the standbyWhat happens to the archive logs on the standby

depends on whether the standby is physical or logicalIn addition, standby redo logs are configured on the

standby database allowing simultaneous writing of redo from the primary to the standby – this allows for real time updates on a physical standby

Page 10: Oracle Database Administration

Harvard University

DataGuard – Physical Standby

A physical standby runs in what is called “managed recovery” mode

As archive logs arrive on the standby server in a directory designated in the standby init.ora file, the rec0 process applies the archive logs to the standby just as if the database were being recovered using the recover command

Page 11: Oracle Database Administration

Harvard University

Page 12: Oracle Database Administration

Harvard University

DataGuard – Logical Standby

A logical standby runs in what is called “sql apply” mode

As archive logs arrive on the standby server logminer processes convert the contents of the archive logs to sql statements which are applied to the standby database

Logical standby is transactionally consistent with the primary

Page 13: Oracle Database Administration

Harvard University

Page 14: Oracle Database Administration

Harvard University

DataGuard – Physical and Logical

Page 15: Oracle Database Administration

Harvard University

Physical Standby

Database is always in mounted state and cannot be used for any other purposes

Archive logs are applied in managed recovery mode

Physical Standby is exact copy of the primary database

Physical organization and structure exact same as primary

Logical Standby

Database is always open

Logical standby can be used for read access on schemas coming over from primary and read/write access on other schemas local only to standby

Dml/ddl statements are generated from archivelogs by LogMiner and applied to standby database

Logical Standby is not an exact copy of the primary but is a transactionally consistent copy of the primary

DataGuard – Physical and Logical

Page 16: Oracle Database Administration

Harvard University

Oracle Streams

Oracle Streams enables information sharing.

Streams propagates information within a database or from one database to another.

Page 17: Oracle Database Administration

Harvard University

Streams

Streams is an Oracle technology to share information

Each UNIT of information is called a messageThese Messages are transferred through a

StreamThe Stream can move data within a database

or between databases

Page 18: Oracle Database Administration

Harvard University

Streams

Streams Capture, Stage and Apply messagesIt can apply

– data manipulation language (DML) changes– data definition language (DDL) changes

Page 19: Oracle Database Administration

Harvard University

Overview of Streams

Capture queueCapture process

Propagation processes

Apply queueApply process

Apply queueApply process

Source database One or more target databases

Page 20: Oracle Database Administration

Harvard University

Streams Capture and ApplyReplication Configuration

Page 21: Oracle Database Administration

Harvard University

Logical Change Record (LCR)

Page 22: Oracle Database Administration

Harvard University

Downstream Capture

Page 23: Oracle Database Administration

Harvard University

Oracle RAC

Oracle RAC extends the Oracle Database So that you can store, update, and retrieve

data from multiple instances on different servers, at the same time

The RAC software allows the servers to work together as a cluster.

Page 24: Oracle Database Administration

Harvard University

Oracle RAC

The files that make up the database must be on shared storage that is available to all servers in the cluster

Each server in the cluster must run the Oracle RAC software

Page 25: Oracle Database Administration

Harvard University

Oracle RAC

The Oracle RAC infrastructure is a large component of implementing an Oracle enterprise grid computing architecture

It is also part of any High Availability (HA) solution

Page 26: Oracle Database Administration

Harvard University

Single Instance vs. RAC

Page 27: Oracle Database Administration

Harvard University

RAC Databases

All Single Instance Oracle databases have a one-to-one relationship between datafiles and the instance.

Oracle RAC environments have a one-to-many relationship between datafiles and instances.

Using Oracle RAC, multi-server cluster database instances form a single (virtual) database.

The instances are on different servers (or nodes)

Page 28: Oracle Database Administration

Harvard University

RAC Databases

Each database instance in the cluster uses its own memory structures and background processes

Oracle RAC uses Cache Fusion to synchronize the data stored in the buffer cache of each cluster database instance

Page 29: Oracle Database Administration

Harvard University

RAC Hardware Architecture

Page 30: Oracle Database Administration

Harvard University

RAC Technology Layers

Page 31: Oracle Database Administration

Harvard University

RAC Setup Order

Page 32: Oracle Database Administration

Harvard University

RAC Technology Layers

Page 33: Oracle Database Administration

Harvard University

10g RAC Architecture

Page 34: Oracle Database Administration

Harvard University

Cluster Interconnect

Page 35: Oracle Database Administration

Harvard University

Page 36: Oracle Database Administration

Harvard University

Partitioning

Partitioned tables allow your data to be broken down into smaller, more manageable pieces called partitions, or even subpartitions.

Indexes can be partitioned in similar fashion. Each partition is stored in its own segment and can

be managed individually.

Page 37: Oracle Database Administration

Harvard University

Partitioning

There are a number partitioning methods – Range partitioning is based on ranges of column

values.– Hash partitioning provides a method of evenly

distributing data across a specified number of partitions.

– List partitioning gives explicit control over how rows map to partitions.

Page 38: Oracle Database Administration

Harvard University

Partitioning

More partitioning methods – Composite range-hash partitioning gives a

subpartition option – Composite range-list partitioning gives another

subpartition option

Page 39: Oracle Database Administration

Harvard University

General Course Review

Setup the ServerCreate dba GroupCreate oracle userCreate a profile for the Oracle userAdd all variables that are neededInstall the software

Page 40: Oracle Database Administration

Harvard University

Installation

Oracle 10gR2 Enterprise Edition for SolarisSet the DISPLAY variableJava based installer./runinstaller

Page 41: Oracle Database Administration

Harvard University

Database CreationOFA standardThe /admin directory treemkdir udump cdump bdump pfile create mkdir arch export

Page 42: Oracle Database Administration

Harvard University

Database Creation

Create a databaseBuild the scripts, with the tablespaces Ensure that /u*/oradata/<SID>/ directories

exist

Page 43: Oracle Database Administration

Harvard University

Database Creation

Build the database to the requirements of your application

What tablespaces are neededHow many rollback segments (automatic

UNDO)How many redo log groupsHow many members in each redo log group

Page 44: Oracle Database Administration

Harvard University

Database Creation

Do you need a special database user to hold the objects for your application

Do other users need accounts to access the application

What privileges do these uses needShould we create roles

Page 45: Oracle Database Administration

Harvard University

Database CreationUse a script to create your database objectsMake sure all tables and indexes have

storage parameters, Use ASSM What level of activity will occur on each table

or function (group of tables)What is the projected growth rateIf you do not have good information to

understand the growth, make an educated guess

Page 46: Oracle Database Administration

Harvard University

Database Creation

Growth rate will affect the storage parameters Set the PCTFREE to at least 30 on very

active tables, if usedSet the PCTUSED to 60 on those tables, if

usedIncrease the freelist value from 1 to 3, 4 or 5,

on tables that will be accessed by concurrent users, if not using ASSM

Page 47: Oracle Database Administration

Harvard University

Post Creation Activities

Setup the TNS listenerAdd the database to the tnsnames.ora fileTest access to the database through sql*netLook into the use of LDAP, Oracle Internet

Directory

Page 48: Oracle Database Administration

Harvard University

Post Creation Activities

Develop a backup strategy– Offline – Online (hot)– When– How oven

Backup the database Test database recoveryDo we take an export of the database ?

Page 49: Oracle Database Administration

Harvard University

Post Creation Activities

Develop scripts to shutdown and startup the database

Automate this processUser crontab or some other schedulerMan crontab for more information

Page 50: Oracle Database Administration

Harvard University

Post Creation Activities

Build a script to document the databaseIt can also be used for a basic level of

performance monitoringLook at the number of extents used by an

objectWhat tablespaces are your users using

Page 51: Oracle Database Administration

Harvard University

Performance

Run AWR reports on a regular basisLook at your tables and indexes to see if the

storage parameters are still correctHave a schedule to rebuild your indexesGather statistics for your database on a

regular basis, to be able to take advantage of the cost based optimizer

Page 52: Oracle Database Administration

Harvard University

Performance

Examine the top 10 SQL statementsWhere are the resource hogsSet performance goalsDesign performance goals into the initial plans

Page 53: Oracle Database Administration

Harvard University

Performance

Develop a practice of examining your database(s)

Choose some tools and get familiar with their use

Use TOP to get a quick snapshot of your system

Page 54: Oracle Database Administration

Harvard University

SecurityRegulationsEncrypt specific dataSecure the NetworkMonitor the NetworkTop 10 list

Page 55: Oracle Database Administration

Harvard University

Security

Access Control Methods– Who– What

Audit Access and Data – Who – When– What

Page 56: Oracle Database Administration

Harvard University

Things to Do

Oracle supportCSI NumberCreate metalink accountResearch methodsDocumentationTechnet.oracle.comdbdomain.com

Page 57: Oracle Database Administration

Harvard University

Documentation Reference

Oracle Documentation CDs (Various CDs)Neimeic, Richard, Oracle Performance Tuning

– Tips and TechniquesAlomari, Ahmed, Oracle & UNIX Performance

Tuning, Prentice Hall. Aronoff, Eyal, et. al., Advanced Oracle Tuning

and Administration, Oracle Press.

Page 58: Oracle Database Administration

Harvard University

The Final ExamSimilar to the mid-termSome descriptive and some multiple choice

questions300 points total