Microsoft KB Archive/112589

From BetaArchive Wiki

BUG: Error 5105 if Disk Init Reuses vdevno

Q112589



The information in this article applies to:


  • Microsoft SQL Server version 4.2x



BUG# OS/2: 1569 (4.2)
       NT:  436 (4.2) 



SYMPTOMS

A device activation error may occur if a device is dropped, then a subsequent disk init incorrectly reuses the same vdevno. However, the 5105 error issued is misleading as to the true cause of the error.

The system administrator assigns each SQL Server device a virtual device number (vdevno) unique for that SQL Server. As noted in the remarks section of the DISK INIT command, vdevno's and physical file names are not reusable. If the SA drops a device and then attempts to initialize another device with the same vdevno, the disk init command will fail with a 5105 error:


Device activation error.
The physical file name '%.*s' may be incorrect.


The SQL Server errorlog will also have the following entry:


kernel udactivate: vdn X already active


The physical file created by the failed disk init will exist on the disk, but the device will not exist in SQL Server.

For example, the second disk init in the following script will fail:


   disk init name='test5105', physname='c:\test5105.dat',
             vdevno=5, size=512
   go
   sp_dropdevice test5105
   go
   disk init name='next5105', physname='c:\next5105.dat',
             vdevno=5, size=512
   go 


After this script runs, both the files TEST5105.DAT and NEXT5105.DAT will exist in the c:\ directory.

With this error, it would be better for SQL Server to issue a 5104 message:


Device number %ld already used.



WORKAROUND

Rerun the disk init command with a new vdevno and a new physical file name. If the SQL Server is shutdown and then restarted, the physical file that was created by the disk init, which failed with the error 5105, can be deleted manually, and the name respecified.

NOTE: After SQL Server has been stopped and restarted the vdevno can also be reused.



STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 4.2. This problem does not occur in version 6.0.

Additional query words:

Keywords : kbother
Issue type :
Technology : kbSQLServSearch kbAudDeveloper kbSQLServ420OS2


Last Reviewed: February 5, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.