How to restart database in Sybase

We can shutdown inviducal database using DBCC DBREBOOT to clear a problem which is impacting the database. We can restart or shutdown one or more databases at a time.

Note:The DBCC DBREBOOT command should be used with caution, and it must not be considered as fail-safe. There are many different circumstances under which a database might need a reboot. Be aware it terminates running tasks and it is not always possible for ASE(Sybase) to completely cleanup these processes.

Syntax:

dbcc dbreboot (report | reboot | reboot_norecovery | shutdown | shutdown_load | restart | restart_norecovery, [, …,])

Option Description
report Provide a listing of active processes and transaction in the database(s) what will be affected by a shutdown
reboot Shutdown the database(s) forcibly and reboot the database(s). Recover on reboot.
reboot_norecovery Shutdown the databse(s) forcibly. The database is left in an unuseable state. Some sort of ‘restart’ must be done or a ‘shutdown_load’ in order to make the database useable.
shutdown Shutdown the databse(s) forcibly. The database is left in an unuseable state. Some sort of ‘restart’ must be done or a ‘shutdown_load’ in order to make the database useable.
shutdown_load Shutdown the database(s) forcibly and leave the database in a state that allows a LOAD DATABASE to be done.
restart Reboot the database(s).This command can only be used on database that has already been shutdow. Recovery is run when the database is restarted.
restart_norecovery Reboot the database(s). Do not recover on reboot. This command can only be used on a database that has already been shutdown. Recovery is not run when the database is restarted and the database is left in ‘not recovered’ state. In this state, the database cannot be accessed by anyone but the SA. However it is useful if there is some sort of problem during recovery

Example:

1> dbcc traceon(3604)
2> go
DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role.
1> dbcc dbreboot(restart, testdb)
2> go

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by k2schools