3 Restoring the Oracle HSM Configuration

This chapter outlines the process of recovering the Oracle Hierarchical Storage Manager and StorageTek QFS Software and file-system configuration in the event that it is lost or corrupted, either in part or in its entirety. If the server host fails, the Oracle HSM software and file-system configurations may be lost, leaving file system data and metadata intact but inaccessible until the configuration information is restored. Success in this situation depends on your ability to salvage information from any files and directories that remain and on the thoroughness of your disaster preparations:

Restoring the Configuration from Backup Copies and/or SAMreports

If you followed the procedures recommended in the Oracle Hierarchical Storage Manager and StorageTek QFS Installation and Configuration Guide, you can recover Oracle HSM software and file-system configurations using the procedure below.

Restore the Configuration from Backup Files or SAMreports

  1. If you are restoring the configuration following a server host failure, resolve hardware issues, re-install operating systems, and re-install software as needed.

  2. If a current backup copy of the root file system exists, restore the root file system and stop here.

  3. Otherwise, log in to the file-system server host as root.

    root@solaris:~# 
    
  4. Mount any required file systems. Mount file systems that store backup Oracle HSM configuration files and any file systems that hold disk-archive copies of data files.

    In the example, we have been maintaining copies of the Oracle HSM server's Solaris configuration files in the subdirectory sam_config on the independent file system zfs1. So we create a mount point. We mount zfs1. We restore the vfstab file from the most recent copy in the zfs1 file system. We create the needed mount points. Then we mount the file systems:

    root@solaris:~# cp /etc/vfstab /etc/vfstab.back
    root@solaris:~# mkdir /zfs1
    root@solaris:~# mount -F zfs /net/remote.example.com/zfs1/ /zfs1 
    root@solaris:~# cp /zfs1/sam_config/20140127/etc/vfstab /etc/vfstab
    root@solaris:~# mkdir /diskvols
    root@solaris:~# mkdir /diskvols/DISKVOL1
    root@solaris:~# mkdir /diskvols/DISKVOL2
    ...
    root@solaris:~# mount /diskvols/DISKVOL1
    root@solaris:~# mount /diskvols/DISKVOL2
    ...
    root@solaris:~# 
    
  5. If backup copies of the Oracle HSM configuration files are available, locate the most recent copies that are dated prior to the loss of the configuration.

    In the example, we have been maintaining copies of the Oracle HSM configuration files in the subdirectory sam_config, on the independent file system /zfs1. So the latest files are easy to find:

    root@solaris:~# ls /zfs1/sam_config/20140127/etc/opt/SUNWsamfs/
    archiver.cmd     defaults.conf    mcf              recycler.cmd     stager.cmd
    cfg_backups      diskvols.conf    mgmt_sched.conf  releaser.cmd     startup
    csn              inquiry.conf     notify.cmd       scripts          verifyd.cmd
    root@solaris:~# ls /zfs1/sam_config/20140127/etc/opt/SUNWsamfs/scripts
    archiver.sh    log_rotate.sh  nrecycler.sh   recycler.sh    save_core.sh   sendtrap       ssi.sh
    root@solaris:~# ls /zfs1/sam_config/explorer/
    server1.20140430.1659MST.tar.gz   server1.20140114.0905MST.tar.gz
    server1.20110714.1000MST.tar.gz
    
  6. If SAMreports were generated before the loss of the Oracle HSM configuration, locate the most recent.

  7. If any QFS file systems are currently mounted, unmount them.

  8. For each missing configuration file, copy an available backup file to the required location on the server that you are restoring.

    In the example, we restore all of the Oracle HSM configuration files and scripts from backup copies:

    root@solaris:~# cp /zfs1/sam_config/20140127/etc/opt/SUNWsamfs/* /etc/opt/SUNWsamfs/
    root@solaris:~# cp /zfs1/sam_config/20140127/etc/opt/SUNWsamfs/scripts/* /etc/opt/SUNWsamfs/scripts/
    root@solaris:~# cp /zfs1/sam_config/20140127/etc/opt/SUNWsamfs/startup/* /etc/opt/SUNWsamfs/startup/
    root@solaris:~# cp /zfs1/sam_config/20140127/etc/opt/SUNWsamfs/cfg_backups/* /etc/opt/SUNWsamfs/cfg_backups/
    root@solaris:~# cp /zfs1/sam_config/20140127/etc/opt/SUNWsamfs/csn/* /etc/opt/SUNWsamfs/csn/
    
  9. If backup copies of the configuration files are not available, recreate them using the information contained in the most recent available SAMreport. Copy the content from the report, paste it into a text editor, and save it to the file and path indicated in the report.

    SAMreport files contain the full text of the Oracle HSM configuration files as they were at the time the report was created. They also list the directory where the file was located.

    In the example, we search the file server1.20140127.SAMreport for Oracle HSM master configuration file (mcf) information. We pipe the output of the cat command to the grep command and the regular-expression pattern \/etc\/opt\/SUNWsamfs\/mcf:

    root@solaris:~# cat /zfs1/sam_config/explorer/server1.20140127.SAMreport | grep \/etc\/opt\/SUNWsamfs\/mcf
    ...
    ------------------ /etc/opt/SUNWsamfs/mcf -------------------
    server1# /bin/ls -l /etc/opt/SUNWsamfs/mcf
    -rw-r--r--   1 root     root        1789 Feb  4 09:22 /etc/opt/SUNWsamfs/mcf
     
    # Equipment           Equipment  Equipment  Family     Device   Additional
    # Identifier          Ordinal    Type       Set        State    Parameters
    #-------------------  ---------  ---------  ---------  ------   -----------
    hsmfs1               100        ms         hsmfs1    on
      /dev/dsk/c1t3d0s3    101        md         hsmfs1    on
      /dev/dsk/c1t4d0s5    102        md         hsmfs1    on 
    root@solaris:~# 
    

    We copy the output of the grep command, paste the output into the vi editor, and save the file to the correct name and location:

    root@solaris:~# vi /etc/opt/SUNWsamfs/mcf
    # Equipment           Equipment  Equipment  Family     Device   Additional
    # Identifier          Ordinal    Type       Set        State    Parameters
    #-------------------  ---------  ---------  ---------  ------   -----------
    hsmfs1               100        ms         hsmfs1    on
     /dev/dsk/c1t3d0s3     101        md         hsmfs1    on
     /dev/dsk/c1t4d0s5     102        md         hsmfs1    on 
    :wq
    root@solaris:~# 
    
  10. Restore the library catalogs from the dump-file data that you saved during the procedure "Save the Oracle HSM Configuration". For each catalog, use the command build_cat catalog-dump-file catalog-file, where:

    • catalog-dump-file is the path and name of the file that you created with the dump_cat command.

    • catalog-file is the path and name of the restored catalog file.

    In the example, we rebuild the catalog for lib1 using the data in the file /zfs1/sam_config/20140513/catalogs/lib1cat.dump:

    root@solaris:~# build_cat /zfs1/sam_config/20140513/catalogs/lib1cat.dump \ /var/opt/SUNWsamfs/catalog/lib1cat  
    
  11. If you are recovering a system following hardware failure, go to Chapter 4, "Recovering File Systems".

  12. If you are replacing one or more configuration files that were inadvertently deleted or incorrectly edited and if no hardware or file system changes have occurred, check the configuration files for errors by running the sam-fsd command.

    The sam-fsd is an initialization command that reads Oracle HSM configuration files. It will stop if it encounters an error:

    root@solaris:~# sam-fsd
    
  13. If the sam-fsd command finds an error in the mcf file, edit the file to correct the error and recheck as described in the preceding step.

    In the example below, sam-fsd reports an unspecified problem with a device:

    root@solaris:~# sam-fsd
    Problem in mcf file /etc/opt/SUNWsamfs/mcf for filesystem hsmfs1
    sam-fsd: Problem with file system devices.
    root@solaris:~# 
    
  14. If the sam-fsd command runs without error, the configuration files are correct. Proceed to the next step.

    The example is a partial listing of error-free output:

    root@solaris:~# sam-fsd
    Trace file controls:
    sam-amld      /var/opt/SUNWsamfs/trace/sam-amld
                  cust err fatal ipc misc proc date
                  size    10M  age 0
    sam-archiverd /var/opt/SUNWsamfs/trace/sam-archiverd
                  cust err fatal ipc misc proc date module
                  size    10M  age 0
    sam-catserverd /var/opt/SUNWsamfs/trace/sam-catserverd
                  cust err fatal ipc misc proc date module
                  size    10M  age 0
    ...
    Would start sam-archiverd()
    Would start sam-stagealld()
    Would start sam-stagerd()
    Would start sam-amld()
    root@solaris:~# 
    
  15. Tell the Oracle HSM software to read the mcf file and reconfigure itself accordingly. Use the command samd config.

    root@solaris:~# samd config
    Configuring SAM-FS
    root@solaris:~# 
    
  16. If the samd config command reports errors in the mcf file, correct them. Then repeat the preceding step.

  17. Remount the affected file systems.

  18. Monitor file system operations.

Restoring the Configuration Without Backup Information

If you lack backup files or SAMreports, reconstruct the configuration using whatever information is available. Then proceed as for a new configuration. See the Oracle Hierarchical Storage Manager and StorageTek QFS Installation and Configuration Guide for instructions.