Professional Documents
Culture Documents
Configuring Snapmirroring
Eircomnet
Version 1.0
Owner
EircomNet
Prepared by
Chander Sangra
DBA Team
1 Document Control
1.1 Revision History
Revision Previous Summary of Changes Author
version revision date
1.0 Chander Sangra
1.2 Distribution
This document has been distributed to
2 Table of Contents
1 Document Control......................................................................... 2
1.1 Revision History................................................................................... ................2
1.2 Distribution............................................................................................ ..............2
2 Table of Contents.........................................................................3
3 Overview...................................................................................... 5
3.1 Preface................................................................................................................ .5
3.2 Purpose and Scope....................................................................... .......................5
3.3 Prerequisites and Assumptions.......................................................... ..................5
4 Snapmirroring..............................................................................6
4.1 Type of Snapmirroring ................................................................................. ........6
4.1.1 Asynchronous........................................................................ ................6
4.1.2 Synchronous................................................................................. .........6
4.1.3 Semi-Synchronous..................................................................... ...........6
5 Snapmirroring Requirements........................................................7
5.1 Assumptions.................................................................................... ....................7
5.2 Requirements ....................................................................... ..............................7
5.2.1 Network..................................................................................... ............7
5.2.2 Root Volume................................................................... .......................8
5.2.3 Rsh access......................................................................................... ....8
5.2.4 Permissions............................................................. ..............................8
5.2.5 Mount................................................................................ ....................8
5.2.6 Ownership..................................................................... ........................8
5.2.7 Others...................................................................... .............................8
6 Architecture.................................................................................9
7 Configuring Snapmirroring..........................................................10
7.1 Configuring Database................................................................... .....................10
7.2 Configuring Snapmirror.................................................................................. ....11
7.2.1 Identify Source & Target filer...................................... .........................11
7.2.2 Identify Volumes...................................................................... ............11
7.2.3 Identify Schedule........................................................................ .........11
7.2.4 Enable SnapMirror........................................................ .......................12
7.2.5 Create Baseline......................................................... ..........................12
7.2.6 Update SnapMirror............................................................................. ..12
7.2.7 Check the Status......................................................... ........................12
8 Database Recovery Using SnapMirror Async and Sync..................13
8.1 Generate Data............................................................................... ....................13
8.2 Snapshot Backup........................................................................... ....................13
8.3 Simulate Disaster.............................................................. ................................13
8.4 Perform Recovery................................................................ ..............................14
8.4.1 Recovery from SnapMirror Update Point of Data Volumes...................15
8.4.2 Recovery from Snapshot Backup of the Data volumes........................15
9 Special Consideration.................................................................17
9.1 Initialisation Phase................................................................................... ..........17
9.2 Throttle Rate.............................................................................................. ........17
9.3 Incremental Phase......................................................................... ....................17
9.4 Stopping & Restarting Snapmirroring................................................................ .17
9.5 Breaking the Mirror........................................................................... .................17
9.6 Re-synching the Mirror.............................................................................. .........17
3 Overview
3.1 Preface
This document is useful to the DBA and the Operations team members, the
following assumptions are made that the reader has:
- Minimal knowledge of NetApp platforms and products, particularly in the
area of data protection
- General knowledge of disaster recovery (DR) solutions
- Working knowledge of the NetApp Snapshots and Snaprestore
4 Snapmirroring
SnapMirror software provides automated file system replication from a source to a
destination system. The NetApp storage system from which data is transferred is
referred to as the SnapMirror source, and the NetApp storage system to which the
data is transferred is referred to as the SnapMirror destination. The SnapMirror
source and destination can be miles apart, provided that both NetApp storage
systems can communicate with each other across a network.
4.1.1 Asynchronous
In Asynchronous mode, SnapMirror performs incremental, block-based
replication as frequently as once per minute. Performance impact on the
source FAS system is minimal, as long as the system is configured with
sufficient CPU and disk I/O resources.
4.1.2 Synchronous
SnapMirror in synchronous mode is a mode of replication that sends
updates from the source to the destination as they occur, rather than
according to a predetermined schedule. This guarantees that data written
on the source system is protected on the destination even if the entire
source system fails. In synchronous mode, SnapMirror immediately
replicates all data written to the source file system. This guarantees zero
data loss in the event of a failure, but can have a significant performance
impact. It is not necessary or appropriate for all applications.
4.1.3 Semi-Synchronous
A semi-synchronous mode is also provided which minimizes data loss in a
disaster while also minimizing the extent to which replication impacts the
performance of the source system. Unlike asynchronous mode, which can
replicate either volumes or quota trees, synchronous and semi-
synchronous modes work only with volumes.
5 Snapmirroring Requirements
5.1 Assumptions
This document covers Disaster Recovery Solutions offered by NetApp for
Oracle 10gR2 single database instance using SnapMirror Async as well as
Sync technology.
- Source:
o Server: testmsstaging00
o NetApp filer: "bfiler03"
o Oracle Admin User: "SNAPDBA"
o NetApp Volume: “/vol/dbasnaptestdata” for Oracle data
“/vol/dbasnaptestlog” for Oracle logs
o NetApp Mount Points): “/snaptestdata” for Oracle data
“/snaptestlog” for Oracle data
o Aggregate on the NetApp storage system used for database
storage: “dbaggr”
(The flexible volumes snaptestdata & snaptestlog reside in
aggregate dbaggr)
- Target:
o Server: testdba00
o NetApp filer: "bfiler03"
o Oracle Admin User: "SNAPDBA"
o NetApp Volume: “/vol/testdba/testdba00” for Oracle data
“/vol/ora_data_testdba00” for Oracle logs
o NetApp Mount Points: “testdba” for Oracle data
“oradata” for Oracle logs
o Aggregate on the NetApp storage system used for database
storage: “dbaggr”
(The flexible volumes testdba & oradata reside in aggregate
dbaggr)
5.2 Requirements
5.2.1 Network
The root on the database server must have access to the root volume
/vol/vol0.
For example, to grant access on a root volume named /vol/vol0 on a
NetApp storage system to the user root on the database host system
<servername>, execute the following command on the storage systems:
exportfs –p rw=<servername>,root=<servername>,anon=0 /vol/vol0
exportfs -a
Enable ‘rsh’ access from the database server if it is going to be used. Add
the IP address of the database host to the “/etc/hosts.equiv” file.
5.2.4 Permissions
Ensure the user has permissions on all the volumes to be used for the
database
5.2.5 Mount
5.2.6 Ownership
Ensure the file system on the mount points is owned by the user ‘oracle’
on the database server.
Chown –R oracle:dba <mount point>
5.2.7 Others
6 Architecture
The following network & storage model is to be followed in this exercise:
7 Configuring Snapmirroring
Database Configuration:
Database Layout:
Control files:
/<data vol>/control01.ctl
/<data vol>/control02.ctl
/<log vol>/control03.ctl
Redo logs:
/<data vol>/redo_01.log
/<log vol>/redo_02.log
Datafiles:
/<data vol>/*.dbf
Database Setup:
DB Structures:
Execute ‘create_tables_demo.sql’ to create the tables
DB Data:
Execute ‘create_data_demo.sql’ to generate data into the demo
tables
Where:
The <Schedule> is defined by [minute] [hour] [days of month] [days of
week]
A snippet from the /etc/snapmirror.conf file:
Enable the SnapMirror feature on the Source and the Target by issuing the
following command:
option snapmirror on
for example:
snapmirror initialize –S bfiler03:/vol/dbasnaptestdata
bfiler03:/vol/testdbavol/testdba00
After the baseline transfer, the SnapMirror updates can be triggered based
on a predefined schedule in the /etc/snapmirror.conf file. It is also possible
to trigger a SnapMirror update manually by executing the following
command from the destination:
For example,
execute the following command on the destination to start the manual
SnapMirror update for a volume named /vol/testdbavol/testdba00:
snapmirror status
The snippet from the /etc/snapmirror.conf file looks somewhat similar to the following:
Let us assume disaster strikes at 3:05 p.m. In order to simulate the disaster,
we made
the SnapMirror source NetApp storage system unavailable by executing the
following
command:
After the baseline transfer, the destination volumes are available to clients,
but in a read-only state. The status of a destination will show that it is
snapmirrored. A disaster makes the source unavailable; to use the
destination volumes for writing as well as reading, you would need to end
the SnapMirror relationship by executing the following command on the
destination NetApp storage system:
This command changes the destination volume’s status from snapmirrored to broken-off, thus making
it writable.
After a disaster, in this type of configuration, there are two possible options for the database recovery:
To perform recovery from the SnapMirror update point of the data volumes,
we need to follow the following steps on the database server:
Mount each volume used for the database to a database host by executing
the
following command :
mount –o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,
timeo=600 <bfiler03>:<volume> <mount point>
The control file that resides on the transaction logs volume will have the
latest database information, so copy that control file from the dblogs
volume to the dbdata volume by executing the following commands on the
database server:
<<cp control files >>
Startup mount
Set autorecovery on
Recover database
Alter database open
This type of recovery may become necessary in rare cases, such as when
database recovery is not possible from the SnapMirror update point. In this
kind of situation, the database can be recovered using application-
coordinated Snapshot copies of the data volume.
First you need to restore the volumes that hold data for the database from
the application-coordinated Snapshot copy by executing the following
command on the NetApp storage system:
Mount the NetApp storage system volumes that hold the database’s data
and transaction logs to a database host by executing the following
command :
mount -o rw,bg,hard,nointr,rsize=32768,wsize=32768,
tcp,vers=3,timeo=600 <bfiler03>:<volume> <mount point>
The control file that resides on the transaction logs volume will have the
latest database information, so copy that control file from the dblogs volume
to the dbdata volume by executing the following commands on the database
server:
Startup mount
Set autorecovery on
Recover database
Alter database open
After completing the above steps, the database recovery will be complete.
9 Special Consideration
Several special scenarios should be considered as:
As long as the target volume remains read only during the time between
turning the SnapMirror process off and on, the mirror remains intact.
- Once to replicate the data back to the source volume. (In this case the
mirror relationship between the two filers is flipped.)
- Once to reinitialize with the mirror relationship back to normal.
10Appendices
BEGIN
for i in 1..rcount loop
insert into scott.tab1 values (i,
'ABDFADFAFAFAFASFDASDFFFFFFFFFFFFFFFFFFFFFFFFFF');
if mod(i,1000)=0 then
commit;
end if;
end loop;
END;
/
Snapshot Backup
----------------------------------------------------------------
-- Script Name: snapshot_backup.ksh
-- Purpose: This script perform the following tasks:
o Put the database in hot backup mode (backupmodein.sh)
o Create snapshot (create_snapshot.ksh)
o Put the database out of backup mode (backupmideout.sh)
----------------------------------------------------------------
10.2 Appendix B
11References
- SnapMirror Best Practices Guide (TR-3446)