Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Prevent ASE from overriding trans logs ..

$
0
0

Hi Tobias,

 

You can try with a code similar to this one inside procedure:

 

Declare @dia varchar(255) 

Declare @mes varchar(255) 

Declare @ano varchar(255) 

Declare @hora varchar(255) 

Declare @minuto varchar(255) 

Declare @ruta varchar(255) 

Declare @dump varchar(255) 

Declare @state integer 

 

 

select @dia= convert(varchar,day(getdate())) 

select @mes = convert(varchar,month(getdate())) 

select @ano = convert(varchar,year(getdate())) 

select @hora = rtrim(ltrim(substring(convert(varchar,getdate(),108),1,2))) 

select @minuto = rtrim(ltrim(substring(convert(varchar,getdate(),108),4,2))) 

 

 

select @state = tran_dumpable_status ('pubs2') 

select @ruta = '''/backup/pubs2_'+@dia+@mes+@ano+@hora+@minuto+'.log''' 

if @state = 0 

begin 

  select @dump = 'dump tran pubs2 to '+@ruta+' with compression = 101' 

  exec (@dump) 

end 

else 

begin 

  select @dump = 'dump tran pubs2 with truncate_only' 

  exec (@dump) 

end 

 

There you check if it is possible to dump database tran log to disk, if not you just truncate it in order not to get full tran log.

 

Hope Helps.

Javier.


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>