use case: db backup workflow with db snapshot postprocessing

14
Arda Oral Professional Services Engineer Use Case: DB Backup Workflow with DB Snapshot Postprocessing 1 NetApp Confidential - Internal Use Only

Upload: licia

Post on 07-Jan-2016

28 views

Category:

Documents


3 download

DESCRIPTION

Use Case: DB Backup Workflow with DB Snapshot Postprocessing. Arda Oral Professional Services Engineer. Goal. Hava a fallback database available which can be used immediately - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

1NetApp Confidential - Internal Use Only

Arda Oral

Professional Services Engineer

Use Case: DB Backup Workflow with DB Snapshot Postprocessing

Page 2: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Goal

Hava a fallback database available which can be used immediately

Problem:Some hosts/databases detect SCSI ID change of clones which prevent immediate database start on lunclones.

2

Page 3: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Agenda

Scope of WorkEnvironmentWorkflowCaution with IgroupsImplementation Workflow (Test Environment)Implementation WorkflowImplementation Snap Creation/Deletion,

LUN DestroyImplementation Lun CloningDemonstration

3

Page 4: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Scope of Work

Customer wants a snapshot-scheduled automated fallback solution for the Informix database

snapshots-based lun clones connected to fallback database transparently

Fast fallback activation needed if necessary

4

Page 5: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Environment

Solaris Servers are SAN connected to NetApp Storage System

Informix Database uses LUNs as raw device pool

nightly-created LUNClones connected to Fallback Informix Database on Fallback Solaris Server (secondary)

Fallback Solaris Server must not rescan for new devices when connected to LUNCLONES (no new SCSI IDs)

5

Page 6: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Environment

6

Informix on Solaris - primary

Informix on Solaris - secondary(Fallback – nightly)

FAS6200FC LUNsInformix raw devices

FC LUNCLONEs Informix raw deviceswith same LUN serial number

nightlycloning

Page 7: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Workflow

stop fallback Informix DB (secondary) delete old snapshot (containing LUNCLONEs created 24h ago) stop Informix DB (nightly at 01:00 AM) on primary create snapshot of Volume containing Informix raw device

LUNs (primary) restart Informix DB on primary (nightly at ~ 01:01 AM) create clones of raw device LUNs based on new snapshot copy LUN serial numbers to clones, so the SCSI IDs don‘t

change (LUNCLONEs must be offline for this) take LUNCLONEs online start fallback Informix DB (secondary) with lunclones of new

snapshot

7

Page 8: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Caution with Igroups

8

Igroup1

Igroup2

Lun1SR: 10123

Lun2 (clone)SR: 10123

Due to the same serialnumber (SR) Lun1 and Lun2 are the same Lun for the filesystem (same SCSI ID).

Connecting Igroup1 to Lun2 could cause severe damage (data loss, inconsistent LUN)

/dev/rdsk/c0d010123

/dev/rdsk/c0d010123

Page 9: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Implementation Workflow (Test Environment) create volume

vol create vol_naptest1 -s none aggr0 2genable deleting non-recent snapshots (busy snapshot problem)vol options vol_naptest1 snapshot_clone_dependency on

create 2 test lunslun create -s 100m -t linux /vol/vol_naptest1/lun1.lunlun create -s 100m -t linux /vol/vol_naptest1/lun2.lun

create 2 Igroups igroup create -i -t linux igroup1 iqn.1991-05.com.linux:kronenbourg.brauerei.local

igroup create -i -t linux host2 iqn.1991-05.com.linux:kronenbourg2.brauerei.local

in production: connect luns to informix server

9

Page 10: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Implementation Workflow

10

stop secondary Informix DB

destroy lunclones and delete old snapshot (backing lunclones)

Lun_destroy_all_in_Volume.pl, snap_delete.pl

stop primary Informix DB

create snapshot for lun cloning./snap.pl korn vol_naptest1 snap1

restart primary Informix DB

create clones based on this snapshot snap1 for igroup1 (igroup1 = secondary),

map clones to igroup1

./lunclone.pl korn vol_naptest1 snap1 igroup1

24 hours later delete clones in Volume vol_naptest1./Lun_destroy_all_in_Volume.pl korn vol_naptest1

Delete snapshot backing clones ./Snap_delete.pl korn vol_naptest1 snap1

Restart Workflow

Page 11: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Implementation Snap Creation/Deletion, LUN Destroy

$out = $s->invoke("snapshot-create", "volume",$vol, "snapshot",$snapname);

$out = $s->invoke("snapshot-delete", "volume",$vol, "snapshot",$snapname);

$out=$s->invoke("lun-destroy“ , "path","$clone_lunpath","force","true");

11

Page 12: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Implementation Lun Cloning

12

getting parent luns of a volume @luns=get_lun_from_vol();

Check if provided IGROUP is mapped to LUNcheck_if_lun_mapped_to_igroup

create clone lun path (prefix of clone „igroupname“) create_lun_path($element)(/vol/vol1/lun1 -> /vol/vol1/igroup1_lun1)

get serial number of parent lunlun_get_serial($element)

Page 13: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

Implementation Lun Cloning

13

create the clone ifself lunclone_create($element, \%lunhash );

take clone offline lun_offline($lunhash{clone_lunpath});

set parent luns serial number to clone lun_set_serial($lunhash{clone_lunpath},$lunhash{serial});

map the cloned lun to the provided igroup lun_map(\%lunhash);

take clone online lun_online($lunhash{clone_lunpath});

Page 14: Use Case: DB Backup Workflow with DB  Snapshot  Postprocessing

14