Help with logical name error 8985

  • When I try to shrink a mdf or ldf (via Enterprise Mgr or with T-SQL), I get the error "Error 8985: Could not locate file 'abc_Data' in sysfiles. DBCC execution completed...". The logical name abc_Data is used by more than one database currently on this server. Plus, we just deleted a test database, which may have had this logical name too, but I'm not sure. What can I do to fix this? I can't find any information regarding a resolution for this problem. Any help would be greatly appreciated.

    smv929


    smv929

  • Before issue shrink command, make sure your current database is the correct one you want to shrink.

    use pubs

    go

    dbcc shrinkfile (pubs_data, 10)

    go

  • I didn't execute a "Use pubs" command, however, I did make sure the correct database was selected in the Query Analyzer's db dropdown list. I assume this is the same. Correct?

    smv929


    smv929

  • If you enter the command sp_helpfile, the name that shows up in the name column is what you use in first parameter of the DBCC SHRINKFILE. This is the logical files name. Alternatively you can use the fileid (from the Sp_helpfile again) In most cases DBCC SHRINKFILE(2) shrinks the log and DBCC SHRINKFILE(1) shrinks the data. Don't count on this, check sp_helpfile. It does sound like there is a problem if even EM couldn't do this. Did you try shrinking the log and data files independantly via EM? What happens if you execute the query select *

    from sysfiles? Do the names match with what think is the logical file name?

    Francis

  • Yes, I did use sp_helpfile to determine the logical name to use as the first parameter of the DBCC SHRINKFILE. The logical names are the same as those shown in the query select * from sysfiles. And Yes, I did try shrinking the log and data files independantly via EM. However, I did not try DBCC SHRINKFILE(2) or DBCC SHRINKFILE(1). I will try this during slow production time. However, I feel it will return the same results. I'll get back with the results.

    Thanks.

    smv929


    smv929

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply