# $Id: README,v 2.1.6.1 2002/06/12 18:24:32 ptle Exp $
#ident "$Source: /project/vras-cvs/src/common/cmd/vras/samples/sample_vxfs_snapshot/README,v $"
#
#
# Copyright (c) 2002 VERITAS Software Corporation.  ALL RIGHTS RESERVED.
#
# UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT
# LAWS OF THE UNITED STATES.  USE OF A COPYRIGHT NOTICE
# IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
# OR DISCLOSURE.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND
# TRADE SECRETS OF VERITAS SOFTWARE.  USE, DISCLOSURE,
# OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
# EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
#
#               RESTRICTED RIGHTS LEGEND
# USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT IS
# SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH
# (C) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND
# COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013.
#               VERITAS SOFTWARE
# 1600 PLYMOUTH STREET, MOUNTAIN VIEW, CA 94043
#


This directory contains a set of sample scripts that can be used
in vradmin ibc command to create snapshot of Secondary data volumes.
The snapshot created on the Secondary can be used to perform certain
off-host processing tasks such as Decision Support or taking backups.

The sample scripts in this directory assume that the application
using the Primary data volumes is a VxFS filesystem. It should work
similarly for other types of filesystems. 


Files in this directory are:
---------------------------

quiesce    Puts the Primary volumes in application-consistency point.

unquiesce  Resumes the application running on the Primary host.

prefreeze  Creates snapshot plexes for Secondary volumes to prepare
           for the snapshot command carried out in the onfreeze script.
           Enables FastResync on the Secondary volumes.

onfreeze   Takes snapshot of the Secondary volumes.

README     Explains how all of this works.

Notes: 
-----
   + Scripts postfreeze is not present in this directory because 
     there is nothing to be done in the postfreeze script.
   + For further information about the scripts, refer to the comments 
     in the scripts.

IMPORTANT!!!
-----------
   + For this set of sample scripts to function correctly, you must 
     provide appropriate values in the CUSTOMIZATION sections in the
     prefreeze and onfreeze scripts.


Ex1: Using vradmin ibc command to create snapshot for Decision Support:
----------------------------------------------------------------------

Perform the following steps on the Secondary host:

1. Run:

   # vradmin -g <diskgroup> ibc <rvg_name> sample_vxfs_snapshot <sechost_name>

2. After the vradmin ibc command in (1) returns, use the snapshot data 
   volumes <SNAP_PREFIX>-<vol_name> for running Decision Support 
   application.

3. When the Decision Support application completes, reattach the
   snapshot plexes to the Secondary data volumes using the following
   command:

   # vxrvg -g <diskgroup> -P <SNAP_PREFIX> snapback <rvg_name>

   Note: SNAP_PREFIX should be whatever set for the SNAP_FREFIX variable
         in the onfreeze script.

   
Ex2: Using vradmin ibc command to create snapshot for running backups:
---------------------------------------------------------------------

Perform the following steps on the Secondary host:

1. Run:

   # vradmin -g <diskgroup> ibc <rvg_name> sample_vxfs_snapshot <sechost_name>

2. After the vradmin ibc command in (1) returns, backup the data from 
   the snapshot to tapes using any backup utility or the UNIX command dd.

   Use the dd command as follows (assume there are n snapshot volumes):

   # dd if=/dev/vx/rdsk/<diskgroup>/<SNAP_PREFIX>-<vol1> of=/dev/rmt/0
     ...
   # dd if=/dev/vx/rdsk/<diskgroup>/<SNAP_PREFIX>-<voln> of=/dev/rmt/0

3. When the backup completes, reattach the snapshot plexes to the original
   volumes by running the following command:

   # vxrvg -g <diskgroup> -P <SNAP_PREFIX> snapback <rvg_name>

   Note: SNAP_PREFIX should be whatever set for the SNAP_FREFIX variable
         in the onfreeze script.

