在这里介绍一下WIN平台上面怎么测试带库是否可以正常的读写数据库。
WIN这个是个好东西,但是在用于服务器方案,我切不会的。
这里不介绍厂商自己提供的软件来测试带库。
WIN下面同样用两种方案:
方案一:使用mtx与tar来实现
方案二:使用robtest与nt_ttu工具
方案一:
方案一需要用到两个工具,mtx与tar,这两个工具都需要到第三方去下载。
mtx下载地址http://sourceforge.net/projects/mtx/files/Windows/
tar下载地址http://sourceforge.net/projects/guntar/?source=directory
软件安装完成后记得在PATH里面增加好环境变量。
- 1.1 查看已经配置的设备的状态
- C:\Documents and Settings\Administrator>tpconfig -l
- Device Robot Drive Robot Drive Device
- Type Num Index Type DrNum Status Comment Name Path
- robot 0 - TLD - - - - {3,0,0,0}
- drive - 0 hcart 1 UP - IBM.ULTRIUM-TD1.000 {3,0,0,1}
- drive - 1 hcart 2 UP - IBM.ULTRIUM-TD1.001 {3,0,0,2}
- 1.2 查看机械手的状态
- C:\Documents and Settings\Administrator>mtx -f 3:0:0:0 status
- Storage Changer 3:0:0:0:2 Drives, 40 Slots ( 20 Import/Export )
- Data Transfer Element 0:Empty
- Data Transfer Element 1:Full (Storage Element 2 Loaded):VolumeTag = 00580001
- Storage Element 1:Full :VolumeTag=00580000
- Storage Element 2:Empty
- Storage Element 3:Full :VolumeTag=00580002
- Storage Element 4:Full :VolumeTag=00580003
- Storage Element 5:Full :VolumeTag=00580004
- 1.3 加载槽位3的磁带到driver 0
- C:\Documents and Settings\Administrator>mtx -f 3:0:0:0 load 3 0
- Loading media from Storage Element 3 into drive 0...done
- C:\Documents and Settings\Administrator>mtx -f 3:0:0:0 status|more
- Storage Changer 3:0:0:0:2 Drives, 40 Slots ( 20 Import/Export )
- Data Transfer Element 0:Full (Storage Element 3 Loaded):VolumeTag = 00580002
- Data Transfer Element 1:Full (Storage Element 2 Loaded):VolumeTag = 00580001
- Storage Element 1:Full :VolumeTag=00580000
- Storage Element 2:Empty
- Storage Element 3:Empty
- Storage Element 4:Full :VolumeTag=00580003
- Storage Element 5:Full :VolumeTag=00580004
- Storage Element 6:Full :VolumeTag=00580005
- Storage Element 7:Full :VolumeTag=00580006
- Storage Element 8:Full :VolumeTag=00580007
- Storage Element 9:Full :VolumeTag=00580008
- Storage Element 10:Empty
- 1.4 查看tape的名字
- C:\Documents and Settings\Administrator>scan -tape
- ************************************************************
- *********************** SDT_TAPE ************************
- ************************************************************
- ------------------------------------------------------------
- Device Name : "Tape0"
- Passthru Name: "Tape0"
- Volume Header: ""
- Port: 3; Bus: 0; Target: 0; LUN: 1
- Inquiry : "IBM ULTRIUM-TD1 18N2"
- Vendor ID : "IBM "
- Product ID : "ULTRIUM-TD1 "
- Product Rev: "18N2"
- Serial Number: "92FUC00601"
- WWN : ""
- WWN Id Type : 0
- Device Identifier: "IBM ULTRIUM-TD1 92FUC00601 "
- Device Type : SDT_TAPE
- NetBackup Drive Type: 3
- Removable : Yes
- Device Supports: SCSI-3
- Flags : 0x0
- Reason: 0x0
- ------------------------------------------------------------
- Device Name : "Tape1"
- Passthru Name: "Tape1"
- Volume Header: ""
- Port: 3; Bus: 0; Target: 0; LUN: 2
- Inquiry : "IBM ULTRIUM-TD1 18N2"
- Vendor ID : "IBM "
- Product ID : "ULTRIUM-TD1 "
- Product Rev: "18N2"
- Serial Number: "92FUC00602"
- WWN : ""
- WWN Id Type : 0
- Device Identifier: "IBM ULTRIUM-TD1 92FUC00602 "
- Device Type : SDT_TAPE
- NetBackup Drive Type: 3
- Removable : Yes
- Device Supports: SCSI-3
- Flags : 0x0
- Reason: 0x0
- 1.5 向tape 0写数据
- C:\Documents and Settings\Administrator>tar -cvf Tape0 "C:\Program Files\mtx"
- C:\\Program Files\\mtx/
- C:\\Program Files\\mtx/loaderinfo.exe
- C:\\Program Files\\mtx/mtx.exe
- C:\\Program Files\\mtx/README.win32
- C:\\Program Files\\mtx/scsieject.exe
- C:\\Program Files\\mtx/scsitape.exe
- C:\\Program Files\\mtx/tapeinfo.exe
- 1.6 查看已经备份的数据
- C:\Documents and Settings\Administrator>tar -tvf Tape0 "C:\Program Files\mtx"
- drw-rw-rw- Administrator/0 0 2012-10-13 18:33 C:\\Program Files\\mtx/
- -rwxrwxrwx Administrator/0 77824 2008-08-20 23:52 C:\\Program Files\\mtx/loaderinfo.exe
- -rwxrwxrwx Administrator/0 90112 2008-08-20 23:52 C:\\Program Files\\mtx/mtx.exe
- -rw-rw-rw- Administrator/0 1360 2008-08-20 23:53 C:\\Program Files\\mtx/README.win32
- -rwxrwxrwx Administrator/0 81920 2008-08-20 23:52 C:\\Program Files\\mtx/scsieject.exe
- -rwxrwxrwx Administrator/0 81920 2008-08-20 23:52 C:\\Program Files\\mtx/scsitape.exe
- -rwxrwxrwx Administrator/0 81920 2008-08-20 23:52 C:\\Program Files\\mtx/tapeinfo.exe
方案二:
要使用此方案,是需要安装NBU软件与配置设备的
- 2.1 robtest测试带库
- C:\Documents and Settings\Administrator>robtest
- Configured robots with local control supporting test utilities:
- TLD(0) robotic path = {3,0,0,0}
- Robot Selection
- ---------------
- 1) TLD 0
- 2) none/quit
- Enter choice: 1
- 1
- Robot selected: TLD(0) robotic path = {3,0,0,0}
- Invoking robotic test utility:
- C:\Program Files\Veritas\Volmgr\bin\tldtest.exe -rn 0 -r {3,0,0,0}
- Opening {3,0,0,0}
- MODE_SENSE complete
- Enter tld commands (? returns help information)
- ?
- To exit the utility, type q or Q.
- init - Initialize element status
- initrange <d#|s#|p#|t> [#]- Init element status range
- allow - Allow media removal
- prevent - Prevent media removal
- extend - Extend media access port
- retract - Retract media access port
- mode - Mode sense
- m <from> <to> - Move medium
- pos <to> - Position to drive or slot
- s [d|p|t|s [n]] [raw] - Read element status
- inquiry - Display vendor and product ID
- rezero - Rezero unit
- inport - Ready inport (media access port)
- debug - Toggle debug mode for this utility
- test_ready - Send a TEST UNIT READY to the device
- <from> <to> specifies drive (d#), slot (s#), media access port (p#),
- or transport (t#)
- <d#|s#|p#|t#> is drive #, slot #, media access port #, or transport #
- [#] is number of elements for d, s, p, or t
- NOTE - drive # is 1 - Number of drives
- slot # is 1 - Number of slots
- media access port # is 1 - Number of media access port elements
- transport # is 1 - Number of transports
- <type> = (d)rive, (s)lot, media access (p)ort, or (t)ransport
- unload <drive> - Issue SCSI unload
- <drive> = d1 or 1, d2 or 2, d3 or 3 ... d648 or 648
- multipath [enable|disable] - turn multipathing on/off
- multipath [auto|manual] - turn auto path discovery on/off
- multipath [addpath|removepath] [path] - for manual mode, add/remove path
- multipath [showpaths] - show currently configured paths for auto or manual
- mode
- s d
- drive 1 (addr 500) access = 1 Contains Cartridge = no
- drive 2 (addr 501) access = 1 Contains Cartridge = no
- READ_ELEMENT_STATUS complete
- s s
- slot 1 (addr 1000) contains Cartridge = yes
- Source address = 500
- Barcode = 00580000
- slot 2 (addr 1001) contains Cartridge = yes
- Source address = 500
- Barcode = 00580002
- slot 3 (addr 1002) contains Cartridge = yes
- Source address = 501
- Barcode = 00580001
- slot 4 (addr 1003) contains Cartridge = yes
- Source address = 0
- Barcode = 00580003
- slot 5 (addr 1004) contains Cartridge = yes
- Source address = 0
- Barcode = 00580004
- slot 6 (addr 1005) contains Cartridge = yes
- Source address = 0
- Barcode = 00580005
- slot 7 (addr 1006) contains Cartridge = yes
- Source address = 0
- Barcode = 00580006
- << Press return to continue, or q and return to stop >>
- q
- READ_ELEMENT_STATUS complete
- m s1 d1
- Initiating MOVE_MEDIUM from address 1000 to 500
- MOVE_MEDIUM complete
- s d
- drive 1 (addr 500) access = 0 Contains Cartridge = yes
- Source address = 1000 (slot 1)
- Barcode = 00580000
- drive 2 (addr 501) access = 1 Contains Cartridge = no
- READ_ELEMENT_STATUS complete
- q
- Robot Selection
- ---------------
- 1) TLD 0
- 2) none/quit
- Enter choice: 2
- 2
- 2.2 向tape0写数据
- C:\Documents and Settings\Administrator>nt_ttu -f Tape0
- Welcome to nt_ttu, h[elp] or ? for help.
- Data Buffer Initial Address - 0000000002164000
- nt_ttu> open t
- OPEN elapsed time = 16 msecs.
- nt_ttu> ioctl c=rew
- cmd = rew
- now rewinding the tape
- nt_ttu> write t b=65536
- WRITE time=0 msec; records=1; bytes/record=65536; bytes/msec=65536.000
- nt_ttu> c t
- CLOSE elapsed time = 0 msecs.
- nt_ttu> exit
已经成功。