Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

How can I run a command to find the total database space and the remaining database space? The dbinfo command doesn't seem to have the information I am looking for.

asked 11 Sep '17, 16:27

solomond's gravatar image

solomond
71338
accept rate: 100%


You can do-it-yourself...

SELECT
CAST ( DB_PROPERTY ( 'PageSize'  ) AS INTEGER ) AS PageSize,
CAST ( DB_PROPERTY ( 'FileSize'  ) AS BIGINT ) AS FileSize,
CAST ( DB_PROPERTY ( 'FreePages' ) AS INTEGER ) AS FreePages,
CAST ( ( PageSize * FileSize ) / 1024.0 / 1024.0 AS DECIMAL ( 11, 1 ) ) AS FileMB,
CAST ( ( PageSize * FreePages ) / 1024.0 / 1024.0 AS DECIMAL ( 11, 1 ) )  AS FreeMB,
CAST ( ( ( FileSize - FreePages ) * 100.0 ) / FileSize AS DECIMAL ( 11, 1 ) )  AS UsedPercent;

   PageSize             FileSize   FreePages        FileMB        FreeMB   UsedPercent 
----------- -------------------- ----------- ------------- ------------- ------------- 
       4096              1650235      235264        6446.2         919.0          85.7 

or let Foxhound monitor the numbers...

alt text

permanent link

answered 12 Sep '17, 16:55

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

Are you using dbinfo -u.

That output is very detailed about number of pages - used and free, usage percentages by table for table and index pages.

Here is an example dbinfo -u output. If it is not sufficient for your needs, can you describe what other information is needed:

SQL Anywhere Information Utility Version 17.0.8.4003
Database  : c:\sa\sa17\samples\demo.db
Log file  : c:\sa\sa17\samples\demo.log
Free pages: 565275
Page size : 4096

     Table   Table            Index           Percent  Name
      id     Pages    %used   Pages    %used  of File
     -----  --------  -----  --------  -----  -------  ----
         1        11  ( 84)        10  ( 44)      0    ISYSTAB
...
      3008         1  (  3)         2  (  9)      0    Departments
            ========         ========
Total:           355 table +      496 index + 565275 free + 0 bit map + 162 other = 566288 pages
permanent link

answered 11 Sep '17, 20:58

Chris%20Keating's gravatar image

Chris Keating
7.8k49128
accept rate: 32%

How do I address the command exactly within the OSX (10.13) terminal ?

./dbinfo -u /Applications/SQLAnywhere17/System/demo.db

Whats wrong with that?

thx for your help, guys!

permanent link

answered 20 Sep '18, 11:26

macsche's gravatar image

macsche
24224
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×6
×2

question asked: 11 Sep '17, 16:27

question was seen: 2,385 times

last updated: 20 Sep '18, 11:26