Check for minimally logged operations in a dataserver:
The dbinfo memory structure, which each database has, holds information on whether the sequence of the transaction log entries were written consecutively, or if the sequence was broken by minimally logged transactions. The information is stored in sysindexes for object id 8, which is the syslogs table, i.e. the transaction log.
This can be helpful to determine for example, if it is possible to dump the transaction log of a database.
The information in dbinfo can be different between certain ASE versions. So you'll have to try in order to reliably find the correct information, but the following gives an idea on how to progress:
declare @flag1 int declare @flag2 int SELECT @flag1 = 4 & convert (BINARY(4),substring(keys1,127,4)) FROM sysindexes WHERE id = 8 SELECT @flag2 = 8 & convert (BINARY(4),substring(keys1,127,4)) FROM sysindexes WHERE id = 8 IF (@flag1 = 4) OR (@flag2 = 8 ) print "Minimal tran detected. Log dump not possible." else print "log sequence allows dumping the log" go
Starting with ASE v15, the system function tran_dumpable_status() can be used.
It will return a bitmap which represent a reason if the tranlog cannot be dumped.
- Bit 1 - database does not exist
- Bit 2 - transaction log not on a separate device
- Bit 4 - first page of the log is on a fragment with data only.
- Bit 8 - "truncate log on checkpoint" option enabled for this db
- Bit 16 - minimally logged operations were detected
- Bit 32 - "dump tran with truncate only" detected
- Bit64 - newly created or upgraded database - full dump required