dataguardppt oracle9i
TRANSCRIPT
-
8/14/2019 DataGuardPPT oracle9i
1/54
Oracle Data Guard
-
8/14/2019 DataGuardPPT oracle9i
2/54
Topics to be covered
What is Oracle Data Guard?
Oracle 9i Data Guard Features
New features in 10g
New features in 11g
Management Tools
What are we doing with Data Guard?
-
8/14/2019 DataGuardPPT oracle9i
3/54
What is Oracle Data
Guard?
Oracle Data Guard is the management,monitoring, and automation softwareinfrastructure that creates, maintains,and monitors one or more standby
databases to protect data from failures,disasters, errors, and corruption
-
8/14/2019 DataGuardPPT oracle9i
4/54
Oracle 9i Data Guard
Types of Standby Databases
Creating Standby Databases
Log Transport Services
Log Apply Services
Switchover/Failover
-
8/14/2019 DataGuardPPT oracle9i
5/54
Types of Standby
Databases
Physical Standby Database
Logical Standby Database
Snapshot Standby Database (11g)
-
8/14/2019 DataGuardPPT oracle9i
6/54
Types of Standby
Databases
-
8/14/2019 DataGuardPPT oracle9i
7/54
Physical Standby
Database
A physical standby database is
physically identical to the primarydatabase, with on-disk databasestructures that are identical to theprimary database on a block-for-block
basis. The database schema, includingindexes, must be the same.
-
8/14/2019 DataGuardPPT oracle9i
8/54
Physical Standby
Database Managed Recovery- Physical standby
is maintained by applying archivedredo logs on the standby using Oraclerecovery operations. Recovery applieschanges on a block for block basis.
Open Read-Only- Physical standbydatabases can only be queried inRead-Only mode.
-
8/14/2019 DataGuardPPT oracle9i
9/54
Physical Standby
benefits Disaster Recovery/High Availability-
Switchover/failover allow for role
reversal of primary and standby,minimizing downtime of primarydatabase.
Data Protection- Data Guard can ensure
no data loss with physical standby.
Reduction in primary database workload-Can take backups from physical standby.
-
8/14/2019 DataGuardPPT oracle9i
10/54
Physical Standby
benefits (cont.)
Performance- Physical standby is moreefficient than Logical, in that it uses redoapply technology rather than SQL apply.It bypasses SQL level mechanisms, and
applies redo directly at block level.
-
8/14/2019 DataGuardPPT oracle9i
11/54
Logical Standby
Database Initially created as a copy of primary
database. Can later be changed.
Automatically applies archived redo loginfo by transforming data in redo logsinto SQL statements and executing themon the logical standby (must remain
open).
Target tables on standby (ones beingupdated from primary) are read only.
-
8/14/2019 DataGuardPPT oracle9i
12/54
Logical Standby
Benefits Efficient use of standby hardware-
Logical standby can contain other
schemas than those being updated byData Guard. those other schemas areread/write capable, while those beingmaintained by Data Guard are read only.
Reduction of Primary DatabaseWorkload- Since standby is open, itsavailable for query (or reporting),offloading work from primary.
-
8/14/2019 DataGuardPPT oracle9i
13/54
Snapshot Standby
Database (11g) Physical standby database that can be
opened for read/write use. Redo logs arestill received from primary, just notapplied until snapshot standby isconverted back into a physical standby.
Can have similar functionality with 10gData Guard, however must be donemanually with flashback database.
-
8/14/2019 DataGuardPPT oracle9i
14/54
Creating a Physical
Standby Database
Make copy of primary database (datafiles)
Create standby control file on primary
database
C ti Ph i l
-
8/14/2019 DataGuardPPT oracle9i
15/54
Creating a PhysicalStandby Database
(cont.)
Prepare pfile for standby database
-
8/14/2019 DataGuardPPT oracle9i
16/54
Standby Parameters
Defined REMOTE_ARCHIVE_ENABLE-
Permission to write remote archive
logs.
Values: True,False,Send
DB_FILE_NAME_CONVERT- Converts
the filename of a datafile on theprimary to a filename onthe standbydatabase. (also paths)
-
8/14/2019 DataGuardPPT oracle9i
17/54
Standby Parameters
Defined LOG_FILE_NAME_CONVERT- Converts the
filename of a log on the primary
database to the filename of a log on thestandby database. (Must use if paths aredifferent between primary and standby)
FAL_SERVER- Assigns the Oracle Netservice name that the standby will useto connect to the fetch archive logserver.
-
8/14/2019 DataGuardPPT oracle9i
18/54
Standby Parameters
Defined FAL_CLIENT- Assigns fetch archive log
client name to be used by the FAL
server. This is the Oracle Net servicename that the FAL server should use torefer to the standby database.
STANDBY_ARCHIVE_DEST- Location onstandby system where archived redologs received from the primary arestored.
-
8/14/2019 DataGuardPPT oracle9i
19/54
Standby Parameters
Defined
STANDBY_FILE_MANAGEMENT-Automates the creation and deletion ofdatafile filenames on the standby siteusing the same filenames as the primary
site. Values:auto,manual
C ti Ph i l
-
8/14/2019 DataGuardPPT oracle9i
20/54
Creating a PhysicalStandby Database
(cont.) Copy files from primary to standby
system
On primary system set pfile parameters
-
8/14/2019 DataGuardPPT oracle9i
21/54
Primary Parameters
Defined LOG_ARCHIVE_DEST_2- Specify
SERVICE=XXXX, XXXX being the
service name of the standby databaselisted in the tnsnames.ora file on theprimary system. This is the location forthe primary to write its redo.
LOG_ARCHIVE_DEST_STATE_2- Enables ordisables writing of logs tolog_archive_dest_2. Values: enable,defer, Alternate
-
8/14/2019 DataGuardPPT oracle9i
22/54
Primary Parameters
Defined
REMOTE_ARCHIVE_ENABLE- Enables ordisables the sending of redo logs toremote destinations and the receipt ofremote redo logs. Values:
true,false,send,receive (true=send +receive)
-
8/14/2019 DataGuardPPT oracle9i
23/54
Creating a PhysicalStandby Database
(cont.)
Configure listeners for primary andstandby databases
Set SQLNET.EXPIRE_TIME=2 in sqlnet.ora
Modify tnsnames.ora on both primaryand standby
Create spfile on standby (optional)
Creating a Physical
-
8/14/2019 DataGuardPPT oracle9i
24/54
Creating a PhysicalStandby Database
(cont.) Start physical standby database
STARTUP NOMOUNT; ALTER DATABASE MOUNT STANDBY
DATABASE;
Initiate log apply services
ALTER DATABASE RECOVER MANAGEDSTANDBY DATABASE DISCONNECTFROM SESSION;
Creating a Physical
-
8/14/2019 DataGuardPPT oracle9i
25/54
Creating a PhysicalStandby Database
(cont.) Start remote archiving (from primary)
ALTER SYSTEM ARCHIVE LOGCURRENT;
Physical standby database is now up andrunning!
-
8/14/2019 DataGuardPPT oracle9i
26/54
Log Transport
Services
What are Log Transport services?
Log Transport Services control theautomated transfer of redo data withina Data Guard configuration. They also
control the level of data protection foryour database.
-
8/14/2019 DataGuardPPT oracle9i
27/54
Data Protection Modes
Maximum Protection- Highest level ofprotection. A primary database
transaction will not commit until all redodata needed to recover the transactionhave been written to at least onestandby database, if it cant write to a
standby, the primary will shutdown.Guarantees no data loss, but has highestimpact on performance of the primarydatabase.
-
8/14/2019 DataGuardPPT oracle9i
28/54
Data Protection Modes
(cont.) Maximum Performance- This is the
default protection mode. A primary
database transaction will not wait tocommit until redo data needed torecover the transaction is written to astandby database. This mode provides
the highest level of protection availablewithout affecting performance oravailability of the primary database.Does not guarantee no data loss.
-
8/14/2019 DataGuardPPT oracle9i
29/54
Data Protection Modes
(cont.) Maximum Availability- Offers 2ndhighest level of protection. Same asMaximum Protection, except if no
standby database is available theprimary does not shutdown, ittemporarily goes into MaximumPerformance mode until a standby is
available. This mode guarantees no dataloss except for when in MaximumPerformance mode. It doesnt effect theavailability of the primary like MaximumProtection Mode does.
-
8/14/2019 DataGuardPPT oracle9i
30/54
Data Protection Modes
Maximum ProtectionMaximum Protection Maximum AvailabilityMaximum Availability Maximum PerformanceMaximum Performance
No Data Loss No Data Loss (except whenin Max Perform)
Does Not Effect Availability
Does Not Effect PerformanceDoes Not Effect Availability
Effects PerformanceEffects Availability
Effects Performance Possible Data Loss
-
8/14/2019 DataGuardPPT oracle9i
31/54
Transporting Redo
DataMaximum Protection and MaximumAvailability modes both require standby
redo log files on the standby system.Both use RFS (Remote File Server)process to write to standby redo logs onthe standby database system. Maximum
Performance mode does not use standbyredo logs when using arch process towrite to standby.
-
8/14/2019 DataGuardPPT oracle9i
32/54
Maximum Protection
-
8/14/2019 DataGuardPPT oracle9i
33/54
Maximum
Performance
Transmission and
-
8/14/2019 DataGuardPPT oracle9i
34/54
Transmission andReception of Redo
Data Specify the process to transmit redo,ARCH or LGWR (ARCH is the default)
LOG_ARCHIVE_DEST_2=SERVICE=std
by LGWR
Choose SYNC or ASYNC networktransmission mode. Must use SYNC forzero data loss.
LOG_ARCHIVE_DEST_2=SERVICE=stdby ASYNC
-
8/14/2019 DataGuardPPT oracle9i
35/54
Data Protection Modes
MaxProtection
MaxAvailability
MaxPerformanc
e
Redo Archival Process LGWR LGWR LGWR OR ARCH
Network TransmissionMode SYNC SYNC ASYNC
Disk Write Option AFFIRM AFFIRM NOAFFIRM
Standby Redo LogsRequired? Yes
Required forPhysical Only
Only if usingLGWR
Database Types Physical Physical/Logical Physical/Logical
-
8/14/2019 DataGuardPPT oracle9i
36/54
Log Apply Services
Processes involved in Log apply services(for physical standby)
Remote File Server (RFS)- Receivesredo data from primary.
Archiver (ARCn)- Archives standbyredo logs that are to be applied tostandby.
Managed Recovery Process (MRP)-Applies archived redo logs to standby.
-
8/14/2019 DataGuardPPT oracle9i
37/54
Configuring Log Apply
Services
Start the Physical Standby:
To Stop Log Apply Services:
-
8/14/2019 DataGuardPPT oracle9i
38/54
Log Apply Services
To Verify Managed Recovery:
To Determine if there is an Archive Gap:
-
8/14/2019 DataGuardPPT oracle9i
39/54
Monitoring Log Apply
Services The following views can be used to
monitor Log Apply Services:
V$MANAGED_STANDBY
V$ARCHIVED_LOG
V$LOG_HISTORY
V$DATAGUARD_STATUS
-
8/14/2019 DataGuardPPT oracle9i
40/54
Switchover/Failover
Switchover- Role reversal betweenprimary and standby databases. Old
primary is now a standby. Used forhardware upgrades, OS upgrades, etc.
Failover- Primary is down with little hopeof quick recovery (ie. hardware failure onprimary machine). Once failover hasbeen initiated, the old primary databaseis no longer useful.
-
8/14/2019 DataGuardPPT oracle9i
41/54
How to Perform a
Switchover On primary database:
Initiate switchover on primary database:
After the above statement completes theold primary is now a standby database
-
8/14/2019 DataGuardPPT oracle9i
42/54
How to Perform a
Switchover (cont.)
While still on old primary shutdowndatabase and restart as standby:
On the old standby system (newprimary):
-
8/14/2019 DataGuardPPT oracle9i
43/54
How to Perform a
Switchover (cont.) On new primary complete switchover
then restart database:
On new standby start managedrecovery:
On new primary begin redo transport:
Switchover Complete!
-
8/14/2019 DataGuardPPT oracle9i
44/54
How to Perform a
Failover Manually register any redo logs with the
standby that are available and that have
not been applied
If using standby redo logs, initiatefailover with:
If not using standby redo logs:
-
8/14/2019 DataGuardPPT oracle9i
45/54
How to Perform a
Failover (cont.) Convert the Physical Standby to Primary
(modify pfile before restart):
Failover complete!
-
8/14/2019 DataGuardPPT oracle9i
46/54
10g New Features
Fast Start Failover- Provides the ability toautomatically fail over to a designatedstandby database when the primarygoes down. Automatically reconfiguresold primary as a standby when it re-enters the configuration.
-
8/14/2019 DataGuardPPT oracle9i
47/54
10g New Features
(cont.) Asynchronous Redo Transmission- (LGWR
ASYNC) has been improved to reduce
the impact on the primary database(LSNn process added to do redo logtransmission).
Flashback Database across Data Guard
Switchovers- Now possible to flash backprimary and standby to an SCN or pointin time prior to switchover operation.
-
8/14/2019 DataGuardPPT oracle9i
48/54
11g New Features
Snapshot Standby- Physical standby that
can be opened read-write, then revertback to managed recovery.
Active Data Guard- Physical standby thatcan be opened read-only while redo is
still applied to the standby. (SUNY is notcurrently licensed for this feature)
-
8/14/2019 DataGuardPPT oracle9i
49/54
11g New Features
(cont.) New advanced compression for redo
transport. Transient Logical Standby allows a
physical standby to be changed to alogical standby and then back to a
physical. Used for rolling databaseupgrades.
-
8/14/2019 DataGuardPPT oracle9i
50/54
Management Tools
SQL - Data Guard can be managed andmonitored with SQL*PLUS. MostlyManual.
Data Guard Broker- Special interface forData Guard. Has command lineinterface and Java GUI. Less manual than
SQL*PLUS. Grid Control- Grid control has a web
based GUI for Data Guard Broker.Enables you to use GC to schedule and
monitor Data Guard operations
-
8/14/2019 DataGuardPPT oracle9i
51/54
What is ITEC doing
with Data Guard? Currently ITEC is using Data Guard in its
Data Vaulting service. ITEC currentlyhosts physical standby databases for thefollowing campuses:
Hudson Valley Community College
Niagara County Community College
SUNY Brockport
SUNY Fredonia
SUNY Oneonta
SUNY Oswego
h i d i
-
8/14/2019 DataGuardPPT oracle9i
52/54
What is ITEC doing
with Data Guard?Currently we are using all Physical
standby databases. When we startedthe Data Vaulting service, Banner haddata types that were incompatible withlogical standby databases. This may bere-evaluated in the future (newerreleases of Oracle are compatible withmore data types).
h i C d i
-
8/14/2019 DataGuardPPT oracle9i
53/54
What is ITEC doing
with Data Guard?ITEC currently manages all of its
physical standby databases using theSQL*Plus interface. Our future intent isto use Grid Control to manage andmonitor all standby databases. ITEC iscurrently in the process of rolling outGrid Control to all systems ITECmanages.
Wh i ITEC d i
-
8/14/2019 DataGuardPPT oracle9i
54/54
What is ITEC doing
with Data Guard?
In the Future, when the Dual Data Centerproject is complete, ITEC will replicatethe production databases hosted at ITECto the Albany (Sys Admin) data centerusing either storage level replication orData Guard.