dbTalk Databases Forums  

get DB size by using SQL

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


Discuss get DB size by using SQL in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Harjo Kompagnie
 
Posts: n/a

Default get DB size by using SQL - 01-24-2010 , 01:11 PM






Hi, we are using SQL anywhere 10/11

how can we determine the DB Size for SQL anywhere?
I found something similar for MSSQL & mySQL here:
http://www.youdidwhatwithtsql.com/ge...-and-mysql/414

can this be done with SQL anywhere 10/11? and specially with an extra
filter, per table:

WHERE multitenant_id = '12' //just an example

Reply With Quote
  #2  
Old   
Arthur Hefti
 
Posts: n/a

Default Re: get DB size by using SQL - 01-24-2010 , 11:05 PM






You can get the file size of the main dbspace by doing a select
db_property('filesize') or use select DB_EXTENDED_PROPERTY() for the
file size of the additional files. The functions return the number of
pages. This number you have to multiply by the page size of your DB.
Determine the size of some records in a couple of tables is quite
different, as a database contains empty pages or pages not filled up.
To achieve this you would have to calculate the size of a record in
each table, which when using e.g. long varchar, would be quite
difficult, multiply it with the number of records in the table and
summarize it.

Regards
Arthur
--



Harjo Kompagnie wrote:

Quote:
Hi, we are using SQL anywhere 10/11

how can we determine the DB Size for SQL anywhere?
I found something similar for MSSQL & mySQL here:
http://www.youdidwhatwithtsql.com/ge...-t-sql-and-mys
ql/414

can this be done with SQL anywhere 10/11? and specially with an extra
filter, per table:

WHERE multitenant_id = '12' //just an example

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.