免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4427 | 回复: 8
打印 上一主题 下一主题

请教:数据库的状态各表示什么意思? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-19 08:48 |只看该作者 |倒序浏览
用select * from sysdatabases 看见有一列为staut,也曾看见以前文章介绍用改更此值可以解决一些问题(比如:状态可疑),请问当为0 ,12, -32768 等值时分别表示什么意义?

论坛徽章:
1
2017金鸡报晓
日期:2017-01-10 15:19:56
2 [报告]
发表于 2007-06-19 17:14 |只看该作者
十进制十六进制状态
1 0x01 在此数据库上启动了升级
2 0x02 升级已成功
4 0x04 · select into/bulkcopy· 可由用户设置
8 0x08 · trunc log on chkpt· 可由用户设置
16 0x10 · no chkpt on recovery· 可由用户设置
32 0x20 用 for load 选项创建数据库(否则在装载数据库时崩溃),用于指示不进行恢复
64 0x04 为要恢复的所有数据库启动恢复
256 0x100 · 可疑数据库· 未恢复· 无法打开或使用· 只能用 dbcc dbrepair 删除
512 0x200 · ddl in tran· 可由用户设置
1024 0x400 · read only· 可由用户设置
2048 0x800 · dbo use only· 可由用户设置
4096 0x1000 · single user· 可由用户设置
8192 0x2000 · allow nulls by default· 可由用户设置

论坛徽章:
0
3 [报告]
发表于 2007-06-20 08:46 |只看该作者
好贴。收藏一下。顺便再问一下,如果出现状态是320的情况下,该如何处理呢?

论坛徽章:
0
4 [报告]
发表于 2007-06-21 09:06 |只看该作者
谢谢版主的指点,那-32768  (十六进制的8000)又代表什么意思呢?

论坛徽章:
0
5 [报告]
发表于 2007-06-26 11:43 |只看该作者
我遇到320的时候都是把satats设为-32768启动数据库后用dump tran ... with no_log清一遍日志,然后把stats改为0重启数据库,重设数据库选项后做个全库的DBCC,看看有没有表坏了.

论坛徽章:
0
6 [报告]
发表于 2007-06-26 11:45 |只看该作者
原帖由 trytodoit 于 2007-6-21 09:06 发表
谢谢版主的指点,那-32768  (十六进制的8000)又代表什么意思呢?


-32768表示不在启动时恢复此数据库.

论坛徽章:
0
7 [报告]
发表于 2007-06-27 16:25 |只看该作者
状态320表示:
320= 256 + 64
256和64的解释:
64 0x04 为要恢复的所有数据库启动恢复
256 0x100 · 可疑数据库· 未恢复· 无法打开或使用· 只能用 dbcc dbrepair 删除

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
8 [报告]
发表于 2007-06-27 23:01 |只看该作者
Table 12-5 lists the bit representations for the status column.

Table 12-5: status control bits in the sysdatabases table Decimal
Hex
Status

4
0x04
select into/bulkcopy

Can be set by user


8
0x08
trunc log on chkpt

Can be set by user


16
0x10
no chkpt on recovery

Can be set by user


32
0x20
Database created with for load option, or crashed while loading database, instructs recovery not to proceed

256
0x100
Database suspect

Not recovered

Cannot be opened or used

Can be dropped only with dbcc dbrepair


512
0x200
ddl in tran

Can be set by user


1024
0x400
read only

Can be set by user


2048
0x800
dbo use only

Can be set by user


4096
0x1000
single user

Can be set by user


8192
0x2000
allow nulls by default

Can be set by user



Table 12-6 lists the bit representations for the status2 column.

Table 12-6: status2 control bits in the sysdatabases table Decimal
Hex
Status

1
0x0001
abort tran on log full; can be set by user

2
0x0002
no free space acctg; can be set by user

4
0x0004
auto identity; can be set by user

8
0x0008
identity in nonunique index; can be set by user

16
0x0010
Database is offline

32
0x0020
Database is offline until recovery completes

64
0x0040
Internal use – Database is being recovered

128
0x0080
Database has suspect pages

256†
0x0100
Table structure written to disk

512
0x0200
Database is in the process of being upgraded

1024
0x0400
Database brought online for standby access

-32768
0xFFFF8000
Database has some portion of the log which is not on a log-only device

论坛徽章:
0
9 [报告]
发表于 2007-06-28 10:40 |只看该作者
收场了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP