Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Determine DB size

7 posts in General Discussion Last posting was on 2007-11-12 12:53:17.0Z
orpiw Posted on 2007-11-12 11:34:59.0Z
Sender: dc1.47383a04.1804289383@sybase.com
From: orpiw
Newsgroups: ianywhere.public.general
Subject: Determine DB size
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47383a63.dc6.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Nov 2007 03:34:59 -0800
X-Trace: forums-1-dub 1194867299 10.22.241.41 (12 Nov 2007 03:34:59 -0800)
X-Original-Trace: 12 Nov 2007 03:34:59 -0800, 10.22.241.41
Lines: 2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6552
Article PK: 4812

Is there a way to determine DB size in Sybase SQL Anywhere
DB Edition 10.0.0.2465


Chris Keating (Sybase iAnywhere) Posted on 2007-11-12 11:46:45.0Z
From: "Chris Keating (Sybase iAnywhere)" <keating_spam_free@ianywhere.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Determine DB size
References: <47383a63.dc6.1681692777@sybase.com>
In-Reply-To: <47383a63.dc6.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpneast-client-013.sybase.com
X-Original-NNTP-Posting-Host: vpneast-client-013.sybase.com
Message-ID: <47383d25@forums-1-dub>
Date: 12 Nov 2007 03:46:45 -0800
X-Trace: forums-1-dub 1194868005 10.18.242.20 (12 Nov 2007 03:46:45 -0800)
X-Original-Trace: 12 Nov 2007 03:46:45 -0800, vpneast-client-013.sybase.com
Lines: 6
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6555
Article PK: 3137

The Database-level properties FileSize will report that information. See
"FileSize" in the online help for more details.

orpiw wrote:
> Is there a way to determine DB size in Sybase SQL Anywhere
> DB Edition 10.0.0.2465


orpiw Posted on 2007-11-12 11:46:12.0Z
Sender: dc1.47383a04.1804289383@sybase.com
From: orpiw
Newsgroups: ianywhere.public.general
Subject: Re: Determine DB size (more details)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47383d04.df4.1681692777@sybase.com>
References: <47383a63.dc6.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Nov 2007 03:46:12 -0800
X-Trace: forums-1-dub 1194867972 10.22.241.41 (12 Nov 2007 03:46:12 -0800)
X-Original-Trace: 12 Nov 2007 03:46:12 -0800, 10.22.241.41
Lines: 18
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6554
Article PK: 3142

There is a requirement to determine DB size of a SQL
Anywhere 10 DB and display it on a .NET Client. This is what
I want to do but IT DOESN'T WORK:

1. Create a user SP, say, getdbsize as follows:
2. select file_name from sysfile. E.g.
C:\MyDatabases\MyDb1.db
3. Parse file_name to get path of the db file. E.g.
C:\MyDatabases
4. Exec xp_cmdshell 'path from step 3', no_output. E.g.
xp_cmdshell 'C:\MyDatabases\MyDB1.*'
5. This should ideally give the following output as a single
column from which I can get SIZE:
DATE TIME SIZE FILENAME

THIS DOESN'T WORK.

PLEASE HELP!


Breck Carter [Team iAnywhere] Posted on 2007-11-12 12:53:17.0Z
From: "Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Determine DB size (more details)
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <l3jgj39g5201av828i2t2u8qfttlo3c049@4ax.com>
References: <47383a63.dc6.1681692777@sybase.com> <47383d04.df4.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: bcarter.sentex.ca
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
Date: 12 Nov 2007 04:53:17 -0800
X-Trace: forums-1-dub 1194871997 64.7.134.118 (12 Nov 2007 04:53:17 -0800)
X-Original-Trace: 12 Nov 2007 04:53:17 -0800, bcarter.sentex.ca
Lines: 38
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6561
Article PK: 3143

What exactly do you expect this command

C:\MyDatabases\MyDB1.*

to do? I think it does nothing.

When using xp_cmdshell, make sure your command string works at all
before putting it in a call to xp_cmdshell.

Breck

On 12 Nov 2007 03:46:12 -0800, orpiw wrote:

>There is a requirement to determine DB size of a SQL
>Anywhere 10 DB and display it on a .NET Client. This is what
>I want to do but IT DOESN'T WORK:
>
>1. Create a user SP, say, getdbsize as follows:
>2. select file_name from sysfile. E.g.
>C:\MyDatabases\MyDb1.db
>3. Parse file_name to get path of the db file. E.g.
>C:\MyDatabases
>4. Exec xp_cmdshell 'path from step 3', no_output. E.g.
>xp_cmdshell 'C:\MyDatabases\MyDB1.*'
>5. This should ideally give the following output as a single
>column from which I can get SIZE:
>DATE TIME SIZE FILENAME
>
>THIS DOESN'T WORK.
>
>PLEASE HELP!

--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
breck.carter@risingroad.com


Breck Carter [Team iAnywhere] Posted on 2007-11-12 12:50:16.0Z
From: "Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Determine DB size
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <msigj35iubk60kfhnaent54ak0i7tf4bmq@4ax.com>
References: <47383a63.dc6.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: bcarter.sentex.ca
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
Date: 12 Nov 2007 04:50:16 -0800
X-Trace: forums-1-dub 1194871816 64.7.134.118 (12 Nov 2007 04:50:16 -0800)
X-Original-Trace: 12 Nov 2007 04:50:16 -0800, bcarter.sentex.ca
Lines: 27
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6560
Article PK: 3145

It depends on what you mean by "DB size" but this query should tell
you what you want to know; each one of these properties is described
in the Help:

SELECT DB_PROPERTY ( 'PageSize' ),
DB_PROPERTY ( 'FileSize' ),
DB_PROPERTY ( 'FreePages' ),
DB_PROPERTY ( 'DBFileFragments' ),
DB_PROPERTY ( 'File' );

DB_PROPERTY('PageSize'),DB_PROPERTY('FileSize'),DB_PROPERTY('FreePages'),DB_PROPERTY('DBFileFragments'),DB_PROPERTY('File')

'4096','2341','934','1','C:\\projects\\foxhound\\activation\\activation.db'

Breck

On 12 Nov 2007 03:34:59 -0800, orpiw wrote:

>Is there a way to determine DB size in Sybase SQL Anywhere
>DB Edition 10.0.0.2465

--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
breck.carter@risingroad.com


Chris Keating (Sybase iAnywhere) Posted on 2007-11-12 12:05:50.0Z
From: "Chris Keating (Sybase iAnywhere)" <keating_spam_free@ianywhere.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Determine DB size
References: <47383a63.dc6.1681692777@sybase.com>
In-Reply-To: <47383a63.dc6.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpneast-client-013.sybase.com
X-Original-NNTP-Posting-Host: vpneast-client-013.sybase.com
Message-ID: <4738419e$1@forums-1-dub>
Date: 12 Nov 2007 04:05:50 -0800
X-Trace: forums-1-dub 1194869150 10.18.242.20 (12 Nov 2007 04:05:50 -0800)
X-Original-Trace: 12 Nov 2007 04:05:50 -0800, vpneast-client-013.sybase.com
Lines: 6
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6557
Article PK: 4815

please refrain from crossposting. I answered your post in
sqlanywhere.general forum.

orpiw wrote:
> Is there a way to determine DB size in Sybase SQL Anywhere
> DB Edition 10.0.0.2465