Trouble with removing a defunct file

  • Hello gents

    Syptoms are as follows:

    select file_id, name, physical_name, state_desc from dbname.sys.database_files

    go

    Returns:

    file_idnamephysical_namestate_desc

    1dbnameD:\Data\dbname.mdfONLINE

    2dbname_logD:\Log\dbname.ldfONLINE

    3dbname2_ARCHIVED:\Data\dbname.ndfDEFUNCT

    4dbname_ARCHIVED:\Data\dbname.ndfONLINE

    alter database dbname remove file dbname2_ARCHIVE

    go

    Returns:

    Msg 5009, Level 16, State 2, Line 1

    One or more files listed in the statement could not be found or could not be initialized.

    If I trie to run:

    backup database dbname to disk = 'D:\backups\userdb\dbname\dbname.bak'

    with stats = 1

    go

    Returns:

    Msg 3636, Level 16, State 2, Line 1

    An error occurred while processing 'BackupMetadata' metadata for database id 7 file id 3.

    Msg 3046, Level 16, State 2, Line 1

    Inconsistent metadata has been encountered. The only possible backup operation is a tail-log backup using the WITH CONTINUE_AFTER_ERROR or NO_TRUNCATE option.

    Msg 3013, Level 16, State 1, Line 1

    BACKUP DATABASE is terminating abnormally.

    Then I tried to backup the tail log:

    backup log dbname to disk = 'D:\backups\userdb\dbname\dbname.trn'

    with stats = 1, no_truncate, CONTINUE_AFTER_ERROR

    go

    Returns:

    Msg 4214, Level 16, State 1, Line 1

    BACKUP LOG cannot be performed because there is no current database backup.

    Msg 3013, Level 16, State 1, Line 1

    BACKUP LOG is terminating abnormally.

    Looking like I do not have a full backup for the t-log backup to begin with.

    Plus, DBCC checkdb reported no error.

    The defunct file is obstructing my daily full backup job for several days in a row now and how can I get ride of it?

    Thanks in advance for you help or advice!

    Bazinga!

  • Any joy with this? Ive got the same problem?

  • Hi There,

    If you go to D:\Data are there 3 files for this database? In your post the two .ndf files seem to have the same name?

    ============================================================
    David

    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

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

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