在這裡介紹一下WIN平台上面怎麼測試帶庫是否可以正常的讀寫資料庫。
WIN這個是個好東西,但是在用于伺服器方案,我切不會的。
這裡不介紹廠商自己提供的軟體來測試帶庫。
WIN下面同樣用兩種方案:
方案一:使用mtx與tar來實作
方案二:使用robtest與nt_ttu工具
方案一:
方案一需要用到兩個工具,mtx與tar,這兩個工具都需要到第三方去下載下傳。
軟體安裝完成後記得在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
Data Transfer Element 0:Full (Storage Element 3 Loaded):VolumeTag = 00580002
Storage Element 3:Empty
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"
Port: 3; Bus: 0; Target: 0; LUN: 2
Serial Number: "92FUC00602"
Device Identifier: "IBM ULTRIUM-TD1 92FUC00602 "
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
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
Barcode = 00580004
slot 6 (addr 1005) contains Cartridge = yes
Barcode = 00580005
slot 7 (addr 1006) contains Cartridge = yes
Barcode = 00580006
<< Press return to continue, or q and return to stop >>
q
m s1 d1
Initiating MOVE_MEDIUM from address 1000 to 500
MOVE_MEDIUM complete
drive 1 (addr 500) access = 0 Contains Cartridge = yes
Source address = 1000 (slot 1)
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
已經成功。
本文轉自7343696 51CTO部落格,原文連結:http://blog.51cto.com/luoping/1027147,如需轉載請自行聯系原作者