Updated logical file name related issue

  • Here is my problem:

    I had a database that somebody created from another database on the SAME server. When that was done, the Logical file names for the new database were not changed to reflect the new name and so I saw two databases on the server with the same Logical file names.

    I tried to restore as a new database but the logical names of course did not change.

    So - I ran the following script:

    USE [Cad]

    sp_configure 'allow updates',1

    go

    reconfigure with override

    go

    update sysfiles1 set name = 'Cad_data' where name='sde_data'

    go

    update sysfiles1 set name = 'Cad_log' where name='sde_log'

    go

    sp_configure 'allow updates',0

    go

    reconfigure with override

    I then checked the new file names with:

    exec sp_helpfile

    Everything looked good.

    Then, I tried to run a shrink file on the log because it was out of control large, and received an error stating that the file was not found!

    Ok, so I updated the statistics in both the database and master. I re-ran the Shrink File - and again, not found 🙁

    I am at a loss - any ideas for what to do except to re-build the thing?

    Thanks,

    SSkaar

  • I think detach/attach would have been the easy thing to do here.

    I'm not sure what you can do now. Can you access the database? Is it online?

    I think that there might be a mismatch with sysdatabases.

  • Yeah, I think I tried too hard to keep it online! LOL

    I have restored to yesterday's backup - this is just a development database so no harm no foul, I wouldn't have tried it otherwise!

    But - now I am back to the logical files having the wrong names, so not sure what is best for that. Any thoughts?

Viewing 3 posts - 1 through 2 (of 2 total)

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