2、sa进入master库,修改异常库的status为-32768,然后关闭;
点击(此处)折叠或打开
- use master
go
sp_configure 'allow update',1
go
update sysdatabases set status=-32768 where name='$db_name1'
go
checkpoint
go
shutdown
go
4、启动数据库之后,备份DDL
点击(此处)折叠或打开
startserver -f RUN_xxx
ddlgen -Usa -Pxxx -Sxxx –D$db_name -o$dbname.ddl
点击(此处)折叠或打开
dump tran $db_name1 with no_log
go
改回正常状态
点击(此处)折叠或打开
- update sysdatabases set status = 0 where name = ‘$db_name1’
- go
- sp_configure 'allow update',0
go - checkpoint
- go
- shutdown
- go
(未完待续)
7、恢复后的数据库在使用时部分表操作报错
点击(此处)折叠或打开
- dbcc traceon(3604)
- go
- dbcc checktable('$tab_name')
- go
- ERROR:692
- drop table $tab_name
- go
- ERROR:3701
(未完待续)