Managing Backups and Oracle Backup Modes

Using the ATHMtfbkp 1.8 Package and EMC TimeFinder

 

By: Adam Lyons (system architecture group) 11/21/2001

 

 

In order to get reliable backups with TimeFinder, Oracle must be put into hot-backup mode during any filesystem snap-shots and back end I/O operations. This document discusses how to consistently manage oracle in a hot-backup state with the use of two programs designed for this purpose, “ora-backup” and “bcv-backup”. XYZCorp’s backup strategy includes EMC TimeFinder, SymCLI and perl code. There are several other utilities included in the ATHMtfbkp package which are covered in this document as well.

 

 

 

 

 

 

 

 

 

 

 

Associated Subject Matter Experts

Adam Lyons, alyons@notnull.org

 

Document Creator/Maintainer

Adam Lyons, alyons@notnull.org

 

Revision History

                                    11-21-01: Inception—Adam Lyons

 

 

 

Version 1.1

 

Table Of Contents

About the software: 4

How to install: 4

How to implement: 5

How to troubleshoot: 5

How to disable backups: 5

How to enable backups: 5

How to restore from a backup: 6

Step-by-Step Procedures. 6

Verification Steps. 6

Back-out Steps. 6

What ora-backup does: 7

Command line options: 7

What bcv-backup does: 8

How to run bcv-backup: 9

How to run ora-backup: 13

Other Tools In ATHMtfbkp: 14

bcv-map. 14

bcv-sum.. 14

mss-jrnl 14

Appendix. 15

Sample Cron Entries: 15

Mss architecture. 15

CAPS architecture. 15

Usage for ora-backup. 16

Usage for bcv-backup. 17

Source. 18

Bcv-backup. 18

ora-backup. 33

 

 


About the software:

 

The backup management software for oracle and time finder was written in perl, and has several dependencies on EMC tools. The ora-backup software is standalone and can manage any oracle implementation at XYZCorp. The Timefinder installation and configuration is performed by the rapid deployment process and the specifics are yet to be documented*.

 

How to install:

 

To install the ATHMtfbkp.pkg package, you must first disable any crontab entries that bcv-backup might have. Don’t disable the software by touching the “disable” file because the directory structure might change as you upgrade the software. If the software is already installed, un-install it like so:

 

# pkgrm ATHMtfbkp      

And answer “yes” to all prompts.

 

Use “pkgadd” to install the new backup software like so:

 

# cd /<where the package is>

# pkgadd –d ./ATHMtfbkp.pkg ATHMtfbkp      

 

ATHMtfbkp should install to /opt/ATHMtfbkp, and contain the following files in the bin directory:

 

root@mss4:/opt/ATHMtfbkp/bin>ls -la

total 186

drwxr-xr-x   2 root     other        512 Nov 20 23:16 .

drwxr-xr-x   7 root     other        512 Nov 20 23:16 ..

-rwxr-xr-x   1 root     dba        28464 Nov 17 00:06 bcv-backup

-rwxr-xr-x   1 root     dba         3507 Oct  5 00:10 bcv-check

-rwxr-xr-x   1 root     dba         3005 Oct  5 00:10 bcv-map

-rwxr-xr-x   1 root     dba         2720 Oct  5 00:10 bcv-restore

-rwxr-xr-x   1 root     dba         3620 Oct  5 00:10 bcv-sum

-rwxr-xr-x   1 root     dba         1289 Oct  5 00:10 growth-rate

-rwxr-xr-x   1 root     dba          216 Jun 21 20:05 list_backup_dg.sh

-rwxr-xr-x   1 root     dba          102 Oct 24 22:54 mss-arch

-rwxr-xr-x   1 root     dba        13030 Nov  6 00:02 mss-backup

-rwxr-xr-x   1 root     dba         4173 Oct 31 23:23 mss-jrnl

-rwxr-xr-x   1 root     dba        12554 Nov 20 22:59 ora-backup

-rwxr-xr-x   1 root     dba         6263 Sep 29 01:27 tf_main.sh

-rwxr-xr-x   1 root     dba         3242 Oct 25 22:22 tf_oracle_begin_backup.sh

-rwxr-xr-x   1 root     dba         2978 Oct 25 21:52 tf_oracle_end_backup.sh

 

The package information should be the following (or a more recent version):

 

root@mss4:/opt/ATHMtfbkp/bin>pkginfo -l ATHMtfbkp

   PKGINST:  ATHMtfbkp

      NAME:  EMC Timefinder Backup Utilities packaged for ATHM

  CATEGORY:  athmemc

      ARCH:  athm_sun

   VERSION:  1.8

   BASEDIR:  /opt

    PSTAMP:  20011120

  INSTDATE:  Nov 20 2001 23:16

    STATUS:  completely installed

     FILES:     20 installed pathnames

                 6 directories

                14 executables

                 4 setuid/setgid executables

               174 blocks used (approx)

 

 

 

 

How to implement:

 

For the most platforms, it is recommended to run the software from cron. A sample cron entry for each platform can be found in the appendix. The software is distributed in a Solaris package format and is accessible from the jumpstart servers or CVS. It is also recommended that when upgrading the package on a server, backups are disabled (remove cron entry) and the previous package is removed. You must have oracle credentials sufficient to put Oracle in and out of hot backup modes. You must have root privileges to install and configure the backup package. Once the software is installed, verify log file permissions.

 

root@mss4:/opt/ATHMtfbkp/bin>ls -al /var/adm/*backup*.log

-rw-r--r--   1 root     other     288693 Nov 20 23:45 /var/adm/bcv-backup.log

-rw-r--r--   1 oracle   dba        11638 Nov 20 23:45 /var/adm/ora-backup.log

 

It is important that the ora-backup log-file is owned (write-able) by oracle, and that all log files are readable by anyone. If the installation is a first time installation for the platform you are implementing, you might have to touch the ora-backup.log. This can be done with the following commands:

 

root@mss4:/opt/ATHMtfbkp/bin>touch /var/adm/ora-backup.log

root@mss4:/opt/ATHMtfbkp/bin>chown oracle:dba /var/adm/ora-backup.log

 

How to troubleshoot:

 

There are several log files generated with each execution of bcv-backup and ora-backup. The bcv-backup script logs to /var/adm/bcv-backup.log and the ora-backup log is /var/adm/ora-backup. The ora-backup log should be write-able by the user that runs the process, like oracle. Other logs can be generated by re-directing the STDOUT of the cronjob to a file that is overwritten each time it is run. This implementation benefits regular users because they can watch and view the output of each process. Each logfile has information about every procedural task and shell command they execute. Both programs capture return codes from any forked processes, and reports on their output and return status. There should be sufficient information in the log files to quickly troubleshoot any problems. If oracle is core-dumping with ORA-7445, the username and password being used is most likely incorrect, or another process is using sql-plus with incorrect connection information. Be sure to verify that ora-backup runs properly buy running it manually as the user oracle. If you see the following when running it, make sure the root user creates the right logfiles for you.

 

oracle_mss3.pod1.lab1.sfba.home.com_IMM3 > /opt/ATHMtfbkp/bin/ora-backup

Creating log file /var/adm/ora-backup.log.

touch: /var/adm/ora-backup.log cannot create

chown: /var/adm/ora-backup.log: No such file or directory

The permission for the log file(/var/adm/ora-backup.log) are not valid for this user.

 

 

How to disable backups:

 

Either disable the cron job by commenting out the line with a ‘#’ or:

root@mss4:/opt/ATHMtfbkp/bin>touch /opt/ATHMtfbkp/status/disable

 

How to enable backups:

 

Either enable the cron job by removing then comment from the line or:

root@mss4:/opt/ATHMtfbkp/bin>rm /opt/ATHMtfbkp/status/disable

 

 


How to restore from a backup:

 

This procedure should only be performed by a qualified operator and it is recommended that management be fully aware of this action.

 

Step-by-Step Procedures

 

1)      Log into the server that has imported the mailstore service group you wish to disable backups for. You should specify the service group hostname (ie, imm3.pod1.rwc1.sfba.home.com) as the host to log into.

2)      Export the service group you wish to restore is exported using the hafo failover utility. See the hafo operational documentation for this procedure.

*** WARNING *** You must export all attached devices you wish to restore prior to restoration. If not, you WILL LOOSE your bcv data.

3)      For whichever service group you wish to restore (imm[1-4]), execute the following command at the root shell prompt (substituting the appropriate service group name for imm1):

a.      symmir –g imm1 restore

4)      Wait for the command to complete.

5)      Determine when the restore process is complete by executing “symmir –g imm1 query” and viewing the state column. When all the devices are in the “restored” state, complete step 6.

6)      Import only disk services for the service group by using hafo with the –d option.

7)      Perform media recovery for Oracle. See operational documentation for Oracle for this procedure.

8)      Perform MSS recovery for Intermail. See operational documentation for Intermail for this procedure.

9)      Determine when the restore process is complete by executing “symmir –g imm1 query” and viewing the state column. When all the devices are in the “restored” state, complete step 10.

10)   When the restore process is complete, execute a “symmir –g imm1 –instant split”.

 

Verification Steps

1)      From a root shell prompt, execute the following command (substituting the appropriate service group name for imm1):

a.      symld –g imm1 list

2)      Under the heading BCV Devices associated with this dg:, ensure that all devices are in the Split status.

 

Back-out Steps

There is no method to backout from a restoral process.


What ora-backup does:

 

The ora-backup portion of the process is executed controlled by using the “-pre” and “-post” arguments in bcv-backup. Once ora-backup is executed in the start mode, it will place every table on the system into hot backup mode, unless you specify a specific SID to manipulate. Once the “post” phase of bcv-backup is reached, ora-backup will end the hot backup mode on each tablespace configured, and if you use the “-rmarch” argument with ora-backup, you can clean out old, useless archives. The archive removal is non-volatile because the last needed archive is determined with a series of sql commands. Ora-backup can also transfer archives to a remote host for additional levels of data retention.

          Command line options:

                        It is recommended that ora-backup be run as the oracle user.

 

                        -f <filename>                provide a filename with full path that contains connection credential information for sqlplus

                                                                The file’s format is like so:

                                                                                ORACLE_USER=<username>

                                                                                ORACLE_PASSWORD=<password>

 

                                -u <username>                As an alternate to using the –f flag, you can specify the username on the CLI. If you provide a –f flag however

                                                                it will override the command line option.

-p <password>                This is the password option you must provide if you provide a username. The –f flag will override this value as well.

-S <SID>                You can also provide a oracle SID on the CLI, if you system is running multiple instances you will need to do this.

-mode (start|end)                This option is required. This determines if oracle will go into hot-backup mode or exit backup mode.

-rmarch                This option will use sqlplus to determine the last needed oracle archive files, and delete archives of no use.

-scp user@host:/path

                                This option is just like the scp command line for ssh. You must have keys installed though to automate the process. It will copy over archives that are still needed, and should be run separately from the backup modes.

 

 


What bcv-backup does:

 

The bcv-backup program is the main controller of backup operations with TimeFinder implementations. The usage is extensive and the program is quite robust. The simplest way to run this is just “bcv-backup inc –sg all”. This will simply backup and split every device group you have configured on the system in incremental mode. With bcv-backup, you can:

 

·          Send mail on major steps the process completes.

·          Send mail on any errors.

·          Split multiple device groups at the same time, or when they are all complete.

·          Execute multiple pre and post spit operation scripts and or commands.

·          Perform backup operations on a per Veritas DiskGroup basis.

·          Perform backup operations on a per Veritas Volume basis.

·          Perform backup operations on a per symmetrix device group basis, or globally.

·          Report track copy rates.

·          Run in incremental or full backup modes.

·          Run the establishments in Sym Optimized modes.

·          Handle multiple BVC and Sym Device naming conventions (CAPS/mss).

·          Summarize possible operations on any device group.

·          Handle device groups that are in inconsistent states (some devices sync’d, some split).

·          Timeout any operations (other than syncing) that take either more than 10 minutes to complete, or timeout values can be specified on the command line

·          View the estimated time operations will complete for what device group or what device

(also reports overall accuracy at the completion of the process)

 

 

As XYZCorp’s TimeFinder implementation grows, so will the feature base of bcv-backup. Expected future features are; SRDF management, Volumelogix mangement, FibreZone backups and Zone management and a concrete distributed state model for handling many BCV operations for many platforms from a single host.

 

Proceduraly, bcv-backup will check the state of all devices in the symmetrix device group, and put each device in a split state. Bcv-backup splits any synchronized devices if there are some that are synchronized already. If there is a sync in progress, bcv-backup will wait until the sync is complete, and then split the BCV device from the standard, and sync the entire device group at the same time. This helps the consistency of the device group.  As the device group is syncing, bcv-backup will analyze the track copy rates and approximate when the entire sync process will complete. Once all devices are sync’d, bcv-backup will execute the –pre arguments, in the order in which you provided the arguments on the CLI, and report any errors if necessary. Once the –pre scripts are all complete, a split operation is initiated for the device group. When this is complete, the –post arguments are executed in the same fashion as the –pre arguments. If you use the –mail_on_stat argument, and mailx is functional for mail delivery on the host, you will receive email for the following things:

 

·         Establishing a device group

·         Executing a –pre command

·         Executing a –post command

·         Splitting a device group

·         Completion

 

If you op to use the –mail_on_err arguemt, then bcv-backup will send mail on any errors it encounters.

 

Warning:

Running bcv-backup will void the previous snapshot of the system. This volatility is not avoidable unless an SRDF implementation is in place. Once bcv-backup begins a sync process, no BCV devices will be available for restoral until bcv-backup is complete and all devices are in a split state.


How to run bcv-backup:

 

Bcv-backup can be executed in a couple of different ways, either by crontab or interactively from the shell. The appendix has output of bcv-backup in action without and with the use of ora-backup.

 

In a nutshell, this is the simplest way to perform a backup. On the MSS architecture, you MUST use the

-dev_names argument for device mappings to work properly.

 

root@mss3:/opt/ATHMtfbkp/bin>./bcv-backup inc -g all -dev_names

Mapping BCV Devices to Symmetrix Volumes...

Discovering Symmetrix Device Groups...

Initiating backup process: ./bcv-backup

Veritas Diskgroup: all

Backup Level: inc

Symm Device Group(s): imm3

Mapping Veritas Disk Group(s)...

Checking what Veritas Volumes depend on which Device Groups...

There are 84 Device References that need mapping...

TimeFinder operations will be on: imm3

 

Checking BCV Device States...

Analyzing Group imm3...Device Group (imm3) can be Synchronized

Action Summary:

No Device Groups are in the Wait State.

Establishing imm3

Timing out in 600 seconds.

 

'Incremental Establish' operation execution is in progress for

device group 'imm3'. Please wait...

 

'Incremental Establish' operation successfully initiated for device group

'imm3'.

 

Timer cleared.

 

Checking BCV Device States...

Analyzing Group imm3...Some devices are still Syncing...

Waiting for 14 Devices(45 tracks remaining) to finish operations.

** Estimated time for imm3 to complete:

Action Summary:

Waiting for imm3

.

.

Checking BCV Device States...

Analyzing Group imm3...Device Group (imm3) can be Split

Action Summary:

No Device Groups are in the Wait State.

About to split imm3...........Device Group is Consistant...Splitting imm3

Timing out in 600 seconds.

 

'Split' operation execution is in progress for

device group 'imm3'. Please wait...

 

'Split' operation successfully executed for device group

'imm3'.

 

Timer cleared.

Wed Nov 21 20:42:56 2001: 1 completed, 1 Group Total - Backup Operations Complete.

./bcv-backup: 355 seconds of runtime.

Average deviation of seconds: 3.61461469550283

 

Keep in mind though, it is VERY important that if you plan to restore oracle from a backup, it must have been put into hot-backup mode at the time of the split operation. The next output shows the full usage of bcv-backup, the way it was meant to be implemented in production with mail notification and several –pre and –post arguments. This example demonstrates how oracle in placed and removed from hot-backup mode, how several pre/post scripts can be used to manage Intermail journals and oracle archives and how mail is used to report on status.

 

root@mss4:/>opt/ATHMtfbkp/bin/bcv-backup inc -g all -dev_names -pre "su - oracle –c\ '/opt/ATHMtfbkp/bin/ora-backup -u XXX -p XXX -mode start'" -post "su - oracle –c\ '/opt/ATHMtfbkp/bin/ora-backup -u XXX -p XXX -mode end -rmarch'" –post\ "/opt/ATHMtfbkp/bin/mss-jrnl" -mail_on_stat alyons@excitehome.net -mail_on_err\ alyons@excitehome.net

 

Mapping BCV Devices to Symmetrix Volumes...

Discovering Symmetrix Device Groups...

Initiating backup process: opt/ATHMtfbkp/bin/bcv-backup

Veritas Diskgroup: all

Backup Level: inc

Symm Device Group(s): imm4

Mapping Veritas Disk Group(s)...

Checking what Veritas Volumes depend on which Device Groups...

There are 84 Device References that need mapping...

TimeFinder operations will be on: imm4

 

Checking BCV Device States...

Analyzing Group imm4...Device Group (imm4) can be Synchronized

Action Summary:

No Device Groups are in the Wait State.

Establishing imm4

Sending mail to alyons@excitehome.net about symmir -g imm4  establish -noprompt....done.

Timing out in 600 seconds.

 

'Incremental Establish' operation execution is in progress for

device group 'imm4'. Please wait...

 

'Incremental Establish' operation successfully initiated for device group

'imm4'.

 

Timer cleared.

Sending mail to alyons@excitehome.net about symmir -g imm4  establish -noprompt....done.

 

Checking BCV Device States...

Analyzing Group imm4...Waiting for 25 Devices(266513 tracks remaining) to finish operations.

** Estimated time for imm4 to complete:

Action Summary:

Waiting for imm4

 

Checking BCV Device States...

Analyzing Group imm4...Waiting for 25 Devices(251282 tracks remaining) to finish operations.

** Estimated time for imm4 to complete: Wed Nov 21 20:36:28 2001 Tracks Per Second: 951.9375

Action Summary:

Waiting for imm4

.

.

Checking BCV Device States...

Analyzing Group imm4...Some devices are still Syncing...

Waiting for 3 Devices(83 tracks remaining) to finish operations.

** Estimated time for imm4 to complete: Wed Nov 21 20:41:46 2001 Tracks Per Second: 35.5625

Action Summary:

Waiting for imm4

 

Checking BCV Device States...

Analyzing Group imm4...Some devices are still Syncing...

Waiting for 1 Devices(0 tracks remaining) to finish operations.

** Estimated time for imm4 to complete: Wed Nov 21 20:42:00 2001 Tracks Per Second: 5.1875

Action Summary:

Waiting for imm4

 

Checking BCV Device States...

Analyzing Group imm4...Device Group (imm4) can be Split

Action Summary:

No Device Groups are in the Wait State.

About to split imm4...........Device Group is Consistant...Executing pre script: su - oracle -c '/opt/ATHMtfbkp/bin/ora-backup -u XXX -p XXX -mode start'

Timing out in 600 seconds.

Sun Microsystems Inc.   SunOS 5.6       Generic August 1997

You have new mail.

Putting oracle into Hot Backup mode now...

Operations on tablespace POM01 begin complete.

Operations on tablespace POM02 begin complete.

Operations on tablespace POM03 begin complete.

Operations on tablespace POMFM begin complete.

Operations on tablespace POMMG begin complete.

Operations on tablespace POX01 begin complete.

Operations on tablespace POX02 begin complete.

Operations on tablespace POX03 begin complete.

Operations on tablespace POXFM begin complete.

Operations on tablespace POXFMPK begin complete.

Operations on tablespace POXID begin complete.

Operations on tablespace POXPK begin complete.

Operations on tablespace RBS1 begin complete.

Operations on tablespace RBS2 begin complete.

Operations on tablespace RBS3 begin complete.

Operations on tablespace RBS4 begin complete.

Operations on tablespace SYSTEM begin complete.

Operations on tablespace TEMP begin complete.

Timer cleared.

Sending mail to alyons@excitehome.net about su - oracle -c '/opt/ATHMtfbkp/bin/ora-backup -u XXX -p XXX -mode start'....done.

Splitting imm4

Sending mail to alyons@excitehome.net about symmir -g imm4 -instant split -noprompt....done.

Timing out in 600 seconds.

 

'Split' operation execution is in progress for

device group 'imm4'. Please wait...

 

'Split' operation successfully executed for device group

'imm4'.

 

Timer cleared.

Sending mail to alyons@excitehome.net about symmir -g imm4 -instant split -noprompt....done.

Executing post script: su - oracle -c '/opt/ATHMtfbkp/bin/ora-backup -u XXX -p XXX -mode end -rmarch'

Timing out in 600 seconds.

Sun Microsystems Inc.   SunOS 5.6       Generic August 1997

You have new mail.

Putting oracle OUT OF Hot Backup mode now...

Operations on tablespace POM01 end complete.

Operations on tablespace POM02 end complete.

Operations on tablespace POM03 end complete.

Operations on tablespace POMFM end complete.

Operations on tablespace POMMG end complete.

Operations on tablespace POX01 end complete.

Operations on tablespace POX02 end complete.

Operations on tablespace POX03 end complete.

Operations on tablespace POXFM end complete.

Operations on tablespace POXFMPK end complete.

Operations on tablespace POXID end complete.

Operations on tablespace POXPK end complete.

Operations on tablespace RBS1 end complete.

Operations on tablespace RBS2 end complete.

Operations on tablespace RBS3 end complete.

Operations on tablespace RBS4 end complete.

Operations on tablespace SYSTEM end complete.

Operations on tablespace TEMP end complete.

last needed archive log is: 185

GUESS: /ora4/archive/arch*_185.log

OLD ARCHIVE: archIMM4_182.log

OLD ARCHIVE: archIMM4_183.log

OLD ARCHIVE: archIMM4_184.log

.

.

Timer cleared.

Sending mail to alyons@excitehome.net about su - oracle -c '/opt/ATHMtfbkp/bin/ora-backup -u accord -p accord -mode end -rmarch'....done.

Executing post script: /opt/ATHMtfbkp/bin/mss-jrnl

Timing out in 600 seconds.

***********imail journal file manager (ijfm v1.0, alyons@excitehome.net)***********

Retained: 20

Removed: 60

Delete: /imm4/imail/journal/jrn.20011121.000000.mss.1

.

.

Timer cleared.

Sending mail to alyons@excitehome.net about /opt/ATHMtfbkp/bin/mss-jrnl....done.

Wed Nov 21 20:42:51 2001: 1 completed, 1 Group Total - Backup Operations Complete.

opt/ATHMtfbkp/bin/bcv-backup: 788 seconds of runtime.

Average deviation of seconds: 1.64188286108875

Sending mail to alyons@excitehome.net about 1.64188286108875: 788 completed, 1 Group Total - Backup Operations Complete.....done.

 

 

It is important to note the use of –dev_names here. Since this is an MSS platform, it must be used. The default use of bcv-backup is without –dev_names. Ignore the use of –dev_names for platforms such as CAPS and IPDMS.

 


How to run ora-backup:

 

Ora-backup should be used within the bcv-backup program most of the time, unless you are using it separately to remotely copy archives at a different interval than that of bcv-backup from cron. It should also always be run a the oracle user, mainly so the environment setting are correct. There are a couple of ways to specify username and password for the sql*plus, the most secure way is to use the –f argument. In order to use a file that contains the username and password information for a connection, you must make that file readable by the user who will be running ora-backup, clearly. The file format is as follows:

 

root@mss4:/opt/ATHMtfbkp/bin>cat ora.conf

ORACLE_USER=system

ORACLE_PASSWORD=manager

 

You can use this by simply appending the full path and filename to the –f argument like:

“-f /opt/ATHMtfbkp/bin/ora.conf”

 

This will help reduce the risk of account information being in publicly readable areas, like logs.

 

There are three common ways to execute ora-backup.

·          Method to place oracle into hot-backup mode.

oracle_mss4.pod1.lab1.sfba.home.com_IMM3 > /opt/ATHMtfbkp/bin/ora-backup –f /opt/ATHMtfbkp/bin/ora.conf –mode start

 

·          Method to end hot-backup mode and remove old archives.

oracle_mss4.pod1.lab1.sfba.home.com_IMM3 > /opt/ATHMtfbkp/bin/ora-backup –f /opt/ATHMtfbkp/bin/ora.conf –mode end -rmarch

 

·          Method to copy with scp the archives to a remote site.

oracle_mss4.pod1.lab1.sfba.home.com_IMM3 > /opt/ATHMtfbkp/bin/ora-backup –f /opt/ATHMtfbkp/bin/ora.conf –scp oracle@remotehost:/orabackups/mss4.pod1

 

If ora-backup does not run properly, consult the troubleshooting section of this document before escalating through support.


Other Tools In ATHMtfbkp:

 

There are several tools included in the package, some are platform specific and are mostly for the MSS platform. The tools included for MSS are:

 

 

 

bcv-map

 

bcv-map will print out the volumes configured on the system and the BCV’s that each volume needs to use to have a backup. This tool is useful if you need to restore by hand just one device, and you want to see how the devices overlap. In other words, this tool will help you discover the dependencies on the system regarding BCV devices and volume configurations. If a volume is striped, you must restore all the devices on that volume. It is absolutely important though, that you know exactly what devices you need to restore and then deport the diskgroup and perform the restore.

 

root@mss4:/opt/ATHMtfbkp/bin>./bcv-map oraredo

Getting BCV data....done

Mapping BCV data to Physical Devices....done.

vxvm:vxprint: ERROR: Disk group oraredo: No such disk group

Volume oraredo uses Disk c1t0d25 which maps to BCV117

Volume oraredo uses Disk c1t0d26 which maps to BCV118

Volume oraredo uses Disk c1t0d27 which maps to BCV119

Volume oraredo uses Disk c1t0d28 which maps to BCV11A

Volume oraredo uses Disk c1t0d29 which maps to BCV11B

Volume oraredo uses Disk c1t0d30 which maps to BCV11C

Volume oraredo uses Disk c1t0d31 which maps to BCV11D

Volume oraredo uses Disk c1t0d32 which maps to BCV11E

 

You can use bcv-map with a diskgroup too, as opposed to just a volume. It is best to check a volume first, then grep the output of bcv-map with a diskgroup specified and lok for other volumes that use the same devices.

bcv-sum

 

        This tool will check the BCV device states in a device group and report a summary

 

root@mss4:/opt/ATHMtfbkp/bin>./bcv-sum imm4 5

Analyzing BCV states..........

Wed Nov 21 21:31:01 2001: Time Remaining for Total BCV Operation(12): 2 minutes

 

The second argument is not really documented, but allows you to specify a sampling period. In this case, 5 was used, which mean, report the summary after 5 seconds. Bcv-sum will sample only 2 times, so the report is not nearly as accurate the on-going report from bcv-backup, bust a handy guestimator.

mss-jrnl

 

This tool will remove intermail journals from the journal filesytems based on timestamps encoded in the file.

 

root@mss4:/opt/ATHMtfbkp/bin>./bcv-sum imm4 5

***********imail journal file manager (ijfm v1.0, alyons@excitehome.net)***********

Retained: 20

Removed: 1

Delete: /imm4/imail/journal/jrn.20011121.000000.mss.1

 

It will always leave the most recent journals and report on everything it does with STDOUT.


Appendix

 

 

Sample Cron Entries:

 

Mss architecture

0  0,4,8,12,16,20  * * *  [ -x /opt/ATHMtfbkp/bin/bcv-backup ] && /opt/ATHMtfbkp/bin/bcv-backup inc -g all -dev_names -pre "su - oracle -c '/opt/ATHMtfbkp/bin/ora-backup -f /opt/ATHMtfbkp/bin/ora.conf -mode start'" -post "su - oracle -c '/opt/ATHMtfbkp/bin/ora-backup -f /opt/ATHMtfbkp/bin/ora.conf -mode end -rmarch'" -post "/opt/ATHMtfbkp/bin/mss-jrnl" >/tmp/foo 2>&1

 

CAPS architecture

Not yet determined

 


Usage for ora-backup

root@server:/opt/ATHMtfbkp/bin>./ora-backup

Usage: <options>

 

-f <filename>           Use <filename> as your source of user/pass information for sqlplus

-u <username>           Oracle username with priv's to start/end backup modes

-p <password>           <username>'s password for sqlplus

-S <SID>                Oracle SID to connect to

-mode (start|end)       Put into hot backup mode or put out of that mode

-rmarch                 Use sqlplus to delete uneeded archive files

-scp <user@host:/path>  Secure Copy Oracle Archives to defined destination

         

 


Usage for bcv-backup

root@mss1:/opt/ATHMtfbkp/bin>./bcv-backup

Usage: ./bcv-backup <options>

 

Options (Required noted with '*' or '**' (you must choose at least one '**'):

 

* inc|full                               Backup Mode: incremental or full (level 0)

** -sg <sym diskgroup|all>              Symmetrix Device Group

** -g veritas diskgroup|all>               Specify devices in a veritas disk group or all dg's (default all)

-v <veritas volume>                     Specify devices in a volume (default all), This will backup entire device groups if the device configured in the volume belongs to the Device Group. This is still incomplete, but will at least backup any Sym Device Groups that have BCV's associated to Standards that are configured in a specified volume.

-pre "script"                           Execute this script before Split Operations (default none) You can use -pre multiple times, the order in which they are declared is the order in which they are executed.

-post "script"                          Execute this script after Split Operations (default none) You can use -post multiple times, the order in which they are declared is the order in which they are executed.

-opt                                    Use Sym Optimized Mode (-opt) for establishing (default off)

-st                                     Split All Device Groups at the Same Time (only useful/needed if you have multiple groups) (default off)

-sum                                    Just report the operational compatability of each group (default off)

-mail_on_err <"user@domain">            Send email if an error occurs (default off), you can declare multiple instances

-mail_on_stat <"user@domain">           Send email status for each operation (default off), you can declare multiple instances

-dump                                   Dump out the complete %config structure after each monitor cycle (like  = 1 on steriods) (default off)

-dev_names                              Use this option if the DEV devices are named from the cXtXdZ names (if you make the DEV's, like on an mss, with names like DEV1, and DEV1 maps to disk c1t0d1s2 then you need this option!) (default off)

-t <seconds>                            Timeout -pre and -post scripts to seconds, avoids infinit loops.

                                                                (default 600 seconds or 10 minutes)

Warnings/Notes:

 

To disable backups, touch /opt/ATHMtfbkp/status/disable

To re-enable backups, remove the "disable" file.

 

** It is important to note that if you use the -g option AND the -sg option, the program WILL search each group and make sure that ONLY device groups that have BCV's associated to Standards configured in the Veritas Disk Group will be operated on. It WILL NOT, however, look at any additional Device Groups if a disk is configured in a Veritas Disk Group that has it's associated BCV in a different Device Group (other than specified). IF you desire to backup the full disk group, just use the -g option with a group name, and use '-sg all' so it will span device groups.

 

** It is important to note that if your Sym Device naming is based off of disk names (like c1t0d1), you MUST use the -dev_names option, otherwise bcv-backup will die a nasty death!