dbTalk Databases Forums  

dbtran and operations timestamp

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss dbtran and operations timestamp in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Oliver Schulze L.
 
Posts: n/a

Default dbtran and operations timestamp - 04-11-2006 , 12:18 AM






Hi,
it is possible to use dbtran and a .log file to get the
timestamp of each operation(insert, update, etc) done
to the .db ?

I tried using the -g option but it prints something like:
--BEGIN TRANSACTION-1002-0053302122

Can I convert those lines to a timestamp?

I'm on ASA 6.0.4

Many thanks
Oliver

Reply With Quote
  #2  
Old   
Reg Domaratzki \(iAnywhere Solutions\)
 
Posts: n/a

Default Re: dbtran and operations timestamp - 04-11-2006 , 08:43 AM






No.

Checkpoint and connect operations include the timestamp in them, but none of
the other operations include any information in the log file about the time
the operation was executed, so there's no way for dbtran to provide this
information.

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swd/base.do
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"


"Oliver Schulze L." <news.oliver (AT) samera (DOT) com.py> wrote

Quote:
Hi,
it is possible to use dbtran and a .log file to get the
timestamp of each operation(insert, update, etc) done
to the .db ?

I tried using the -g option but it prints something like:
--BEGIN TRANSACTION-1002-0053302122

Can I convert those lines to a timestamp?

I'm on ASA 6.0.4

Many thanks
Oliver



Reply With Quote
  #3  
Old   
Oliver Schulze L.
 
Posts: n/a

Default Re: dbtran and operations timestamp - 04-11-2006 , 09:30 AM



Hi Reg,
thanks for your answer.

Is there a way I can deduce the timestamp?
What does those numbers means? Are they seconds, miliseconds?

For example, can I deduce the timestamp here:
--CHECKPOINT-0000-0053302002-2005/dec/21 02:32
--CONNECT-1001-0053302028-dba-2005/dec/21 02:34
--BEGIN TRANSACTION-1001-0053302039
BEGIN TRANSACTION
go
--COMMIT-1001-0053302044
COMMIT WORK
go

What does this number means: 0053302002

Many thanks
Oliver

Reg Domaratzki (iAnywhere Solutions) wrote:
Quote:
No.

Checkpoint and connect operations include the timestamp in them, but none of
the other operations include any information in the log file about the time
the operation was executed, so there's no way for dbtran to provide this
information.


Reply With Quote
  #4  
Old   
Oliver Schulze L.
 
Posts: n/a

Default Re: dbtran and operations timestamp - 04-11-2006 , 09:41 AM



I forgot to write that I'm interested in the aproximate date/time
of the operation. Or even only the date.
Thanks
Oliver

Reply With Quote
  #5  
Old   
Reg Domaratzki \(iAnywhere Solutions\)
 
Posts: n/a

Default Re: dbtran and operations timestamp - 04-11-2006 , 09:52 AM



Quote:
What does this number means: 0053302002
That number is the log offset of the operation that took place. It's simply
an ever increasing 64-bit integer and has nothing to do with the time the
operation was executed, other than the fact that you can order the
operations that took place using the log offset.

Again, there is NO information in the transaction log about what time an
operation took place other than the timestamps associated with the
CHECKPOINT and CONNECT operations that you have already figured out.

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swd/base.do
-> Choose SQL Anywhere Studio
-> Set filter to "Display ALL platforms IN ALL MONTHS"


"Oliver Schulze L." <news.oliver (AT) samera (DOT) com.py> wrote

Quote:
Hi Reg,
thanks for your answer.

Is there a way I can deduce the timestamp?
What does those numbers means? Are they seconds, miliseconds?

For example, can I deduce the timestamp here:
--CHECKPOINT-0000-0053302002-2005/dec/21 02:32
--CONNECT-1001-0053302028-dba-2005/dec/21 02:34
--BEGIN TRANSACTION-1001-0053302039
BEGIN TRANSACTION
go
--COMMIT-1001-0053302044
COMMIT WORK
go

What does this number means: 0053302002

Many thanks
Oliver

Reg Domaratzki (iAnywhere Solutions) wrote:
No.

Checkpoint and connect operations include the timestamp in them, but
none of
the other operations include any information in the log file about the
time
the operation was executed, so there's no way for dbtran to provide this
information.




Reply With Quote
  #6  
Old   
Breck Carter [Team iAnywhere]
 
Posts: n/a

Default Re: dbtran and operations timestamp - 04-11-2006 , 10:10 AM



Since checkpoints happen every 20 minutes or so on an idle server, you
should be able to use the checkpoint timestamps to get fairly close.

On 11 Apr 2006 07:41:29 -0700, "Oliver Schulze L."
<news.oliver (AT) samera (DOT) com.py> wrote:

Quote:
I forgot to write that I'm interested in the aproximate date/time
of the operation. Or even only the date.
Thanks
Oliver
--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhe...ers_Guide.html
breck.carter (AT) risingroad (DOT) com


Reply With Quote
  #7  
Old   
Oliver Schulze L.
 
Posts: n/a

Default Re: dbtran and operations timestamp - 04-11-2006 , 01:16 PM



Hi Breck and Reg,
thanks for the answers.

Since I needed approximate timestamps, I wrote a little bash/perl
script that cycle the output from dbtran, then I keep storing
the latest '--CONNECT' timestamp and use that timestamp to create
a new table that have the most recent timestamp and the PK from
the INSERT() statement.

I need to use the -d option in dbtran and check that no earlier
connect timestamp is found while cycling. I found a strange issue
where I see a '--CONNECT' timestamp that is earlier than the
previous '--CONNECT' timestamp. I solved that problem with a
timestamp compare.

That solved my problem,
Cheers
Oliver

Breck Carter [Team iAnywhere] wrote:
Quote:
Since checkpoints happen every 20 minutes or so on an idle server, you
should be able to use the checkpoint timestamps to get fairly close.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.