1 samu 简介

本文档介绍了 Oracle HSM samu 操作员实用程序,该实用程序是一个菜单驱动型命令行用户界面,可大幅简化配置和管理任务。通过 samu,可以监视 Oracle HSM 设备和文件系统活动,控制对设备和文件系统的访问以及调整正在运行的文件系统。

samu 实用程序在某些方面类似于 UNIX vi 编辑器。您可以使用类似的控制键序选择显示、设置显示选项、在显示内部和之间导航、输入命令、刷新显示以及退出实用程序。每个显示窗口的最后一行显示错误消息。显示会自动刷新,除非出现错误,此时显示会停止,直至操作人员采取进一步的操作。如果需要,可以提取显示窗口的快照供以后参考。

本简介的其余部分介绍了使用 samu前提条件以及一些常见任务。后续章节对可用命令进行了详细说明。

先决条件

samu 操作员实用程序需要一个至少宽可显示 80 个字符高可容纳 24 行的显示终端。

vi 编辑器相似,samu 基于 UNIX curses(3CURSES) 库。如果调用 samu 时出现问题,请确保已对终端类型进行正确定义。

请注意,您在下面样例屏幕中看到的内容可能与您联机看到的内容不同。这些样例只是具有代表性,并非任何给定安装的具体表现形式。实际显示内容取决于您的终端特性以及您的文件系统配置。许多 samu 屏幕均与存储和归档管理相关,例如,如果使用 QFS 文件系统但不进行归档,将不会显示这些屏幕。

常见任务

以下几节介绍如何启动和停止 samu、如何与此实用程序进行交互操作、如何访问帮助窗口、如何查看操作员显示屏幕以及如何启动驱动器。

启动 samu

您可以使用 samu 操作员实用程序的默认值来启动该实用程序,也可以指定显示选项和/或命令选项:

  • 要使用默认显示选项启动操作员实用程序,请在系统命令提示符处输入 samu 命令:

    root@solaris:~# samu
    

    samu 界面将启动并显示默认初始的帮助屏幕:

    Help information           page 1/15   samu  version time date
    
    Display control commands:
    Displays:
     
        a  Archiver status                x  Migration status
        c  Device configuration           y  Migration vsn list
        d  Daemon trace controls          C  Memory
        f  File systems                   D  Disk volume dictionary
        g  Shared clients                 F  Optical  disk label
        h  Help information               I  Inode
        l  Usage information              J  Preview  shared memory
        m  Mass storage status            K  Kernel statistics
        n  Staging  status                L  Shared memory tables
        o  Optical  disk status           M  Shared memory
        p  Removable media load requests  N  File system parameters
        r  Removable media                P  Active Services
        s  Device status                  R  SAM-Remote
        t  Tape drive status              S  Sector data
        u  Staging  queue                 T  SCSI sense data
        v  Robot catalog                  U  Device table
        w  Pending  stage queue
        
        more (ctrl-f)                              samu on host
    
  • 要启动带有指定显示屏幕的操作员实用程序,请同时输入 samu 命令、-d 开关和命令名称:

    # samu -d commandname
    

    samu 界面将启动并显示指定的显示屏幕。例如,要启动带有配置屏幕的 samu,您应输入以下命令:

    # samu -d c
    

    该实用程序将启动并显示设备配置屏幕:

    Device configuration:               samu               version time date
     
    ty  eq  state   device_name                             fs  family_set
    sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100 libraryA
    ti  101 on      /dev/rmt/0cbn                           100 libraryA
    ti  102 on      /dev/rmt/1cbn                           100 libraryA
    ti  103 on      /dev/rmt/2cbn                           100 libraryA
    hy  104 on      historian                               104
    
  • 要启动操作员实用程序并更改默认显示屏幕刷新间隔,请同时输入 samu 命令、-r 开关和间隔长度(以秒为单位):

    # samu -r seconds
    
  • 要启动操作员实用程序并立即运行指定的命令,请同时输入 samu 命令、-c 开关和命令名称:

    # samu -c commandname
    
  • 要启动操作员实用程序并从包含每行一个命令的文件立即运行一系列命令,请同时输入 samu 命令、-f 开关和命令文件名:

    # samu -c filename
    

停止 samu

要退出 samu,请输入 :qq

Device configuration:               samu               version time date
 
ty  eq  state   device_name                             fs  family_set
sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100 libraryA
ti  101 on      /dev/rmt/0cbn                           100 libraryA
ti  102 on      /dev/rmt/1cbn                           100 libraryA
ti  103 on      /dev/rmt/2cbn                           100 libraryA
hy  104 on      historian                               104

q

samu 操作员实用程序会退出并返回至命令 shell。

显示屏幕

要显示某个特定 samu 屏幕,请执行如下操作。

  1. 如果不知道与所需屏幕相关的显示控制命令,请输入 h 调用帮助屏幕。在显示的列表中查找所需的命令。

  2. 输入与所需屏幕相关的显示控制命令。

    例如,要显示库目录并列出机械装置磁带库中磁带的卷序列号 (volume serial number, VSN),请输入 v

    Device configuration:               samu                version time date
     
    ty   eq state   device_name                             fs  family_set
    sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100 libraryA
    ti  101 on      /dev/rmt/0cbn                           100 libraryA
    ti  102 on      /dev/rmt/1cbn                           100 libraryA
    ti  103 on      /dev/rmt/2cbn                           100 libraryA
    hy  104 on      historian                               104
    
    v
    

    该实用程序将显示 Robot VSN catalog

    Robot VSN catalog by slot : eq 900  samu                version time date
                                                        count 32
    slot       access time  count  use flags         ty vsn
       0   2013/05/01 13:36     2  86% -il---b-----  li S00001
       1   2013/05/03 14:14     0  98% -il---b-----  li S00002
       2   2013/05/03 14:17     0  86% -il---b-----  li S00003
       3   2013/05/03 14:20     0  95% -il---b-----  li S00004
       4   none                 0   0% -il-o-b-----  li S00005 ...
    
  3. 如果显示内容比可用屏幕区域长,则该实用程序会将信息分页并在屏幕底部附近显示提示 more。要在页面之间进行导航,按 Ctrl-F (ˆf) 组合键可向前移至下一页,按 Ctrl-B (ˆb) 组合键可向后移至上一页。

输入 samu 命令

按照以下步骤从显示屏幕输入命令:

  1. 在任意 samu 屏幕中,输入一个 :(冒号)。

  2. 显示 command: 提示符时,输入 samu 命令。

    Device configuration:               samu                version time date
     
    ty   eq state   device_name                             fs   family_set
    sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100  libraryA
    ti  101 on      /dev/rmt/0cbn                           100  libraryA
    ti  102 on      /dev/rmt/1cbn                           100  libraryA
    ti  103 down    /dev/rmt/2cbn                           100  libraryA
    hy  104 on      historian                               104
    :
    command:q
    

运行 Shell 命令并返回

按照以下步骤从 samu 运行操作系统 Shell 命令:

  1. 在任意 samu 屏幕中,输入一个 :(冒号)。

  2. 显示 command: 提示符时,输入 !(感叹号),后跟 shell 命令。

    Device configuration:             samu                version time date
     
    ty   eq state   device_name                             fs   family_set
    sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100  libraryA
    ti  101 on      /dev/rmt/0cbn                           100  libraryA
    ti  102 on      /dev/rmt/1cbn                           100  libraryA
    ti  103 down    /dev/rmt/2cbn                           100  libraryA
    hy  104 on      historian                               104
    :
    command:!ls
    cores          faults         log            reports        sendtrap.log   tmpfiles
    Press Return to continue
    
  3. 准备返回到 samu 界面时,按回车键。

将驱动器状态从 down 更改为 on

  1. 打开一个其中显示驱动器状态和自动化库设备状态的 samu 显示屏幕。输入 cmorst

  2. 在该屏幕的 eq 字段中,记录状态为 down 的设备的设备序号。

    Device configuration:               samu                version time date
     
    
    ty  eq  state   device_name                             fs   family_set
    sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100  libraryA
    ti  101 on      /dev/rmt/0cbn                           100  libraryA
    ti  102 on      /dev/rmt/1cbn                           100  libraryA
    ti  103 down    /dev/rmt/2cbn                           100  libraryA
    hy  104 on      historian                               104
    
  3. 停止所有设备活动。输入命令字符 :,并在命令提示符显示后,输入 off 命令以及状态为 down 的设备的设备序号:

    Device configuration:             samu                version time date
     
    ty   eq state   device_name                             fs   family_set
    sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100  libraryA
    ti  101 on      /dev/rmt/0cbn                           100  libraryA
    ti  102 on      /dev/rmt/1cbn                           100  libraryA
    ti  103 down    /dev/rmt/2cbn                           100  libraryA
    hy  104 on      historian                               104
    :
    command:off 103
    
  4. 输入命令字符 :,并在命令提示符显示后,输入 on 命令以及状态为 off 的设备的设备序号:

    例如:

    Device configuration:             samu                version time date
     
    ty   eq state   device_name                             fs   family_set
    sk  100 on      /etc/opt/SUNWsamfs/libraryA_T10K_parms  100  libraryA
    ti  101 on      /dev/rmt/0cbn                           100  libraryA
    ti  102 on      /dev/rmt/1cbn                           100  libraryA
    ti  103 off     /dev/rmt/2cbn                           100  libraryA
    hy  104 on      historian                               104
    :
    command:on 103
    

获取帮助

通过输入 :hh 可从任何 samu 显示屏幕转至帮助页面。