oracle database administration
TRANSCRIPT
Harvard University
Oracle Database AdministrationSession 14
Product ReviewCourse Review
Harvard University
Product ReviewDataGuardStreamsRACPartitioning
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
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
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)
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
Harvard University
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
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
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
Harvard University
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
Harvard University
Harvard University
DataGuard – Physical and Logical
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
Harvard University
Oracle Streams
Oracle Streams enables information sharing.
Streams propagates information within a database or from one database to another.
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
Harvard University
Streams
Streams Capture, Stage and Apply messagesIt can apply
– data manipulation language (DML) changes– data definition language (DDL) changes
Harvard University
Overview of Streams
Capture queueCapture process
Propagation processes
Apply queueApply process
Apply queueApply process
Source database One or more target databases
Harvard University
Streams Capture and ApplyReplication Configuration
Harvard University
Logical Change Record (LCR)
Harvard University
Downstream Capture
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.
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
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
Harvard University
Single Instance vs. RAC
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)
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
Harvard University
RAC Hardware Architecture
Harvard University
RAC Technology Layers
Harvard University
RAC Setup Order
Harvard University
RAC Technology Layers
Harvard University
10g RAC Architecture
Harvard University
Cluster Interconnect
Harvard University
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.
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.
Harvard University
Partitioning
More partitioning methods – Composite range-hash partitioning gives a
subpartition option – Composite range-list partitioning gives another
subpartition option
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
Harvard University
Installation
Oracle 10gR2 Enterprise Edition for SolarisSet the DISPLAY variableJava based installer./runinstaller
Harvard University
Database CreationOFA standardThe /admin directory treemkdir udump cdump bdump pfile create mkdir arch export
Harvard University
Database Creation
Create a databaseBuild the scripts, with the tablespaces Ensure that /u*/oradata/<SID>/ directories
exist
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
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
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
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
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
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 ?
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
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
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
Harvard University
Performance
Examine the top 10 SQL statementsWhere are the resource hogsSet performance goalsDesign performance goals into the initial plans
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
Harvard University
SecurityRegulationsEncrypt specific dataSecure the NetworkMonitor the NetworkTop 10 list
Harvard University
Security
Access Control Methods– Who– What
Audit Access and Data – Who – When– What
Harvard University
Things to Do
Oracle supportCSI NumberCreate metalink accountResearch methodsDocumentationTechnet.oracle.comdbdomain.com
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.
Harvard University
The Final ExamSimilar to the mid-termSome descriptive and some multiple choice
questions300 points total