The information in this article applies to:
SUMMARYThe purpose of this article is to explore various hardware problems related to Microsoft SQL Server's use of attached tape devices. A basic review of the database dump and load process will provide a general frame of reference to the actual operation that reads or writes from/to the tape device. The review of these operations is not intended to explain the entire process, only to provide a common framework for exploring the subsequent SQL Server tape issues. MORE INFORMATION
SQL Server provides the ability to write database pages to a database dump
device defined in master..sysdevices. The process that manages the load or
dump of database pages is shielded from the actual definition and operation
of the defined dump/load device. All that is required by either a dump or
load process is that the device be valid and accessible via the WIN32 API.
The WIN32 API call that exposes all hardware devices to SQL Server for the
purpose of dump/load is CreateFile() (see the WIN32 API Reference for
details). A successful return from this function call is a 'handle' to the
device, that can be referenced by SQL Server. This handle can be to a
floppy disk, a file on a hard disk, or a tape drive.
A load/read operation would proceed as follows:
It is possible to receive errors from any of the above steps. There are two types of errors that are generated. The first is the error that is sent to the client generating the operation. The second error is what is typically seen in the SQL Server Errorlog and the Application Log in the Windows NT Event Viewer. The client errors will be examined first. The typical error that may be seen by the client will be one or more of the following:
This is essentially a prompt for a new tape; typically, this error is not seen when a database was dumped via the batch mode operation that was available in SQL Server 4.21.
This is essentially a prompt for a new tape, typically this error is not seen when a database was dumped via the batch mode operation that was available in SQL Server 4.21.
This message is sent to the client on successful completion of a database dump.
This message is sent to the client when the tape volume information indicates that the volume has not expired. This message is typically seen when an operation to initialize a tape prior to a log or database dump is issued.
This message is seen when the second tape of a multi-volume tape set has a creation date different from the initial tape. This is typically seen when the tapes are mislabeled and an incorrect tape is inserted after a prompt.
This error is generally seen when on a load operation a file number is specified and was not found with a scan of the tape. The error can also occur with multi-volume operations.
This message is typically seen on a tape where the volume header cannot be read.
This message is a caution, to warn the user that the database name listed in the header is not the same as the database that will be loaded into. Other client related errors that will not be covered here are in the range of SQL Server Messages between message numbers 3201 and 3209. These particular errors are frequently seen by the client and are generated by the next level up in the process for Database/Log dumps and loads. The second class of errors, are those that are generally seen in the SQL Server Errorlog and in the Application Log of the Windows NT Event Viewer. These errors report problems that occur between the Operating System and SQL Server. This interface also dictates the type of information that is presented in the Errorlog; the messages generally consist of an error source, (for example, tbsopen, tbswritecheck,... and so forth), the error message, and the operating system error if appropriate. What follows is a short description of the tape class of error and what operation was probably occurring at the time that the error was generated. The follow is a list of errors by category and examples from reported problems. Additionally, other errors that may be seen are listed as well. TBSOPEN Example:
Additional Information or RESOLUTIONNone Possible Errors: a) Backup device id is out of range. b) Backup device is not active. c) It is possible to see other errors associated with TBSCHGTAPES. TBSCLOSE Example: No errors seen Additional Information or RESOLUTIONNone Possible Errors: a) Backup device failed to close, operating system error. b) It is possible to see other errors associated with TBSCHGTAPES, TPWTRLS, and TBSWRITEFLUSH. TBSWRITE Example: No errors seen Additional Information or RESOLUTIONNone Possible Errors: a) It is possible to see errors associated with TBSCHGTAPES and TBSWRITEFLUSH. TBSWRITEFLUSH Example: kernel tbswriteflush: Write failure on backup device \\.\tape0, returned operating system error 6(the handle is invalid) Additional Information or RESOLUTION- The above error was generated due to a time-out issue where a tape inserted into the tape drive on a multi-volume database dump failed.Possible Errors: a) Warning: the tape used is not a recommended computer grade tape and cannot be used for multivolume dumps. Also, Not enough space is left in the device to initiate this dump. b) Failure on backup device returned operating system error. c) Number of bytes written did not match request. d) Other errors may be present from TBSCHGTAPES TBSREAD Example: No errors seen Additional Information or RESOLUTIONNone Possible Errors: a) May see associated errors from TBSCHGTAPES and TBSREADFLUSH. TBSREADFLUSH Example:
Additional Information or RESOLUTIONAn event id number 11 was found in the Event Viewer, System Log with the above error, providing the additional description "Driver detected a controller error." The problem was resolved by correcting the underlying problem related to the cabling, terminator and SCSI controller.- This error may also be associated with a tbsreadcheck error, stating that the device could not be accessed because it was being used by another process. If this occurs, terminate the other process. Possible Errors: a) Failed to seek Tape Mark, operating system error. b) Block count during dump does not match block count during load. c) Failure on backup device returned operating system error. d) May be associated with errors from TPRTRLS and TBSCHGTAPES. TBSCHGTAPES Example:
Additional Information or RESOLUTIONNone Possible Errors: a) May be associated with errors from TBSWRITECHECK or TBSREADCHECK. TBSREADCHECK Example:
kernel tbsreadcheck: Tape rejected
Additional Information or RESOLUTION- The first example above has been associated with a tape drive supporting setmarks, which has been disabled by another tape related application. The particular function disabled is reportsetmarks. If the tape drive is external, it is possible to reset it by a power off/on cycle. If it is internal a power off/on of the server will reset the device so that the reportsetmarks are enabled (this generally is the default for most devices). Contact your support vendor for assistance with the problem.- The second example occurred on a MIPS system and was resolved by upgrading to 4.21a. Possible Errors: a) Backup device failed to open, operating system error. b) Tape rejected. c) Incorrect file indicator specified for tape device, Cannot find file on tape. d) Volume 'X' has been loaded instead of Volume 'Y' for the current file. e) Not a valid tape and Header labels of rejected tape. f) Bad block length. g) Cannot allocate byte I/O buffer. h) May be associated with errors from CHECKTAPEINFO, TPRVOL and TPRHDRS. TBSWRITECHECK Example:
Additional Information or RESOLUTION- The tape device was not created correctly and when SQL Server attempted to open the device the error was returned. Problem was resolved by correcting the setup for the tape device.- The second example occurred due to a previous call to open the specified tape device. Tape devices cannot be shared between processes. - The third example was resolved by cleaning the tape drive and using a different brand of tape. - The fourth example was an error generated by a tape device that was not on the Windows NT Hardware compatibility list. Possible Errors: a) Cannot find date using null dates in tape labels. b) Backup device failed to open operating system error. c) Not enough space is left in the device to initiate this dump. d) Seek operation in backup device returned operating system error. e) Incorrect file indicator specified for tape device, cannot find file on tape. f) Tape rejected. g) May be associated with errors from CHECKTAPEINFO, TPRTRLS, TPRHDRS and TPWVOL. CHECKTAPEINFO Example:
Additional Information or RESOLUTION- This error was generated by a device that was not on the Windows NT Hardware compatibility list. The problem is that when the tape drive was interrogated for it's firmware capabilities it did not response appropriately.- The second error was due to a faulty tape drive, the drive was replaced with an identical make/model and the error did not reoccur. - The third error is as simple as it seems, a pending tape operation and when interrogated, the device responds that there is indeed no tape in the drive. - This fourth error is also as obvious as the previous error. The tape was ejected and replaced. Possible Errors: a) Unable to load tape into the tape drive, OS Error. b) Error getting media Information for device, OS Error. c) Device or Media does not support '_'. d) Cannot write on a write protected tape. TPRHDRS Example:
Additional Information or RESOLUTION- The error list above has been reported on two different occasions, the first was generated on a MIPS server, the original problem has been corrected with version 4.21a SQL Server.- The second problem is related to the problem noted under tbsreadcheck, same issue an attempt to find a supported tape mark, but was unable to due to the disabling of the tape drive reportsetmarks. Possible Errors: a) Read returned 'X' reading first file header. b) Label not found. c) Read returned 'X' reading second file header. d) Failed to seek Tape mark, operating system error. TPRTLS Example:
Additional Information or RESOLUTION
Possible Errors: a) Failed to seek Tape mark, operating system error. b) Read of first trailer failed. b) Read of second trailer failed. TPWHDRS Example:
Additional Information or RESOLUTION
Possible Errors: a) Warning: the tape used is not a recommended computer grade tape and cannot be used for multi-volume dumps. b) Not enough space is left in the device to initiate this dump. TPWTRLS Example:
Additional Information or RESOLUTION
Possible Errors: a) Warning: the tape used is not a recommended computer grade tape and cannot be used for multi-volume dumps. TPRVOL Example:
Additional Information or RESOLUTION
Possible Errors: a) Seek operation in backup device returned operating system error. b) Read returned 'X' reading volume header c) VOL1 Label not found. TPWVOL Example:
Additional Information or RESOLUTION- The above problem occurred due to a device/controller problem. The tape device was replaced.Possible Problems: a) Seek operation in backup device returned operating system error. The information listed above is certainly not an exhaustive list of tape related problems, but it does serve to illustrate the variety of problems that may be encountered with tape devices. The best method to protect corporate resources is to verify that the device chosen is on the Windows NT Hardware Compatibility List for the version of Windows NT that is being used. Review the documentation that is included with the tape device and the SCSI controller to ensure that it is set up properly. Test the device with the application software that will be used routinely, and if there is more than one application, verify that they can successfully coexist. Additional query words: SQL Server WINNT Tape
Keywords : kbusage SSrvAdmin |
Last Reviewed: April 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |