|
Category: ASE: dbcc
dbcc dbreboot
dbcc dbreboot is an undocumented
dbcc
command.
Warning: Only use this undocumented and not supported functionality
at your own risk! Do not contact Sybase Technical Support for help.
dbcc dbreboot is available in
ASE
starting with v12.5.4 ESD#1 and ASE 15.0.2 and
allows the manipulation of one or several databases on a
dataserver.
This command is useful when receiving a "database in use" (Msg 3101),
error, while loading a database or when trying to
set a database into "single user mode"
although
sp_who
does not show any
processes
for the database.
The reason for this behaviour has its roots in a "feature"
of ASE which prevents the
keep count
of a database being reliably reset.
Syntax of the dbcc dbreboot command
dbreboot (report | reboot | reboot_norecovery | shutdown | shutdown_load |
restart | restart_norecovery, dbname1 [, dbname2 ...])
Parameter of the dbcc dbreboot command
-
report - lists databases which are possibly in need of a reboot
-
reboot - shuts down and restarts a database
-
reboot_norecovery - same as reboot, but without recovery
-
shutdown - shuts down the database
-
shutdown_load - shuts down the database and sets it into state "for load",
avoiding recovery at dataserver restart.
You must load the database after issuing this command or the dataserver can become corrupt
-
restart - starts a database which was previously shut down
-
restart_norecovery - same as restart, but without recovery
-
dbname1 - the name of the affected database. More than one database can be specified separated by comma
Example for using the dbcc dbreboot command
1> dbcc dbreboot("shutdown","db_one")
2> go
---------- Shutting Down Database 'db_one' ----------
---------- Operation on Database 'db_one' Completed Successfully ----------
1> use db_one
2> go
Database db_one with dbid 5 is already shut down.
1> sp_helpdb db_one
2> go
name db_size owner dbid created status
------ ------------- ----- ---- ------------ ----------------------------
db_one 300.0 MB sa 5 Jun 05, 2009 select into/bulkcopy/pllsort
(1 row affected)
device_fragments size usage created free kbytes
------------------------------ ------------- -------------------- ------------------------- ----------------
data00 200.0 MB data only Jun 5 2009 11:38AM 199984
log00 100.0 MB log only Jun 5 2009 11:38AM not applicable
Database db_one with dbid 5 is already shut down.
|