现在的位置: 首页 > 综合 > 正文

SQL Server could not bring database ‘db_name’ online (sybase)

2013年10月05日 ⁄ 综合 ⁄ 共 980字 ⁄ 字号 评论关闭

------------------SQL Server could not bring database online--------------------------

问题描述:

测试库   服务器重启  sybase服务是开机自动启动的

后来测试人员发现 数据库的状态为offline 无法登录数据库

修复的过程:

1.  登录数据库

isql -Sinstence_name -Usa -P123456

2.查看数据库状态

sp_helpdb

go

数据库的 status: 

select into/bulkcopy/pllsort, ddl in tran, offline    

3.将数据库 online

然后执行

online database db_name

go

------一般情况下 大部分的数据库都会被online

但是这次出现了一个错误 online失败

错误的信息是:

SQL Server could not bring database 'db_name' online.

4.将数据库关闭

shutdown 

go

5.开启数据库

发现在启动信息中有些异常的信息

00:00000:00001:2012/03/08 12:41:22.14 server  Error: 1105, Severity: 17, State: 4
00:00000:00001:2012/03/08 12:41:22.14 server  Can't allocate space for object 'syslogs' in database 'db_name' because 'logsegment' segment is full/has no free extents. If you ran out of space in syslogs, dump the transaction log. Otherwise, use ALTER DATABASE
to increase the size of the segment.

问题找到了 是应该日志文件满了导致的(由于是测试库 数据库的trunc log on chkpt 选项也没有加上)

6. isql进入数据库 并且 将该数据库的日志文件进行手工截取

dump transaction db_name  with truncate_only

go

7.然后再对该数据库进行 online操作

online database db_name

go

---Database 'db_name' is now online.

到此,问题得到解决。

抱歉!评论已关闭.