Veritas FlashSnap Point-In-Time Copy Solutions 5.
Legal Notices © Copyright 2008 Hewlett-Packard Development Company, L.P. Publication Date: 2008 Confidential computer software. Valid license from HP required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice.
Contents Chapter 1 Point-in-time copy solutions Applications of point-in-time copy solutions .................................................... 8 Point-in-time copy scenarios ....................................................................... 9 Software used in point-in-time copy scenarios ................................................. 9 Persistent FastResync of volume snapshots ...........................................10 Instant volume snapshots ................................................
6 Contents Resynchronizing the data with the primary host ................................... 55 Reattaching snapshot plexes ..................................................................... 56 Chapter 6 Database recovery Creating Storage Checkpoints ........................................................................... 58 Rolling back a database ......................................................................................
Chapter 1 Point-in-time copy solutions This chapter introduces the point-in-time copy solutions that you can implement using the Veritas FlashSnapTM technology. Note: The FlashSnap feature requires a separate license. Veritas FlashSnap offers a flexible and efficient means of managing business critical data. It allows you to capture an online image of actively changing data at a given instant: a point-in-time copy.
8 Point-in-time copy solutions Applications of point-in-time copy solutions ■ File system-level solutions use the Storage Checkpoint feature of Veritas File System. Storage Checkpoints are suitable for implementing solutions where storage space is critical for: ■ File systems that contain a small number of mostly large files. ■ Application workloads that change a relatively small proportion of file system data blocks (for example, web server content and some databases).
Point-in-time copy solutions Software used in point-in-time copy scenarios Note: To provide continuity of service in the event of hardware failure in a cluster environment, you can use point-in-time copy solutions in conjunction with the high availability cluster functionality of the HP Serviceguard Storage Management Suite.
10 Point-in-time copy solutions Software used in point-in-time copy scenarios ■ Veritas Volume Manager (VxVM) is a disk management subsystem that supports disk striping, disk mirroring, and simplified disk management for improved data availability and superior performance. The FlashSnap functionality uses the persistent FastResync and Disk Group Split/Join features of VxVM.
Point-in-time copy solutions Software used in point-in-time copy scenarios Persistent FastResync can track the association between volumes and their snapshot volumes after they are moved into different disk groups. After the disk groups are rejoined, persistent FastResync allows the snapshot plexes to be quickly resynchronized. For more information, see the Veritas Volume Manager Administrator’s Guide.
12 Point-in-time copy solutions Software used in point-in-time copy scenarios Note: As space-optimized instant snapshots only record information about changed regions in the original volume, they cannot be moved to a different disk group. They are therefore unsuitable for the off-host processing applications that are described in this document.
Point-in-time copy solutions Implementing point-in time copy solutions on a primary host Implementing point-in time copy solutions on a primary host Figure 1-1 illustrates the steps that are needed to set up the processing solution on the primary host. Note that the Disk Group Split/Join functionality is not used.
14 Point-in-time copy solutions Implementing point-in time copy solutions on a primary host Figure 1-2 Example point-in-time copy solution on a primary host Primary host 1 2 Disks containing primary volumes used to hold production databases or file systems SCSI or Fibre Channel connectivity Disks containing synchronized full-sized instant snapshot volumes In this setup, it is recommended that separate paths (shown as 1 and 2) from separate controllers be configured to the disks containing the prima
Point-in-time copy solutions Implementing off-host point-in-time copy solutions Implementing off-host point-in-time copy solutions Figure 1-3 illustrates that, by accessing snapshot volumes from a lightly loaded host (shown here as the OHP host), CPU- and I/O-intensive operations for online backup and decision support are prevented from degrading the performance of the primary host that is performing the main production activity (such as running a database).
16 Point-in-time copy solutions Implementing off-host point-in-time copy solutions Figure 1-4 Example connectivity for off-host solution using redundant-loop access OHP host Primary host Network c1 c2 c3 c4 c1 c2 c3 c4 Fibre Channel hubs or switches Disk arrays
Point-in-time copy solutions Implementing off-host point-in-time copy solutions Figure 1-5 shows how off-host processing might be implemented in a cluster by configuring one of the cluster nodes as the OHP node.
18 Point-in-time copy solutions Implementing off-host point-in-time copy solutions Alternatively, the OHP node could be a separate system that has a network connection to the cluster, but which is not a cluster node and is not connected to the cluster’s private network. This arrangement is illustrated in Figure 1-6.
Point-in-time copy solutions Implementing off-host point-in-time copy solutions Figure 1-7 Implementing off-host processing solutions OHP host Primary host or cluster 1. Prepare the volumes If required, create an empty volume in the disk group, and use vxsnap prepare to prepare volumes for snapshot creation. Volume Empty volume 2. Create snapshot volumes Use vxsnap make to create synchronized snapshot volumes. (Use vxsnap print to check the status of synchronization.) Volume Snapshot volume 3.
20 Point-in-time copy solutions Implementing off-host point-in-time copy solutions Data integrity in volume snapshots A volume snapshot represents the data that exists in a volume at a given point in time. As such, VxVM does not have any knowledge of data that is cached by the overlying file system, or by applications such as databases that have files open in the file system.
Chapter 2 Setting up volumes for instant snapshots This chapter describes how to make volumes ready for instant snapshot creation. These may be volumes that you want to back up, or that you want to use for decision support or reporting. If a snapshot volume is to be used on the same host, and will not be moved to another host for off-host processing, you can use space-optimized instant snapshots rather than full-sized instant snapshots.
22 Setting up volumes for instant snapshots Additional preparation activities Caution: To avoid data inconsistencies, do not use the same snapshot with different point-in-time copy applications. If you require snapshot mirrors for more than one application, configure at least one snapshot mirror that is dedicated to each application. If the existing volume was created before release 4.
Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations Preparing a volume for instant snapshot operations To prepare a volume for instant snapshot operations, a version 20 Data Change Object (DCO) and DCO volume must first be associated with that volume. To add a version 20 DCO object and DCO volume to an existing volume 1 Ensure that the disk group containing the existing volume has been upgraded to at least version 110.
24 Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations 3 If you are going to create a snapshot volume by breaking off existing plexes, use the following command to add one or more snapshot mirrors to the volume: # vxsnap [-b] [-g diskgroup] addmir volume [nmirror=N] \ [alloc=storage_attribute[,...]] By default, one snapshot plex is added unless you specify a number using the nmirror attribute. For a backup, you should usually only require one plex.
Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations output for the volume named zoo (the TUTIL0 and PUTIL0 columns are omitted for clarity): TY ...
26 Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations Figure 2-1 Volume data plexes Examples of disk groups that can and cannot be split The disk group can be split as the DCO plexes are on dedicated disks, and can therefore accompany the disks that contain the volume data. Snapshot plex Split Volume DCO plexes Snapshot DCO plex Volume data plexes Snapshot plex The disk group cannot be split as the DCO plexes cannot accompany their volumes.
Setting up volumes for instant snapshots Creating a volume for use as a full-sized instant snapshot Creating a volume for use as a full-sized instant snapshot If you want to create a full-sized instant snapshot for an original volume that does not contain any spare plexes, you can use an empty volume with the required degree of redundancy, and with the same size and same region size as the original volume.
28 Setting up volumes for instant snapshots Creating a shared cache object Creating a shared cache object If you need to create several instant space-optimized snapshots for the volumes in a disk group, you may find it more convenient to create a single shared cache object in the disk group rather than a separate cache object for each snapshot.
Setting up volumes for instant snapshots Creating a shared cache object Note: All space-optimized snapshots that share the cache must have a region size that is equal to or an integer multiple of the region size set on the cache. Snapshot creation also fails if the original volume’s region size is smaller than the cache’s region size. If the cache is to be allowed to grow in size as required, specify autogrow=on. By default, the ability to automatically grow the cache is turned off.
30 Setting up volumes for instant snapshots Creating a shared cache object If the cache space becomes exhausted, the snapshot is detached and marked as invalid. If this happens, the snapshot is unrecoverable and must be removed. Enabling the autogrow feature on the cache helps to avoid this situation occurring. However, for very small caches (of the order of a few megabytes), it is possible for the cache to become exhausted before the system has time to respond and grow the cache.
Chapter 3 Online database backup Online backup of a database can be implemented by configuring either the primary host or a dedicated separate host to perform the backup operation on snapshot mirrors of the primary host’s database.
32 Online database backup Making a backup of an online database on the same host Making a backup of an online database on the same host Figure 3-1 shows an example with two primary database volumes to be backed up, dbase_vol and dbase_logs, which are configured on disks attached to controllers c1 and c2, and the snapshots to be created on disks attached to controllers c3 and c4.
Online database backup Making a backup of an online database on the same host Note: It is assumed that you have already prepared the volumes containing the file systems for the datafiles to be backed up as described in “Setting up volumes for instant snapshots” on page 21. For an Oracle database, it is not necessary to create snapshots of the volumes containing the file systems for the redo log volumes or archived logs.
34 Online database backup Making a backup of an online database on the same host Note: This step sets up the snapshot volumes ready for the backup cycle, and starts tracking changes to the original volumes. When you are ready to make a backup, proceed to step 2. 2 Suspend updates to the volumes. Oracle supports online backup by temporarily suspending updates to the datafiles of the tablespaces, provided that the database is running in archive mode and the tablespaces are online.
Online database backup Making an off-host backup of an online database Note: You must shut down the database and unmount the file system that is configured on the original volume before attempting to resynchronize its contents from a snapshot.
36 Online database backup Making an off-host backup of an online database Figure 3-2 Example system configuration for off-host database backup Network Primary host for database OHP host Local disks Local disks Controllers c1 c2 c3 Volumes created on these disks are accessed by the primary host Controllers c4 c1 Disk arrays c2 c3 c4 Snapshot volumes created on these disks are accessed by both hosts Backup to disk, tape or other media by OHP host
Online database backup Making an off-host backup of an online database Note: It is assumed that you have already prepared the volumes containing the file systems for the datafiles to be backed up as described in “Setting up volumes for instant snapshots” on page 21. For an Oracle database, it is not necessary to create snapshots of the volumes containing the file systems for the redo log volumes or archived logs.
38 Online database backup Making an off-host backup of an online database # vxsnap -g dbasedg make source=vol1/newvol=svol1 \ source=vol2/newvol=svol2 source=vol3/newvol=svol3 \ alloc=ctlr:c3,ctlr:c4 This step sets up the snapshot volumes ready for the backup cycle, and starts tracking changes to the original volumes. 4 Release all the tablespaces or databases from suspend, hot backup or quiesce mode.
Online database backup Making an off-host backup of an online database 12 On the primary host, use the following command to rejoin the snapshot volume’s disk group with the original volume’s disk group: # vxdg join snapvoldg volumedg 13 The snapshot volume is initially disabled following the join.
40 Online database backup Making an off-host backup of an online database
Chapter 4 Off-host cluster file system backup Veritas Cluster File System (CFS) allows cluster nodes to share access to the same file system. CFS is especially useful for sharing read-intensive data between cluster nodes. Off-host backup of cluster file systems may be implemented by taking a snapshot of the volume containing the file system and performing the backup operation on a separate host.
42 Off-host cluster file system backup Figure 4-1 System configuration for off-host file system backup scenarios Network Cluster nodes OHP host Local disks Local disks Controllers Controllers c1 c2 c3 c4 c1 c2 c3 c4 c1 c2 c3 c4 c1 c2 c3 c4 Volumes created on these disks are accessed by the cluster nodes Disk arrays c1 c2 c3 c4 Snapshot volumes created on these disks are accessed by all hosts Backup to disk, tape or other media by OHP host
Off-host cluster file system backup Mounting a file system for shared access Mounting a file system for shared access To mount a VxFS file system for shared access, use the following command on each cluster node where required: # mount -F vxfs -o cluster /dev/vx/dsk/diskgroup/volume mount_point For example, to mount the volume cfs_vol in the disk group exampledg for shared access on the mount point, /mnt_pnt: # mount -F vxfs -o cluster /dev/vx/dsk/exampledg/cfs_vol / mnt_pnt Using off-host processing to
44 Off-host cluster file system backup Using off-host processing to back up cluster file systems 2 On the master node, refresh the contents of the snapshot volumes from the original volume using the following command: # vxsnap -g volumedg refresh snapvol source=vol \ [snapvol2 source=vol2]... syncing=yes The syncing=yes attribute starts a synchronization of the snapshot in the background.
Off-host cluster file system backup Using off-host processing to back up cluster file systems 7 The snapshot volume is initially disabled following the split.
46 Off-host cluster file system backup Using off-host processing to back up cluster file systems Repeat steps 2 through 14 each time that you need to back up the volume.
Chapter 5 Decision support You can use snapshots of a primary database to create a replica of the database at a given moment in time. You can then implement decision support analysis and report generation operations that take their data from the database copy rather than from the primary database. The FastResync functionality of Veritas Volume Manager (VxVM) allows you to quickly refresh the database copy with up-to-date information from the primary database.
48 Decision support Creating a replica database on the same host Creating a replica database on the same host Figure 5-1 shows an example where the primary database volumes to be backed up, dbase_vol and dbase_logs, are configured on disks attached to controllers c1 and c2, and the snapshots are to be created on disks attached to controllers c3 and c4.
Decision support Creating a replica database on the same host To set up a replica database to be used for decision support on the primary host 1 If you have not already done so, prepare the host to use the snapshot volume that contains the copy of the database tables. Set up any new database logs and configuration files that are required to initialize the database.
50 Decision support Creating a replica database on the same host 3 If the volumes to be backed up contain database tables in file systems, suspend updates to the volumes. Oracle supports online backup by temporarily suspending updates to the datafiles of the tablespaces, provided that the database is running in archive mode and the tablespaces are online.
Decision support Creating an off-host replica database Creating an off-host replica database Figure 5-2 shows an example where the primary database volumes to be backed up, dbase_vol and dbase_logs, are configured on disks attached to controllers c1 and c2, and the snapshots are to be created on disks attached to controllers c3 and c4. There is no requirement for the OHP host to have access to the disks that contain the primary database volumes.
52 Decision support Creating an off-host replica database Figure 5-2 Example system configuration for off-host decision support Network Primary host for database OHP host Local disks Local disks Volumes created on local disks of OHP host are used for the replica database’s logs and configuration files Controllers c1 c2 c3 Volumes created on these disks are accessed by the primary host Controllers c4 c1 Disk arrays c2 c3 c4 Snapshot volumes created on these disks are accessed by both hosts
Decision support Creating an off-host replica database To set up a replica database to be used for decision support on an OHP host 1 If you have not already done so, prepare the OHP host to use the snapshot volume that contains the copy of the database tables. Set up any new database logs and configuration files that are required to initialize the database. See “Preparing a replica Oracle database” on page 73 for details of this procedure for an Oracle database.
54 Decision support Creating an off-host replica database 5 Release all the tablespaces or databases from suspend, hot backup or quiesce mode. As the Oracle database administrator, release all the tablespaces from hot backup mode using a script such as that shown in “Script to end Oracle database hot backup mode” on page 66.
Decision support Creating an off-host replica database 12 Copy any required log files from the primary host to the OHP host. For an Oracle database on the OHP host, copy the archived log files that were generated while the database was in hot backup mode to the new database’s archived log directory (for example, /rep/archlog). 13 As the database administrator, start the new database.
56 Decision support Creating an off-host replica database Reattaching snapshot plexes Note: This operation is not supported for space-optimized instant snapshots.
Chapter 6 Database recovery You can use Storage Checkpoints to implement efficient backup and recovery of databases that have been laid out on VxFS file systems. A Storage Checkpoint allows you to roll back an entire database, a tablespace, or a single database file to the time that the Storage Checkpoint was taken. Rolling back to or restoring from any Storage Checkpoint is generally very fast because only the changed data blocks need to be restored.
58 Database recovery Creating Storage Checkpoints Creating Storage Checkpoints To create Storage Checkpoints, select 3 Storage Checkpoint Administration > Create New Storage Checkpoints in the VxDBA utility. This can be done with a database either online or offline. Note: To create a Storage Checkpoint while the database is online, ARCHIVELOG mode must be enabled in Oracle. During the creation of the Storage Checkpoint, the tablespaces are placed in backup mode.
Database recovery Rolling back a database 3 Start up, but do not open, the database instance by selecting 1 Database Administration > Startup Database Instance in the VxDBA utility. 4 Use one of the following commands to perform an incomplete media recovery of the database: ■ Recover the database until you stop the recovery: recover database until cancel; ...
60 Database recovery Rolling back a database
Appendix A Files and scripts for sample scenarios Note: These scripts are not supported by Symantec, and are provided for informational use only. You can purchase customization of the environment through Veritas Vpro Consulting Services. This appendix contains the following configuration files and scripts for the sample point-in-time copy processing scenarios described in this guide: File or script Used for... “Script to initiate online off-host backup of an Oracle database” on page 63.
62 Files and scripts for sample scenarios File or script Used for... “Script to complete, recover and start a ■ replica Oracle database” on page 70. Decision support; see “Creating an offhost replica database” on page 51.
Files and scripts for sample scenarios Script to initiate online off-host backup of an Oracle database Script to initiate online off-host backup of an Oracle database #!/bin/ksh # # script: backup_online.sh # # Sample script for online, off-host backup. # # Note: This is not a production level script, its intention is to help # you understand the procedure and commands for implementing # an off-host point-in-time copy solution.
64 Files and scripts for sample scenarios Script to initiate online off-host backup of an Oracle database vxdg split $dbasedg $snapdg $snapvollist # Deport the snapshot disk group. vxdg deport $snapdg # The snapshots of the database can be imported and backed up # on the OHP node and then deported. # Note: Replace “rsh” with “remsh” on HP-UX systems. rsh $dbnode -c “do_backup.
Files and scripts for sample scenarios Script to put an Oracle database into hot backup mode Script to put an Oracle database into hot backup mode #!/bin/ksh # # script: backup_start.sh # # Sample script to put example Oracle database into hot backup mode. export ORACLE_SID=dbase export ORACLE_HOME=/oracle/816 export PATH=$ORACLE_HOME/bin:$PATH svrmgrl <
66 Files and scripts for sample scenarios Script to end Oracle database hot backup mode Script to end Oracle database hot backup mode #!/bin/ksh # # script: backup_end.sh # # Sample script to end hot backup mode for example Oracle database. export ORACLE_SID=dbase export ORACLE_HOME=/oracle/816 export PATH=$ORACLE_HOME/bin:$PATH svrmgrl <
Files and scripts for sample scenarios Script to perform off-host backup Script to perform off-host backup #!/bin/ksh # # script: do_backup.sh # # Sample script for off-host backup # # Note: This is not a production level script, its intention is to help # you understand the procedure and commands for implementing # an off-host point-in-time copy solution. # Modify the following procedure according to your environment # and backup method.
68 Files and scripts for sample scenarios Script to create an off-host replica Oracle database Script to create an off-host replica Oracle database #!/bin/ksh # # script: create_dss.sh # # Sample script to create a replica Oracle database on an OHP host. # # Note: This is not a production level script, its intention is to help # you understand the procedure and commands for implementing # an off-host point-in-time copy solution.
Files and scripts for sample scenarios Script to create an off-host replica Oracle database vxdg deport $snapdg # # # # Copy the archive logs that were generated while the database was in hot backup mode (as reported by the Oracle Server Manager) to the archive log location for the replica database on the OHP node (in this example, /rep/archlog).
70 Files and scripts for sample scenarios Script to complete, recover and start a replica Oracle database Script to complete, recover and start a replica Oracle database #!/bin/ksh # # script: startdb.sh # # Sample script to complete, recover and start replica Oracle database. # # It is assumed that you have already performed the following # steps: # 1. Create the local volumes, file systems, and mount points for the # redo and archived logs, and then mount them. # 2.
Files and scripts for sample scenarios Script to complete, recover and start a replica Oracle database rm -f ${rep_mnt_point}/dbase_vol/cntrl1 # Create a new control file, recover and start the replica database. svrmgrl <
72 Files and scripts for sample scenarios Script to complete, recover and start a replica Oracle database
Appendix B Preparing a replica Oracle database This appendix describes how to set up a replica off-host Oracle database to be used for decision support as described in “Creating an off-host replica database” on page 51. To prepare a replica Oracle database on a host other than the primary host 1 If not already present, install the Oracle software onto the host’s local disks.
74 Preparing a replica Oracle database 4 Create the mount points that are to be used to mount the new database.
Preparing a replica Oracle database See “SQL script to create a control file” on page 78 for an example. 8 Copy the Oracle initialization file (for example, initdbase.ora; see “Initialization file for original production database” on page 79) for the original database to a new initialization file for the replica database (for example, initREP1.ora; see “Initialization file for replica Oracle database” on page 80).
76 Preparing a replica Oracle database Text control file for original production database Text control file for original production database /oracle/816/admin/dbase/udump/dbase_ora_20480.trc Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Production ORACLE_HOME = /oracle/816 System name: SunOS Node name: node01 Release: 5.
Preparing a replica Oracle database Text control file for original production database # No tempfile entries found to add.
78 Preparing a replica Oracle database SQL script to create a control file SQL script to create a control file STARTUP NOMOUNT CREATE CONTROLFILE SET DATABASE “REP1” RESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 2 MAXDATAFILES 70 MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 ’/rep/dbase_vol/log1’ SIZE 52428288, # . # . List of log files # . GROUP N ’/rep/dbase_vol/logN’ SIZE 52428288 DATAFILE ’/rep/dbase_vol/ts1’, # . # . List of tablespace datafiles # .
Preparing a replica Oracle database Initialization file for original production database Initialization file for original production database #==================================================================+ # FILENAME initdbase.ora # DESCRIPTION Oracle parameter file for primary database, dbase.
80 Preparing a replica Oracle database Initialization file for replica Oracle database Initialization file for replica Oracle database ##==================================================================+ # FILENAME initREP1.ora # DESCRIPTION Oracle parameter file for replica database, REP1.
Index A ARCHIVELOG mode 58 attributes autogrowby 29 highwatermark 29 init 27 ndcomirror 27 nmirror 27 regionsize 28 tuning the autogrow feature 29 autogrow feature tuning attributes 29 autogrowby attribute 29 B backup of cluster file systems 41 of online databases 31 C cache autogrow attributes 29 creating for use by space-optimized snapshots 28 for space-optimized instant snapshots 11 cluster file systems off-host backup of 41 D databases incomplete media recovery 59 integrity of data in 20 online back
82 Index O off-host backup of cluster file systems using point-in-time copy solutions 41 online database backup using point-in-time copy solutions 31 P Persistent FastResync 10 plexes moving 24 point-in-time copy solutions applications 8 for decision support 47 for off-host cluster file system backup 41 for online database backup 31 scenarios 9 R recovery using Storage Checkpoints 57 regionsize attribute 28 resetlogs option 59 resynchronizing snapshots 20 S shared access mounting file systems for 43 sna