A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  special characters  sybase-tech-blog


Category: ASE: Functions: System Functions

tran_dumpable_status()

The system function tran_dumpable_status() makes it possible to determine if the command dump transaction can be executed on a database, without having to use the "dump transaction" command. The system function tran_dumpable_status() simulates exactly the same checks which ASE does, if the command "dump transaction" is executed. If the return value is equal to "0", the transaction log of a database can be dumped. All other return values are made up of a bitmap, the values of which hint for the reason, why "dump transaction" cannot be executed.

The system function "tran_dumpable_status()" is a T-SQL extension. It can be executed by any user. tran_dumpable_status() is availabel for ASE starting with version 15.0.

Syntax of the System Function tran_dumpable_status()

    tran_dumpable_status("database_name")
    

The parameter of the System Function tran_dumpable_status()

"database_name"
The parameter "database_name" is the name of the database to be queried and can be retrieved from the column name of the system table sysdatabases.

Example for the System Function tran_dumpable_status()

    1> select tran_dumpable_status("pubs2")
    2> go
    
    ----------- 
            106
    
    (1 row affected)
    

Checks if the transaction log of the database pubs can be dumped. In this case the return value is not equal to "0". The execution of "dump transaction" is not possible. The bitmap "106" is a combination of the bits 2,8,32 and 64 and hints on the source of the error.

Usage of the System Function tran_dumpable_status()

The return value of the function "tran_dumpable_status()" consists of a bitmap. If the return value is not equal to "0", the below table can be used to folgenden Tabelle split the value into single bits, in order to diagnose the error:

Bitmap of the System Function "tran_dumpable_status()"
Bit Explanation
1 The specified database does not exist.
2 A log does not exist on a seperate device
4 The first page of a log is located in the area of a data only disk fragment.
8 The database option "trunc log on chkpt" is set.
16 Non-logged write operations have occured.
32 Transaction log dump with "truncate only" has interrupted a continuous dump sequence.
64 The database is new or upgraded. Tran dump can only be used after a database dump.

See also:

ASE T-SQL - Aggregate Functions,
audit_event_name(),
col_length(),
col_name(),
curunreservedpgs(),
datachange(),
datalength(),
data_pages(),
data_pgs(),
db_id(),
db_name(),
host_id(),
host_name(),
identity(),
index_col(),
index_colorder(),
isnull(),
lct_admin(),
license_enabled(),
lockscheme(),
next_identity(),
object_id(),
object_name(),
pagesize(),
pointer_size(),
ptn_data_pgs(),
reserved_pages(),
reserved_pgs(),
rowcnt(),
row_count(),
showplan_in_xml(),
syb_sendmsg(),
syb_sendmsg(),
System Functions,
tempdb_id(),
tsequal(),
used_pages(),
used_pgs().