Thursday 31 December 2009

dbcc dbreboot undocumented command

1> dbcc dbreboot(reboot,sag)
2>
00:00000:00013:2009/06/17 13:19:51.15 server ---------- Shutting Down Database 'sag' ----------
00:00000:00013:2009/06/17 13:19:53.17 server ---------- Re-starting Database 'sag' With Recovery ----------
00:00000:00013:2009/06/17 13:19:53.19 server Log contains all committed transactions until 2009/06/17 12:16:11.54 for database sag.
00:00000:00013:2009/06/17 13:19:53.24 server ---------- Operation on Database 'sag' Completed Successfully ----------
---------- Shutting Down Database 'sag' ----------
---------- Re-starting Database 'sag' With Recovery ----------
Recovering database 'sag'.
Started estimating recovery log boundaries for database 'sag'.
Database 'sag', checkpoint=(43329, 21), first=(43329, 21), last=(43329, 21).
Completed estimating recovery log boundaries for database 'sag'.
Started ANALYSIS pass for database 'sag'.
Completed ANALYSIS pass for database 'sag'.
Started REDO pass for database 'sag'. The total number of log records to process is 1.
Completed REDO pass for database 'sag'.
Recovery of database 'sag' will undo incomplete nested top actions.
Started filling free space info for database 'sag'.
Completed filling free space info for database 'sag'.
Started cleaning up the default data cache for database 'sag'.
Completed cleaning up the default data cache for database 'sag'.
Recovery complete.
Database 'sag' is now online.
---------- Operation on Database 'sag' Completed Successfully ----------
1>

3 comments:

  1. Is this command valid for all the databases or only for online databases??

    ReplyDelete
  2. The option comes with ASE 12.5.4 ESD 1 and 15.0.2. It can be a substitute command to rebuild the DBTABLE memory structure if you face problem in loading a database when it complains its in use.
    The dbt_keep variable is non zero in this case and thus you can use dbcc dbreboot( reboot, db ) to clear it. You can also rebuild the DBTABLE structure with dbcc dbcacheremove

    To find out out any such case you can use dbcc dbreboot(report) option and it will suggest you if you can use dbcc dbreboot.

    In case you have shutdown the database using dbreboot shutdown, shutdown_load or restart_norecovery then you can use restart, restart_norecovery to bring it up.

    Hope this helps...

    Never try on a production database as this is not documented..

    ReplyDelete
  3. Thanks for clarification......

    ReplyDelete