How to repair the table

  • when i running this...

    DBCC CHECKDB('PMSdb') WITH NO_INFOMSGS

    Server: Msg 8966, Level 16, State 1, Line 1

    Could not read and latch page (1:399112) with latch type SH. sysindexes failed.

    and

    DBCC CHECKTABLE ('sysindexes') WITH NO_INFOMSGS

    Server: Msg 8966, Level 16, State 1, Line 1

    Could not read and latch page (1:399112) with latch type SH. sysindexes failed.

    Server: Msg 8909, Level 16, State 1, Line 1

    Table error: Object ID 1735289202, index ID 26996, page ID (1:399112). The PageId in the page header = (8224:538976288).

    CHECKTABLE found 0 allocation errors and 1 consistency errors in table '(Object ID 1735289202)' (object ID 1735289202).

    repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKTABLE (PMSdb.dbo.sysindexes ).

    what should i do after this? lets discuss it...

  • Back up the tail of your transaction log.

    Restore your database from the most recent good backup, with NORECOVERY.

    Restore the transaction logs up to the point immediately before the corruption occurred.

    Recover the database.

    Investigate the cause of the corruption and check that all your firmware and drivers for RAID and so on are up to date.

    John

  • Back up the tail of your transaction log...

    is it this one?

    BACKUP DATABASE [PMSdb]

    TO DISK = N'D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\PMSdb.bak'

    WITH NOFORMAT, NOINIT, NAME = N'PMSdb-Full Database Backup',

    SKIP, NOREWIND, NOUNLOAD, STATS = 10

    GO

    but the result is...

    Msg 3033, Level 16, State 0, Line 1

    BACKUP DATABASE cannot be used on a database opened in emergency mode.

    Msg 3013, Level 16, State 1, Line 1

    BACKUP DATABASE is terminating abnormally.

    from table sysdatabases, PMSdb status is 4194328 not 32768 (emergency mode)

  • backup log not backup database!

  • BACKUP LOG database_name TO <backup_device> [WITH { CONTINUE_AFTER_ERROR | NO_TRUNCATE }

  • No truncate...

    backup log PMSdb

    to disk='D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\PMSdb_Log.bak'

    with NO_TRUNCATE

    Server: Msg 3033, Level 16, State 1, Line 1

    BACKUP DATABASE cannot be used on a database opened in emergency mode.

    Server: Msg 3013, Level 16, State 1, Line 1

    BACKUP LOG is terminating abnormally.

    continue after error...

    backup log PMSdb

    to disk='D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\PMSdb_Log.bak'

    with CONTINUE_AFTER_ERROR

    Server: Msg 155, Level 15, State 1, Line 3

    'CONTINUE_AFTER_ERROR' is not a recognized BACKUP option.

  • Try:

    BACKUP LOG database_name TO <backup_device> WITH NO_RECOVERY

    Based on what I read here:

    http://msdn.microsoft.com/en-us/library/aa225964(v=sql.80)

  • backup log PMSdb

    to disk='D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\PMSdb_Log.bak'

    WITH NO_RECOVERY

    Msg 155, Level 15, State 1, Line 3

    'NO_RECOVERY' is not a recognized BACKUP option.

  • which mssql version?

  • mssql2000

  • use backup log with no_truncate

  • sorry -- backup log dbname to disk with no_truncate,norecovery

  • "NORECOVERY", no underscore.

  • backup log PMSdb

    to disk='D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\PMSdb_Log.bak'

    with NO_TRUNCATE,NORECOVERY

    Msg 3031, Level 16, State 1, Line 1

    Option 'no_truncate' conflicts with option(s) 'norecovery'. Remove the conflicting option and reissue the statement.

    backup log PMSdb

    to disk='D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\PMSdb_Log.bak'

    with NORECOVERY

    Msg 3101, Level 16, State 2, Line 1

    Exclusive access could not be obtained because the database is in use.

    Msg 3013, Level 16, State 1, Line 1

    BACKUP LOG is terminating abnormally.

  • Scott D. Jacobson (7/27/2012)


    "NORECOVERY", no underscore.

    Nice catch, mistake in my typing. I should have just done a cut and paste.

Viewing 15 posts - 1 through 15 (of 29 total)

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