dbTalk Databases Forums  

Need uptime value since DB server started

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


Discuss Need uptime value since DB server started in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Scott Huerta
 
Posts: n/a

Default Need uptime value since DB server started - 01-15-2010 , 10:55 AM






SA10.0.1.3784
Windows Server 2003
Windows XP Pro

I've searched the online documentation and was unable to find
anything.

Is there a database server property that can be queried that indicates
how long the database has been up and running?

Thanks

Scott Huerta
3i Infotech (formerly Distinctive Solutions Corp.)

Reply With Quote
  #2  
Old   
Bruce Hay
 
Posts: n/a

Default Re: Need uptime value since DB server started - 01-15-2010 , 11:24 AM






The following should do it:
select property('StartTime')
You can convert the resulting string to a timestamp and use the datediff()
function to calculate an uptime.
select datediff(second,property('StartTime'),current timestamp)

SQL Anywhere Developer Community:
http://www.sybase.com/developer/libr...ere-techcorner


SQL Anywhere Blog Center: http://www.sybase.com/sqlanyblogs




Scott Huerta wrote:
Quote:
SA10.0.1.3784
Windows Server 2003
Windows XP Pro

I've searched the online documentation and was unable to find
anything.

Is there a database server property that can be queried that indicates
how long the database has been up and running?

Thanks

Scott Huerta
3i Infotech (formerly Distinctive Solutions Corp.)

Reply With Quote
  #3  
Old   
Scott Huerta
 
Posts: n/a

Default Re: Need uptime value since DB server started - 01-15-2010 , 01:42 PM



Perfect!

Thank you.

On 15 Jan 2010 09:24:17 -0800, Bruce Hay
<h_a_y_@_i_a_n_y_w_h_e_r_e_d_o_t_c_o_m> wrote:

Quote:
The following should do it:
select property('StartTime')
You can convert the resulting string to a timestamp and use the datediff()
function to calculate an uptime.
select datediff(second,property('StartTime'),current timestamp)

SQL Anywhere Developer Community:
http://www.sybase.com/developer/libr...ere-techcorner


SQL Anywhere Blog Center: http://www.sybase.com/sqlanyblogs




Scott Huerta wrote:
SA10.0.1.3784
Windows Server 2003
Windows XP Pro

I've searched the online documentation and was unable to find
anything.

Is there a database server property that can be queried that indicates
how long the database has been up and running?

Thanks

Scott Huerta
3i Infotech (formerly Distinctive Solutions Corp.)
Scott Huerta
3i Infotech (formerly Distinctive Solutions Corp.)

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.