Attempt to BEGIN TRANsaction in database "****" failed because database is in BYPASS RECOVERY mode.
请问如何解决?
select name,status from master..sysdatabases where db_name="你所说的数据库"
看status是否是-32768 ,若是,sysdatabases系统表相应记录的status字段改为0,reboot数据库服务器就可以了。
谢谢各位,问题已解决。中午去SYBASE网站查找到有关这个问题的详细信息,包括问题成因及解决办法:
Error 3908
Severity
16
Error Message
Attempt to BEGIN TRANsaction in database '%.*s' failed because database is in BYPASS RECOVERY mode.
Explanation
Adaptive Server can start various types of transactions such as local (in response to a local command), internal (for the server's own use), external (started by an external client like a TP Monitor) and subordinate (child transactions started by a parent transaction in parallel).
Bypass recovery starts Adaptive Server without recovering one or more databases. A database in this mode can be accessed even though it is not recovered. You use this mode to allow access to the database for problem analysis, to copy out data, and so on.
Error 3908 is raised when a transaction is attempted while the database is in bypass recovery. Although certain commands are permissible in this mode, no transactions - regardless of type - can be started when the database is in bypass recovery.
Error 3908 is raised in the following states:
State Meaning
1 Attempted to start a transaction when the database is not available for update. Applies to all possible transaction types.
2 Attempted to start a subordinate transaction when the database is not available for update.
Action
Do not attempt to start a transaction while the database is in bypass recovery. Check if any automated jobs may have submitted a batch job that attempted such a transaction. First restore the database to the original working status it had (prior to bypass status) before attempting any transactions.
Use the following steps to reset the database status:
Note Although a status of zero is usually appropriate, it is not the only possible status value you can use. Reset the database to the actual, normal status it had prior to entering bypass recovery status.
1. Reset the database status to 0:
1>; sp_configure "allow updates", 1
2>; go
1>; begin tran
2>; go
1>; use master
2>; go
1>; update sysdatabases set status=0 where name=
2>; go
Check that the above update command affected only one row (if more than one row was affected, issue a rollback transaction.) Then commit the transaction and shut down Adaptive Server as follows:
1>;commit tran
2>;go
1>;shutdown with nowait
2>;go
2. Restart Adaptive Server. Run dbcc checkdb and dbcc checkalloc on the affected database to make sure there are no errors.
Version in Which This Error is Raised
All versions.
再次谢谢aladdin,freebob,changing。
6) 数据库表BCP出来报错
http://www.chinaunix.net/cgi-bin/bbs/topic.cgi?forum=10&topic=1326&show=300
数据库表BCP出来报错
DB-LIBRARY error
I/O error while writing bcp data-file
bcp出来的文件正好2GB,实际应该更大。
操作系统SCO OpenServer5.0.4, SYBASE 11.0.3
请问是何原因?谢谢。
当在后备数据量大于2GB的数据库时,可能会遇到以下错误:
I/Oerror:
operating system error,server device /backup/data. code 27 messages
file too large.
这是由于后备文件的大小超出了操作系统的用户最大文件限制。而有些操作系统不支持大于2GB的文件,这时可以使用Backup Server将一个数据库后备到多个文件中。
1>;dump database pubs2 to "/usr/sybase/pubs2_dump.1"
2>;stripe on "/usr/sybase/pubs2_dump.2"
3>;stripe on "/usr/sybase/pubs2_dump.3"
4>;go
这种方法还可以提高后备及恢复的速度,但注意恢复也必须用相应多的设备。例如:
1>;load database pubs2 from "/usr/sybase/pubs2_dump.1"
2>;stripe on "/usr/sybase/pubs2_dump.2"
3>;stripe on "/usr/sybase/pubs2_dump.3"
4>;go
7) sybase的sa口令丢失怎样恢复?
http://www.chinaunix.net/cgi-bin/bbs/topic.cgi?forum=10&topic=1239&show=270
在RUN-SERVER文件中加入一行-psa,重起dataserver,在控制台上可以看见新的口令
http://www.powerba.com/develop/database/sybase/article/20010505001.htm
sybase表中如何删掉多条相同的记录?
http://www.chinaunix.net/cgi-bin/bbs/topic.cgi?forum=10&topic=1438&start=0&show=180
sybase表中如何删掉多条相同的记录?
由于表出问题,将没有进行处理的*.txt文件bcp到表中,其中含有大量的重复记录。
请问有没有办法将表中重复的记录删掉呢?
那好办,那你就可以使用下面语句将唯一的记录先插入到临时表中:
select distinct a ,b,c,d ... into tempdb..tempdb_table from tablename
然后清空原表,把临时表中的数据插入正式表中!
试试看
可以参考这种经典方法:
1---select * into tmp_tab from your_dup_tab where 1=2
2---若表无唯一性索引则建一个唯一性索引(一定能找到一个唯一性的索引建(复合索引))create unique index(列名1,列名2...) on tmp_tab with ignore_dup_key.
3----insert into tmp_tab from your_dup_tab
这样在新表中将自动删出重复记录。但数据量过大请留意日志空间(sp_spaceused syslogs).
很使用的方法.try it!
没有评论:
发表评论