Veritas™ FlashSnap Point-In-Time Copy Solutions 5.0.1 Administrator's Guide HP-UX 11i v3 HP Part Number: 5900-0086 Published: November 2009 Edition: 1.
© Copyright 2009 Hewlett-Packard Development Company, L.P. 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 Technical Support ............................................................................................... 4 Chapter 1 Point-in-time copy solutions .............................................. 9 About point-in-time copy solutions ................................................... 9 Applications of point-in-time copy solutions ..................................... 10 Point-in-time copy scenarios ....................................................
8 Contents Using off-host processing to back up cluster file systems ..................... 55 Reattaching snapshot plexes .................................................... 59 Chapter 5 Decision support ................................................................. 61 About decision support ................................................................. Creating a replica database on the same host ..................................... Creating an off-host replica database ......................
Chapter 1 Point-in-time copy solutions This chapter includes the following topics: ■ About point-in-time copy solutions ■ Applications of point-in-time copy solutions ■ Veritas software used in point-in-time copy scenarios ■ Implementing point-in time copy solutions on a primary host ■ Implementing off-host point-in-time copy solutions About point-in-time copy solutions This topic introduces the point-in-time copy solutions that you can implement using the Veritas FlashSnap™ technology.
10 Point-in-time copy solutions Applications of point-in-time copy solutions suitable for implementing solutions where the I/O performance of the production server is critical. See “Persistent FastResync of volume snapshots” on page 14. See “Disk group split/join” on page 15. ■ File system-level solutions use the Storage Checkpoint feature of Veritas File System.
Point-in-time copy solutions Veritas software used in point-in-time copy scenarios Checkpoints or a snapshot copy than by full restoration from tape or other backup media. Point-in-time copy scenarios Point-in-time copies of volumes allow you to capture an image of a database or file system at a selected instant for use in applications such as backups, decision support, reporting, and development testing.
12 Point-in-time copy solutions Veritas software used in point-in-time copy scenarios Table 1-1 Veritas products used with Veritas FlashSnap license Environment Database server Other applications Standalone primary host Veritas Storage Foundation for Veritas Storage Foundation DB2, Oracle or Sybase Cluster without automatic failover Veritas Storage Foundation for Veritas Storage Foundation for DB2, Oracle or Sybase Cluster File System Cluster with automatic Veritas Storage Foundation for Veritas
Point-in-time copy solutions Veritas software used in point-in-time copy scenarios ■ Veritas Cluster Server (VCS) is a high-availability (HA) solution for cluster configurations. VCS monitors systems and application services, and restarts services on a different cluster node (failover) in the event of either hardware or software failure. It also allows you to perform general administration tasks such as making nodes join or leave a cluster.
14 Point-in-time copy solutions Veritas software used in point-in-time copy scenarios ■ Veritas Storage Foundation Installation Guide ■ Veritas File System Administrator’s Guide ■ Veritas Volume Manager Administrator’s Guide ■ Symantec NetBackup DataCenter Installation Guide ■ Symantec NetBackup DataCenter System Administrator’s Guide ■ Symantec NetBackup ServerFree Agent System Administrator’s Guide ■ Symantec NetBackup for Oracle ServerFree Agent System Administrator’s Guide ■ Symantec Ne
Point-in-time copy solutions Veritas software used in point-in-time copy scenarios an additional plex to a mirrored volume. After the contents of the third-mirror (or snapshot plex) had been synchronized from the original plexes of the volume, it could be detached as a snapshot volume for use in backup or decision support applications.
16 Point-in-time copy solutions Veritas software used in point-in-time copy scenarios since a previous Storage Checkpoint was taken. Storage Checkpoints have the following important features: ■ Storage Checkpoints persist across system reboots and crashes. ■ A Storage Checkpoint can preserve not only file system metadata and the directory hierarchy of the file system, but also user data as it existed when the Storage Checkpoint was taken.
Point-in-time copy solutions Implementing point-in time copy solutions on a primary host You can use the commands in Veritas FlashSnap Agent for Symmetrix to: ■ Associate a disk group with a BCV disk group, or Symmetrix STD devices in a disk group with identical BCV devices. ■ Initiate TimeFinder mirroring for Symmetrix STD devices in a disk group. ■ Split Symmetrix STD devices from their BCV devices and create duplicate volumes on the BCV devices.
18 Point-in-time copy solutions Implementing point-in time copy solutions on a primary host Figure 1-1 Using snapshots and FastResync to implement point-in-time copy solutions on a primary host Primary host 1. Prepare the volumes If required, create a cache or empty volume in the disk group, and use vxsnap prepare to prepare volumes for snapshot creation. Volume Cache or empty volume 2. Create instant snapshot volumes Use vxsnap make to create instant snapshot volumes of one or more volumes.
Point-in-time copy solutions Implementing off-host point-in-time copy solutions 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 primary volumes a
20 Point-in-time copy solutions Implementing off-host point-in-time copy solutions Figure 1-3 Example implementation of an off-host point-in-time copy solution OHP host Primary Host Network 1 2 Disks containing primary volumes used to hold production databases or file systems SCSI or Fibre Channel connectivity Disks containing snapshot volumes Also, if you place the snapshot volumes on disks that are attached to host controllers other than those for the disks in the primary volumes, it is possibl
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 c1 c2 c3 c4 c3 c4 Fibre Channel hubs or switches Disk arrays This layout uses redundant-loop access to deal with the potential failure of any single component in the path between a system and a disk array. Note: On some operating systems, controller names may differ from what is shown here.
22 Point-in-time copy solutions Implementing off-host point-in-time copy solutions Figure 1-5 Example implementation of an off-host point-in-time copy solution using a cluster node Cluster Cluster node configured as OHP host 1 2 Disks containing primary volumes used to hold production databases or file systems SCSI or Fibre Channel connectivity Disks containing snapshot volumes used to implement off-host processing solutions Figure 1-6 shows an alternative arrangement, where the OHP node could be
Point-in-time copy solutions Implementing off-host point-in-time copy solutions Note: For off-host processing, the example scenarios in this document assume that a separate OHP host is dedicated to the backup or decision support role. For clusters, it may be simpler, and more efficient, to configure an OHP host that is not a member of the cluster. Figure 1-7 illustrates the steps that are needed to set up the processing solution on the primary host.
24 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.
Point-in-time copy solutions Implementing off-host point-in-time copy solutions Disk Group Split/Join is used to split off snapshot volumes into a separate disk group that is imported on the OHP host. Note: As the snapshot volumes are to be moved into another disk group and then imported on another host, their contents must first be synchronized with the parent volumes. On reimporting the snapshot volumes, refreshing their contents from the original volume is speeded by using FastResync.
26 Point-in-time copy solutions Implementing off-host point-in-time copy solutions is usually much quicker than using alternative approaches such as full restoration from backup media.
Chapter 2 Setting up volumes for instant snapshots This chapter includes the following topics: ■ About setting up volumes for instant snapshots ■ Additional preparation activities ■ Preparing a volume for instant snapshot operations ■ Creating a volume for use as a full-sized instant snapshot ■ Creating a shared cache object About setting up volumes for instant snapshots This chapter describes how to make volumes ready for instant snapshot creation.
28 Setting up volumes for instant snapshots Additional preparation activities Table 2-1 Creation of snapshot mirrors Point-in-time copy application Create snapshot mirrors for volumes containing... Online database backup VxFS file systems for database datafiles to be backed up. See “About online database backup” on page 41. Off-host cluster file system backup VxFS cluster file systems to be backed up. See “About off-host cluster file system backup” on page 53.
Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations For more information about Administering Volume Snapshots, see the Veritas Volume Manager Administrator’s Guide. ■ Use a separate empty volume that you have prepared in advance. See “Creating a volume for use as a full-sized instant snapshot” on page 35. When creating space-optimized instant snapshots that share a cache, you must set up the cache before creating the snapshots.
30 Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations 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.
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.
32 Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations To view the details of the DCO object and DCO volume that are associated with a volume, use the vxprint command. The following is example vxprint -vh output for the volume named zoo (the TUTIL0 and PUTIL0 columns are omitted for clarity): TTY ...
Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations Figure 2-1 illustrates some instances in which it is not be possible to split a disk group because of the location of the DCO plexes. Relocate DCO plexes as needed. See “Preparing a volume for instant snapshot operations” on page 29.
34 Setting up volumes for instant snapshots Preparing a volume for instant snapshot operations Examples of disk groups that can and cannot be split Figure 2-1 Volume data plexes 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.
36 Setting up volumes for instant snapshots Creating a shared cache object 3 Use the vxprint command on the DCO to discover its region size (in blocks): # RSZ=‘vxprint [-g diskgroup] -F%regionsz $DCONAME‘ 4 Use the vxassist command to create a volume, snapvol, of the required size and redundancy, together with a version 20 DCO volume with the correct region size: # vxassist [-g diskgroup] make snapvol $LEN \ [layout=mirror nmirror=number] logtype=dco drl=no \ dcoversion=20 [ndcomirror=number] regionsz=
Setting up volumes for instant snapshots Creating a shared cache object 2 ■ If redundancy is a desired characteristic of the cache volume, it should be mirrored. This increases the space that is required for the cache volume in proportion to the number of mirrors that it has. ■ If the cache volume is mirrored, space is required on at least as many disks as it has mirrors. These disks should not be shared with the disks used for the parent volumes.
38 Setting up volumes for instant snapshots Creating a shared cache object 3 Use the vxmake cache command to create a cache object on top of the cache volume that you created in the previous step: # vxmake [-g diskgroup] cache cache_object \ cachevolname=volume [regionsize=size] [autogrow=on] \ [highwatermark=hwmk] [autogrowby=agbvalue] \ [maxautogrow=maxagbvalue]] If the region size, regionsize, is specified, it must be a power of 2, and be greater than or equal to 16KB (16k).
Setting up volumes for instant snapshots Creating a shared cache object blocks), vxcached grows the size of the cache volume by the value of autogrowby (default value is 20% of the size of the cache volume in blocks). ■ When cache usage reaches the high watermark value, and the new required cache size would exceed the value of maxautogrow, vxcached deletes the oldest snapshot in the cache. If there are several snapshots with the same age, the largest of these is deleted.
40 Setting up volumes for instant snapshots Creating a shared cache object
Chapter 3 Online database backup This chapter includes the following topics: ■ About online database backup ■ Making a backup of an online database on the same host ■ Making an off-host backup of an online database About 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.
42 Online database backup Making a backup of an online database on the same host ■ Script to suspend I/O for a DB2 database ■ Script to end Oracle database hot backup mode ■ Script to release a Sybase ASE database from quiesce mode ■ Script to resume I/O for a DB2 database ■ Script to perform off-host backup 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
Online database backup Making a backup of an online database on the same host Example system configuration for database backup on the primary host Figure 3-1 Primary host for database Local disks Controllers c1 c2 c3 Database volumes are created on these disks c4 Disk arrays Snapshot volumes are created on these disks Backup to disk, tape or other media by primary host Note: It is assumed that you have already prepared the volumes containing the file systems for the datafiles to be backed up as
44 Online database backup Making a backup of an online database on the same host # vxsnap -g volumedg addmir volume [nmirror=N] \ [alloc=storage_attributes] # vxsnap -g volumedg make \ source=volume/newvol=snapvol[/nmirror=N]\ [alloc=storage_attributes] 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. You can specify storage attributes (such as a list of disks) to determine where the plexes are created.
Online database backup Making a backup of an online database on the same host When you are ready to make a backup, proceed to step 2. 2 3 If the volumes to be backed up contain database tables in file systems, suspend updates to the volumes: ■ DB2 provides the write suspend command to temporarily suspend I/O activity for a database. As the DB2 database administrator, use a script such as that shown in the example. See “Script to suspend I/O for a DB2 database” on page 88.
46 Online database backup Making a backup of an online database on the same host ■ 5 As the Sybase database administrator, release the database from quiesce mode using a script such as that shown in the example. See “Script to release a Sybase ASE database from quiesce mode” on page 89. Back up the snapshot volume. If you need to remount the file system in the volume to back it up, first run fsck on the volume.
Online database backup Making an off-host backup of an online database Making an off-host backup of an online database Figure 3-2 shows an example of 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. There is no requirement for the OHP host to have access to the disks that contain the primary database volumes.
48 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 the example. See “About setting up volumes for instant snapshots” on page 27. 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.
Online database backup Making an off-host backup of an online database ■ 3 Sybase ASE from version 12.0 onward provides the Quiesce feature to allow temporary suspension of writes to a database. As the Sybase database administrator, put the database in quiesce mode by using a script such as that shown in the example. See “Script to quiesce a Sybase ASE database” on page 87.
50 Online database backup Making an off-host backup of an online database 6 On the primary host, deport the snapshot volume’s disk group using the following command: # vxdg deport snapvoldg 7 On the OHP host where the backup is to be performed, use the following command to import the snapshot volume’s disk group: # vxdg import snapvoldg 8 The snapshot volumes are initially disabled following the split.
Online database backup Making an off-host backup of an online database 11 On the primary host, re-import the snapshot volume’s disk group using the following command: # vxdg [-s] import snapvoldg Note: Specify the -s option if you are reimporting the disk group to be rejoined with a shared disk group in a cluster.
52 Online database backup Making an off-host backup of an online database The destroy attribute specifies whether the plexes of the snapshot volume are to be reattached to the original volume.
Chapter 4 Off-host cluster file system backup This chapter includes the following topics: ■ About off-host cluster file system backup ■ Mounting a file system for shared access ■ Using off-host processing to back up cluster file systems About 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.
54 Off-host cluster file system backup Mounting a file system for shared access System configuration for off-host file system backup scenarios Figure 4-1 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 Mounting
Off-host cluster file system backup Using off-host processing to back up cluster file systems # mount -F vxfs -o cluster /dev/vx/dsk/exampledg/cfs_vol /mnt_pnt Using off-host processing to back up cluster file systems Before using this procedure, you must prepare the volumes containing the file systems that are to be backed up. See “About setting up volumes for instant snapshots” on page 27.
56 Off-host cluster file system backup Using off-host processing to back up cluster file systems To back up a snapshot of a mounted file system which has shared access 1 On the master node of the cluster, use the following command to make a full-sized snapshot, snapvol, of the volume containing the file system by breaking off plexes from the original volume: # vxsnap -g volumedg make \ source=volume/newvol=snapvol/nmirror=N The nmirror attribute specifies the number of mirrors, N, in the snapshot volum
Off-host cluster file system backup Using off-host processing to back up cluster file systems 3 On the master node, use the following command to wait for the contents of the snapshot to be fully synchronous with the contents of the original volume: # vxsnap -g volumedg syncwait snapvol For example, to wait for synchronization to finish for the snapshots scfs_vol: # vxsnap -g exampledg syncwait scfs_vol Note: You cannot move a snapshot volume into a different disk group until synchronization of its conte
58 Off-host cluster file system backup Using off-host processing to back up cluster file systems 8 On the OHP host, use the following commands to check and locally mount the snapshot volume: # fsck -F vxfs /dev/vx/rdsk/diskgroup/volume # mount -F vxfs /dev/vx/dsk/diskgroup/volume mount_point Note: On Linux, use the -t option, and on AIX, use the -V option, instead of the -F option for both commands.
Off-host cluster file system backup Using off-host processing to back up cluster file systems 13 The snapshot volume is initially disabled following the join.
60 Off-host cluster file system backup Using off-host processing to back up cluster file systems By default, all the plexes are reattached, which results in the removal of the snapshot. If required, the number of plexes to be reattached may be specified as the value assigned to the nmirror attribute. Note: The snapshot being reattached must not be open to any application. For example, any file system configured on the snapshot volume must first be unmounted.
Chapter 5 Decision support This chapter includes the following topics: ■ About decision support ■ Creating a replica database on the same host ■ Creating an off-host replica database About 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.
62 Decision support Creating a replica database on the same host ■ Script to suspend I/O for a DB2 database ■ Script to end Oracle database hot backup mode ■ Script to release a Sybase ASE database from quiesce mode ■ Script to resume I/O for a DB2 database ■ Script to create an off-host replica Oracle database ■ Script to complete, recover and start a replica Oracle database ■ Script to start a replica Sybase ASE database Creating a replica database on the same host Figure 5-1 shows an exam
Decision support Creating a replica database on the same host Example system configuration for decision support on the primary host Figure 5-1 Primary host for database Local disks Controllers c1 c2 c3 Database volumes are created on these disks c4 Disk arrays Snapshot volumes are created on these disks Note: It is assumed that you have already prepared the database volumes to be replicated as described in the example. See “About setting up volumes for instant snapshots” on page 27.
64 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.
Decision support Creating a replica database on the same host 2 Use the following command to make a full-sized snapshot, snapvol, of the tablespace volume by breaking off plexes from the original volume: # vxsnap -g volumedg make \ source=volume/newvol=snapvol/nmirror=N The nmirror attribute specifies the number of mirrors, N, in the snapshot volume. If the volume does not have any available plexes, or its layout does not support plex break-off, prepare an empty volume for the snapshot.
66 Decision support Creating a replica database on the same host Note: This step sets up the snapshot volumes, and starts tracking changes to the original volumes. When you are ready to create the replica database, proceed to step 3. 3 4 If the volumes to be backed up contain database tables in file systems, suspend updates to the volumes: ■ DB2 provides the write suspend command to temporarily suspend I/O activity for a database.
Decision support Creating a replica database on the same host 5 If you temporarily suspended updates to volumes in step 3, perform the following steps. Release all the tablespaces or databases from suspend, hot backup or quiesce mode: 6 ■ As the DB2 database administrator, use a script such as that shown in the example. See “Script to resume I/O for a DB2 database” on page 89.
68 Decision support Creating an off-host replica database ■ For a Sybase ASE database, if you specified the for external dump clause when you quiesced the database, use the following isql command as the database administrator to dump the transaction log for the database: dump transaction to dump_device with standby_access Then copy the dumped transaction log to the appropriate replica database directory.
Decision support Creating an off-host replica database 69 Note: If the database is configured on volumes in a cluster-shareable disk group, it is assumed that the primary host for the database is the master node for the cluster. If the primary host is not also the master node, all VxVM operations on shared disk groups must be performed on the master node.
70 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 “About preparing a replica Oracle database” on page 97.
Decision support Creating an off-host replica database 4 ■ 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. As the Oracle database administrator, put each tablespace into hot backup mode using a script such as that shown in the example. See “Script to put an Oracle database into hot backup mode” on page 87. ■ Sybase ASE from version 12.
72 Decision support Creating an off-host replica database See “Script to release a Sybase ASE database from quiesce mode” on page 89.
Decision support Creating an off-host replica database 11 On the OHP host, for each snapshot volume containing tablespaces, check the file system that it contains, and mount the volume using the following commands: # fsck -F vxfs /dev/vx/rdsk/diskgroup/snapvol # mount -F vxfs /dev/vx/dsk/diskgroup/snapvol mount_point Note: On Linux, use the -t option, and on AIX, use the -V option, instead of the -F option for both commands.
74 Decision support Creating an off-host replica database If the replica DB2 database is to be rolled forward (the primary must have been placed in LOGRETAIN RECOVERY mode before the snapshot was taken), use the following commands to start it, and put it in roll-forward pending state: db2start db2inidb database as standby Obtain the latest log files from the primary database, and use the following command to roll the replica database forward to the end of the logs: db2 rollforward db database to end of l
Decision support Creating an off-host replica database To resynchronize a snapshot with the primary database 1 On the OHP host, shut down the replica database, and use the following command to unmount each of the snapshot volumes: # unmount mount_point 2 On the OHP host, use the following command to deport the snapshot volume’s disk group: # vxdg deport snapvoldg 3 On the primary host, re-import the snapshot volume’s disk group using the following command: # vxdg [-s] import snapvoldg Note: Specify
76 Decision support Creating an off-host replica database To update the replica database 1 On the primary host, use the following isql command to dump the transaction log for the database: dump transaction to dump_device with standby_access Copy the transaction log dump to the appropriate database directory on the OHP host.
Decision support Creating an off-host replica database To reattach a snapshot ◆ Use the following command, to reattach some or all plexes of an instant snapshot to the specified original volume, or to a source volume in the snapshot hierarchy above the snapshot volume: # vxsnap [-g diskgroup] reattach snapvol source=vol \ [nmirror=number] For example the following command reattaches 1 plex from the snapshot volume, snapmyvol, to the volume, myvol: # vxsnap -g mydg reattach snapmyvol source=myvol nmirror=
78 Decision support Creating an off-host replica database
Chapter 6 Database recovery This chapter includes the following topics: ■ About database recovery ■ Creating Storage Checkpoints ■ Rolling back a database About 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.
80 Database recovery Creating Storage Checkpoints Storage Checkpoints require space in the file systems where they are created, and the space required grows over time as copies of changed file system blocks are made. If a file system runs out of space, and there is no disk space into which the file system and any underlying volume can expand, VxFS automatically removes the oldest Storage Checkpoints if they were created with the removable attribute.
Database recovery Rolling back a database To roll back a database 1 Ensure that the database is offline. You can use the VxDBA utility to display the status of the database and its tablespaces, and to shut down the database: ■ Select 2 Display Database/VxDBA Information to access the menus that display status information. ■ Select 1 Database Administration > Shutdown Database Instance to shut down a database.
82 Database recovery Rolling back a database See the Oracle documentation for complete and detailed information on database recovery. 5 To open the database after an incomplete media recovery, use the following command: alter database open resetlogs; Note: The resetlogs option is required after an incomplete media recovery to reset the log sequence. Remember to perform a full database backup and create another Storage Checkpoint after log reset.
Appendix A Files and scripts for sample scenarios This appendix includes the following topics: ■ About files and scripts for sample scenarios ■ Script to initiate online off-host backup of an Oracle database ■ Script to put an Oracle database into hot backup mode ■ Script to quiesce a Sybase ASE database ■ Script to suspend I/O for a DB2 database ■ Script to end Oracle database hot backup mode ■ Script to release a Sybase ASE database from quiesce mode ■ Script to resume I/O for a DB2 datab
84 Files and scripts for sample scenarios About 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. Table A-1 list the files and scripts. Table A-1 Files and scripts for sample scenarios File or script Used for... Script to initiate online ■ Online off-host backup.
Files and scripts for sample scenarios Script to initiate online off-host backup of an Oracle database 85 Script to initiate online off-host backup of an Oracle database Use this script to initiate online off-host backup of an Oracle database. #!/bin/ksh # # script: backup_online.sh # # Sample script for online, off-host backup.
86 Files and scripts for sample scenarios Script to initiate online off-host backup of an Oracle database # see the backup_end.sh script for information. su oracle -c backup_end.sh # Back up the archive logs that were generated while the database # was in hot backup mode (as reported by the Oracle Server Manager). # Move the snapshot volumes into a separate disk group. vxdg split $dbasedg $snapdg $snapvollist # Deport the snapshot disk group.
Files and scripts for sample scenarios Script to put an Oracle database into hot backup mode 87 Script to put an Oracle database into hot backup mode Use this 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 <
88 Files and scripts for sample scenarios Script to suspend I/O for a DB2 database go quit ! Script to suspend I/O for a DB2 database Use this script to suspend I/O for a DB2 database. #!/bin/ksh # # script: backup_start.sh # # Sample script to suspend I/O for a DB2 database. # # Note: To recover a database using backups of snapshots, the database # must be in LOGRETAIN mode.
Files and scripts for sample scenarios Script to release a Sybase ASE database from quiesce mode 89 alter tablespace tsN end backup; alter system switch logfile; alter system switch logfile; archive log list; quit ! # Note: The repeated line alter system switch logfile; forces a checkpoint a # archives the contents of the redo logs recorded during the back Script to release a Sybase ASE database from quiesce mode Use this script to release a Sybase ASE database from quiesce mode.
90 Files and scripts for sample scenarios Script to perform off-host backup quit ! Script to perform off-host backup Use this 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.
Files and scripts for sample scenarios Script to create an off-host replica Oracle database 91 for i in ′echo $vollist′ do umount /bak/$i done # Deport snapshot volume disk group. vxdg deport $snapvoldg echo “do_backup over” echo “\007 \007 \007 \007 \007 \007” Script to create an off-host replica Oracle database Use this 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.
92 Files and scripts for sample scenarios Script to create an off-host replica Oracle database su oracle -c backup_start.sh # # # # # # Refresh the snapshots of the volumes. Note: If the volume is not mounted, you can safely ignore the following message that is output by the snapshot operation: vxvm:vxsync: ERROR: Volume dbase_vol: No entry in /etc/mnttab for volume vxsnap -g $dbasedg refresh $volsnaplist # Take the Oracle database out of hot-backup mode; # see the backup_end.sh script for information.
Files and scripts for sample scenarios Script to complete, recover and start a replica Oracle database 93 Script to complete, recover and start a replica Oracle database Use this 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.
94 Files and scripts for sample scenarios Script to start a replica Sybase ASE database cd ${rep_mnt_point}/dbase_vol for i in 1 2 3 4 5 6 # adjust as required do rm -f ./log$i ln -s ${rep_mnt_point}/dbase_logs/log$i ./log$i done # Remove the existing control file. rm -f ${rep_mnt_point}/dbase_vol/cntrl1 # Create a new control file, recover and start the replica database. svrmgrl <
Files and scripts for sample scenarios Script to start a replica Sybase ASE database done # # # # Start the replica database. Specify the -q option if you specified the “for external dump” clause when you quiesced the primary database. See the Sybase ASE 12.5 documentation for more information. /sybase/ASE-12_5/bin/dataserver \ [-q] \ -sdatabase_name \ -d /sybevm/master \ -e /sybase/ASE-12_5/install/dbasename.log \ -M /sybase # Online the database.
96 Files and scripts for sample scenarios Script to start a replica Sybase ASE database
Appendix B Preparing a replica Oracle database This appendix includes the following topics: ■ About preparing a replica Oracle database ■ Text control file for original production database ■ SQL script to create a control file ■ Initialization file for original production database ■ Initialization file for replica Oracle database About preparing a replica Oracle database This appendix describes how to set up a replica off-host Oracle database to be used for decision support.
98 Preparing a replica Oracle database About preparing a replica Oracle database 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. The location of the Oracle home directory ($ORACLE_HOME) is used for the database instance that is created from the snapshot volumes. Note: In the examples shown here, the home directory is /rep/oracle in the local disk group, localdg.
Preparing a replica Oracle database About preparing a replica Oracle database 5 Mount the redo log and archive log volumes on their respective mount points using the following command: # mount -F vxfs /dev/vx/dsk/diskgroup/volume mount_point In this example, the commands would be: # mount -F vxfs /dev/vx/dsk/localdg/rep_dbase_logs \ /rep/dbase_logs # mount -F vxfs /dev/vx/dsk/localdg/rep_dbase_arch \ /rep/dbase_arch 6 As the Oracle database administrator on the primary host, obtain an ASCII version of
100 Preparing a replica Oracle database Text control file for original production database CREATE CONTROLFILE SET DATABASE "ndb" RESETLOGS \ NOARCHIVELOG where odb is the name of the original database and ndb is the name of the replica database (DBASE and REP1 in the example). Note that to reduce unnecessary overhead, the new database is not run in archive log mode. See “SQL script to create a control file” on page 102.
Preparing a replica Oracle database Text control file for original production database With the Partitioning option JServer Release 8.1.6.0.0 - Production ORACLE_HOME = /oracle/816 System name: SunOS Node name: node01 Release: 5.8 Version: Generic_108528-02 Machine: sun4u Instance name: dbase Redo thread mounted by this instance: 1 Oracle process number: 8 Unix process pid: 20480, image: oracle@node01 *** SESSION ID:(#.##) YYYY-MM-DD hh:mm:ss.sss *** YYYY-MM-DD hh:mm:ss.
102 Preparing a replica Oracle database SQL script to create a control file ALTER SYSTEM ARCHIVE LOG ALL; # Database can now be opened normally. ALTER DATABASE OPEN; # No tempfile entries found to add. # SQL script to create a control file The following example shows the SQL script to create a control file .
Preparing a replica Oracle database Initialization file for original production database parallel_max_servers recovery_parallelism # db_writers # use_async_io # async_io control_files sort_area_size parallel_max_servers recovery_parallelism compatible db_name db_files db_file_multiblock_read_count db_block_buffers dml_locks hash_join_enabled = 30 = 20 = 25 = TRUE = 1 = (/dbase_vol/cntrl1) = 15728640 = 10 = 4 = 8.1.
104 Preparing a replica Oracle database Initialization file for replica Oracle database core_dump_dest user_dump_dest = /oracle/816/admin/dbase/cdump = /oracle/816/admin/dbase/udump Initialization file for replica Oracle database The following example shows the initialization file for the replica Oracle database. ##==================================================================+ # FILENAME initREP1.ora # DESCRIPTION Oracle parameter file for replica database, REP1.
Preparing a replica Oracle database Initialization file for replica Oracle database (s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s2 4,s25,s26,s27,s28,s29,s30) shared_pool_size = 7000000 cursor_space_for_time = TRUE audit_trail = FALSE cursor_space_for_time = TRUE background_dump_dest = /rep/oracle/816/admin/REP1/bdump core_dump_dest = /rep/oracle/816/admin/REP1/cdump user_dump_dest = /rep/oracle/816/admin/REP1/udump 105
106 Preparing a replica Oracle database Initialization file for replica Oracle database
Index A ARCHIVELOG mode 80 attributes autogrowby 38 highwatermark 38 init 36 ndcomirror 36 nmirror 36 regionsize 38 tuning the autogrow feature 38 autogrow feature tuning attributes 38 autogrowby attribute 38 B backup of cluster file systems 53 of online databases 41 BCV 16 Business Continuance Volume (BCV) 16 C cache autogrow attributes 38 creating for use by space-optimized snapshots 36 for space-optimized instant snapshots 14 cluster file systems off-host backup of 53 D databases incomplete media rec
108 Index N ndcomirror attribute 36 nmirror attribute 36 O off-host backup of cluster file systems using point-in-time copy solutions 53 online database backup using point-in-time copy solutions 41 Storage Rollback implementing using Storage Checkpoints 79 using VxDBA 81 Symmetrix 16 T third-mirror snapshots 14 TimeFinder 16 P V Persistent FastResync 14 plexes moving 31 point-in-time copy solutions applications 10 for decision support 61 for off-host cluster file system backup 53 for online database